Shadow clipping
by Daniel Buckmaster · in Torque Game Engine · 03/25/2010 (1:45 am) · 2 replies
Torque by default allows shadows to be cast over arbitrary geometry, it seems - as I demonstrated by feeding it single triangles for my procedural road object:

However, you see the shadow doesn't clip against the road, it gets cast twice. This doesn't happen when the shadow is cast on an Interior object, however:

Does anyone know how that is handled? I'd love to be able to have some approximation of stencil shadowing going on, at least for static objects, and I think I've a reasonable idea of how to modify things to get shadows cast on surfaces - but clipping is just as important.

However, you see the shadow doesn't clip against the road, it gets cast twice. This doesn't happen when the shadow is cast on an Interior object, however:

Does anyone know how that is handled? I'd love to be able to have some approximation of stencil shadowing going on, at least for static objects, and I think I've a reasonable idea of how to modify things to get shadows cast on surfaces - but clipping is just as important.
About the author
Studying mechatronic engineering and computer science at the University of Sydney. Game development is probably my most time-consuming hobby!
Torque Owner Daniel Buckmaster
T3D Steering Committee
// only interiors clip... Interior::smLightingBuildPolyList = true; ClippedPolyList::allowClipping = (dynamic_cast<InteriorInstance *>(obj) != NULL);From Shadow::collisionCallback. I assume this needs to be knocked out or changed to allow more object types to clip.