Multi Pass Custom Materials
by Adrian W · 01/24/2009 (1:43 am) · 8 comments
I had to do some TGEA engine hackery to get the pass command to work in custom materials so thought I would post the changes here.
www.futurenation.net/dtsMerger/tiki-list_file_gallery.php?galleryId=7
Changes are to the ProcessedCustomMaterial class. Changes are in #ifdef ADE_LMVERTS blocks so you need to add this define to your project preprocessor settings. Note that I've assumed that the first material in the chain is pass[0] so subsequent passes start from pass[1], e.g:
new CustomMaterial( wetshader )
{
texture[0] = "txt_stoneslab05";
texture[1] = "txt_stoneslab05_bmp";
texture[2] = "rainbow";
texture[3] = "$cubemap";
texture[4] = "$fog";
shader = AdeWetShader;
cubemap = "Sky_Day_Blur02";
version = 2.0;
BlendOp = LerpAlpha;
};
new CustomMaterial( txt_stoneslab05 )
{
mapTo = "txt_stoneslab05";
texture[0] = "txt_stoneslab05";
texture[1] = "$fog";
shader = AtsShapeNoLm;
version = 2.0;
pass[1] = "wetshader";
};
PS I've only tested it with 1.7.1
PPS. the DTS Merger resource seemed to get dropped in the site move so here is the link back:
www.futurenation.net/dtsMerger/tiki-list_file_gallery.php?galleryId=4
www.futurenation.net/dtsMerger/tiki-list_file_gallery.php?galleryId=7
Changes are to the ProcessedCustomMaterial class. Changes are in #ifdef ADE_LMVERTS blocks so you need to add this define to your project preprocessor settings. Note that I've assumed that the first material in the chain is pass[0] so subsequent passes start from pass[1], e.g:
new CustomMaterial( wetshader )
{
texture[0] = "txt_stoneslab05";
texture[1] = "txt_stoneslab05_bmp";
texture[2] = "rainbow";
texture[3] = "$cubemap";
texture[4] = "$fog";
shader = AdeWetShader;
cubemap = "Sky_Day_Blur02";
version = 2.0;
BlendOp = LerpAlpha;
};
new CustomMaterial( txt_stoneslab05 )
{
mapTo = "txt_stoneslab05";
texture[0] = "txt_stoneslab05";
texture[1] = "$fog";
shader = AtsShapeNoLm;
version = 2.0;
pass[1] = "wetshader";
};
PS I've only tested it with 1.7.1
PPS. the DTS Merger resource seemed to get dropped in the site move so here is the link back:
www.futurenation.net/dtsMerger/tiki-list_file_gallery.php?galleryId=4
#2
01/24/2009 (2:21 am)
* problem solved *
#3
Thanks for keeping me out of hot water!
01/24/2009 (2:25 am)
@Konrad: Good point, I'll take it offline temporarily and edit.Thanks for keeping me out of hot water!
#4
01/24/2009 (2:30 am)
No worries, thanks for fixing it.
#6
hmm resources work again woot. i hope to see other people that have been waiting to post resources to post them now.
01/24/2009 (3:27 am)
i know this is spam so sorry. :Phmm resources work again woot. i hope to see other people that have been waiting to post resources to post them now.
#8
Use mingw or gnu windows patch to apply.
I'll get the DTS Merger engine changes back up in similar fashion some time next week
01/24/2009 (5:00 am)
OK they are available again, but now as patch files.Use mingw or gnu windows patch to apply.
I'll get the DTS Merger engine changes back up in similar fashion some time next week

Associate Konrad Kiss
Bitgap Games