PDA

View Full Version : Shadow volumes



SiberianSTAR
08-17-2006, 01:01 PM
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

dorbie
08-17-2006, 02:18 PM
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.

SiberianSTAR
08-17-2006, 02:39 PM
but to do that i should change the light position ?

cass
08-17-2006, 03:05 PM
Does PSP cull the whole primitive when any part of it goes offscreen?

SiberianSTAR
08-17-2006, 03:31 PM
yes

dorbie
08-17-2006, 03:58 PM
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.

SiberianSTAR
08-17-2006, 04:11 PM
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