Game Development Community

Possible batching problem? Objects borrowin material properties?

by Peter Haffenreffer · in Torque Game Engine Advanced · 08/05/2008 (9:00 am) · 2 replies

I'm working with a game with an isometric view. I have set up a box between the player and the camera and all objects within this box fade to a target alpha. This works beautifully with one object on screen and sometimes even a few objects; however problems start when there are a lot of objects.

Some objects that aren't anywhere close to the player will start fading. Other objects that are clearly in the box and have a confirmed correct mFadeVal do not fade.

This is leading me to the believe that there is a problem with a batching, but I'm not too sure. I was wondering if anyone has experienced anything similar to this. Also, could someone point me in the direction of the code that is responsible for batching objects?

Thanks

#1
08/05/2008 (9:03 am)
Something to note is that the object is definitely getting added to the RenderTranslucentMgr every frame.
#2
08/05/2008 (9:29 am)
Fixed the problem. Wasn't a batching issue but a shader issue. The current code doesn't pass the object visibility to the shader all the time. In sgLightManager::setLightInfo(), I added the following line of code:

GFX->setPixelShaderConstF(PC_VISIBILITY, (float*)&(sgData.visibility), 1);

All set.