Game Development Community

CustomMaterial multiple pass bug

by BBS Games · in Torque Game Engine Advanced · 05/17/2006 (1:35 am) · 0 replies

Hi,

I'm trying to do a multipass shader and when I set up more then 1 pass the engine hangs in this infinite loop (tsMesh.cpp):

if( matInst )
{
while( matInst->setupPass( sgData ) )
{
// set clamp/wrap
U32 flags = materials->getFlags(matIndex);
GFXTextureAddressMode smode = GFXAddressClamp;
GFXTextureAddressMode tmode = GFXAddressClamp;
if (flags & TSMaterialList::S_Wrap)
smode = GFXAddressWrap;
if (flags & TSMaterialList::T_Wrap)
tmode = GFXAddressWrap;
GFX->setTextureStageAddressModeU( 0, smode );
GFX->setTextureStageAddressModeV( 0, tmode );

// draw
GFX->drawPrimitive( i );
}
}

I was thinking that was a problem with my customized CustomMaterial but I've just tryed it with a fresh TSE build and hacked a material of terrain_water_demo :

new CustomMaterial(SixBump)
{
mapTo = two;

texture[0] = "metalcrate_bump";
texture[1] = "six";
texture[3] = "$cubemap";

cubemap = Lobby;

shader = BumpCubeDiff;

specular = "1.0 1.0 1.0 0.0";
specularPower = 20.0;

version = 2.0;
fallback = SixBumpFallback;
pass[0] = FiveBump;
pass[1] = Two;
};

solutions?