Game Development Community

Problem turning off the players shadow

by ChrisP · in Torque Game Engine · 02/17/2005 (9:47 am) · 2 replies

Hi,

I'm using a tsShapeInstance in 1.3 with multiple mesh objects as my player. I've found that if I try to turn off the players shadow by commenting out the line renderShadow(dist,fogAmount); in the renderImage() function in player.cc, then when the player is displayed from a third person view, the rendered shape is horribly distorted. Only one mesh, which corresponds to the mMeshObject[0] of the tsShapeInstance appears to display normally (which may explain why this wouldn't usually show up as a problem when people are using only single meshes).
If I go into the renderShadow() function in shapeBase.cc, I can comment out the mShadow->render(); line in order to prevent the shadow from being rendered without distorting my shapes - nonetheless, I can't comment out any of the other code in this function, or the shape becomes distorted again. There's probably a better way for turning off shadows that I'm missing, but can anybody tell me the depedency in the shadow code (perhaps needing a shadow bitmap?).

Cheers,
Chris

#1
02/17/2005 (10:57 am)
I think setting the global shadow quality to 0 (it's a console variable in prefs.cs) will turn off shadows.
#2
02/18/2005 (2:44 am)
Thanks Manoel. I used this setting in my version, and still get distorted mesh problems when shadows are disabled. But I tried it in the unmodified 1.3 source, and it works fine there, so guess I just screwed something up in my version. Looks like time for some bug-hunting... :-\

Update: Okay, problem solved. I changed the TSMesh::render function and forgot to update its inheritor, TSSkinMesh::render, meaning that for skinned meshes, the skin update would only be called when shadow rendering was enabled.