Andrew Jameson
10-07-2007, 07:44 AM
I'm using the standard technique for projected shadows using the stencil buffer and it works very well. As the projection process uses a horizontal plane (0,1,0) then any vertical displacement of a shadow generator results in a displacement of the shadow - i.e. the rendered object and its shadow no longer meet.
A thought occured to me that I can get the shadow position to remain consistant if I move the generator during the shadow rendering phase but my maths fails me ...any ideas on how to move the x, z of the object in relation to its y position and the light source ?
I've looked at techniques like mapping but I'm working on a fairly large terrain project and I can't get the shadow resolution that I need ... any alternative methods / examples would be of interest.
Thanks
Andrew
A thought occured to me that I can get the shadow position to remain consistant if I move the generator during the shadow rendering phase but my maths fails me ...any ideas on how to move the x, z of the object in relation to its y position and the light source ?
I've looked at techniques like mapping but I'm working on a fairly large terrain project and I can't get the shadow resolution that I need ... any alternative methods / examples would be of interest.
Thanks
Andrew