Game Development Community

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:
img199.imageshack.us/img199/8218/proceduralroadshadowcol.jpg
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:
img202.imageshack.us/img202/3258/shadowclippinginterior.jpg
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!


#1
06/13/2010 (7:03 pm)
I think I may have found the answer while looking for something completely different. Here it is in case it helps anyone else, and so I don't forget it:
// 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.
#2
06/14/2010 (3:25 pm)
Thats a good find, let me know if that works for your meshroad.