Shadow question
by Bryce · in Torque Game Engine · 11/28/2009 (2:30 pm) · 2 replies
Hello everyone,
I design my player models in Milkshape 3D, and its exporter allows me to have shapes with a detail level of -1 which forces those shapes to not render. From what I've seen, I'm assuming that shapes render the shadow of their lowest detail level, but this is causing problems because the shadow of the should-be hidden shapes are showing.
If anybody can make any sense of this, would there be a way to force the engine (I'm using 1.4.2) to render the shadow of the shape at detail level 0?
Thanks!
I design my player models in Milkshape 3D, and its exporter allows me to have shapes with a detail level of -1 which forces those shapes to not render. From what I've seen, I'm assuming that shapes render the shadow of their lowest detail level, but this is causing problems because the shadow of the should-be hidden shapes are showing.
If anybody can make any sense of this, would there be a way to force the engine (I'm using 1.4.2) to render the shadow of the shape at detail level 0?
Thanks!
#2
11/28/2009 (5:57 pm)
Thank you, this worked! The shadow issue has been bugging me for a long time...
Torque 3D Owner Thomas Huehn
In sgObjectShadows.cc look for this part in sgObjectShadows::sgRender
and add the 0 to selectShapeDetail:
if(shadow->needBitmap()) { shadow->beginRenderToBitmap(); //XXTH detail min 0 added ! THIS MAKE RENDER SHADOWS NOT ON THE COLLISION MESH !! shadow->selectShapeDetail(shapeinstance, dist, maxscale,0); //orig: shadow->selectShapeDetail(shapeinstance, dist, maxscale); shadow->renderToBitmap(shapeinstance, parentobject->getRenderTransform(), pos, scale); if(shapebase) {