Original Post
I'm trying to create a volumetric lighting effect that is basically a cross between nvidia's volume fog demo and their volume lighting demo. I render the depths for the front and back of a light's frustum, then render the frustum geometry again with a shader that reconstructs the front and back positions of the frustum per pixel, then samples between them with the light's shadow map. It's creating a very nice effect and is running fast with zero effort to try and optimize it yet. However I'm getting some really weird problems when I sample from different camera angles. The shadow's cast in the volume are wrongly view-dependent when facing the towards the light. The problem appears that because I'm rendering the frustum back face to do this effect, I'm getting the distortion from the shape of the geometry. I'm completely stumped as to what would fix this.
EDIT: Updated pictures to highlight the problem.
Image 1
Image 2
Image 3
[Edited by - M4573R on September 12, 2010 1:32:40 AM]
EDIT: Updated pictures to highlight the problem.
Image 1
Image 2
Image 3
[Edited by - M4573R on September 12, 2010 1:32:40 AM]