Shadow volumes

Hello,

Excuse me for the off-topic,

I’ve been working to use shadow volumes on PSP (it’s ge is very similar to opengl). The problem is that PSP does not perform clipping, it just culls off primitives wich vertices goes offscreen. So if i try to render my shadow volume the rays are culled and the shadow volume is not rendered properly or more often it disappears.

http://www.esfondo.com/snap0052.bmp
http://www.esfondo.com/snap0053.bmp
http://www.esfondo.com/snap0054.bmp

in the last screenshot the shadow volume is culled bcz it goes over the guardband. I Was wondering if it’s possible to clip the shadow volume or add caps for all the frustrum planes (left,right,bottom,top).

I’ve tried to clip the volume using the Sutherland-Hodgman’s polygon-clipping Algorithm but it didn’t work.

Thanks in advance

Try extruding the shadow volume to a point where it doesn’t clip. That only really works with a guard band so I hope PSP supports that.

but to do that i should change the light position ?

Does PSP cull the whole primitive when any part of it goes offscreen?

yes

To do this you can change the length of the extrusion based on a very simple frustum test. When you get really close and it’s unavoidable you can change the light position but it’s a nasty hack. It has been done before though.

You mean the Infinity value ? I’ve tried but it seems working only with a very low value (it loses the meaning of infinite) and the shadow appears broken