TSStatic rendershadow error in Torque 1.3
by Luis Anton · in Torque Game Engine · 09/30/2004 (12:41 am) · 0 replies
Hi,
I was trying to get dts shadows working in torque 1.3 when I found that Melv's classical 'fix to get dts shadows working... enjoy' has already been added to 1.3.
There is, I think, a small error in TSStatic::rendershadow that does not let shadows render properly (no render at all)
Well, it's just that, in TSStatic::render Object, glMatrixMode and glPopMatrix should be before renderShadow, not after it:
Remember changing also this two defines in shapebase.h:
#define StaticShape_GenericShadowLevel 0.4f //instead of 2.0f
#define StaticShape_NoShadowLevel 0.01f //instead of 2.0f
And now dts should cast shadows on terrain, at least. No idea about dts shadows on dts shapes. I'll look for it in the forums.
Bye!
I was trying to get dts shadows working in torque 1.3 when I found that Melv's classical 'fix to get dts shadows working... enjoy' has already been added to 1.3.
There is, I think, a small error in TSStatic::rendershadow that does not let shadows render properly (no render at all)
Well, it's just that, in TSStatic::render Object, glMatrixMode and glPopMatrix should be before renderShadow, not after it:
---> put here glMatrixMode and glPopMatrix renderShadow(dist,fogAmount); TSShapeInstance::smNoRenderNonTranslucent = false; TSShapeInstance::smNoRenderTranslucent = false; TextureManager::setSmallTexturesActive(false); !!!glMatrixMode(GL_MODELVIEW); //put it before renderShadow !!!glPopMatrix(); //put it before renderShadow.
Remember changing also this two defines in shapebase.h:
#define StaticShape_GenericShadowLevel 0.4f //instead of 2.0f
#define StaticShape_NoShadowLevel 0.01f //instead of 2.0f
And now dts should cast shadows on terrain, at least. No idea about dts shadows on dts shapes. I'll look for it in the forums.
Bye!