Sign in to follow this  
Rhawk187

Shadowing Question

Recommended Posts

Rhawk187    122
So I'm playing around with shadow voluming, and I'm working with z-fail, and I'm trying to add caps to my volume and I'm having a little issue. So I followed the suggestion on another poster on the forums and use the front-facing faces (with respect to the light source) for the top cap, and the extruded back-facing faces (with respect to the light source) as the far cap. The problem comes that now that I'm using that near cap it seems to be undoing shadows cast on objects by other objects. For instance, I have a deer model casting a shadow on a sphere. With no caps it looks fine, but the near cap (mimicking the front-facing faces of the sphere) is front-facing (with respect to the viewer) and therefore causes a decrement. In cases where both the near and far caps are viewed through, I understand the need for both, but in the situation where only the near cap is looked through it seems to be erasing shadows cast on my shadow casters, lol. Is this normal? Should I be rendering shadows between each stencil manipulation? I have a feeling that rendering the shadows per stencil manipulation for each object would solve the shadow casting on object problem, but then I get the problem of some sections getting "double shadowed." I'm not using 100% opacity on my shadows, so when a shadow gets drawn from two different objects on the same area it's noticeably different from 1, which is not what I am going for. It sort of seems like the result I'm looking for is the sum of the stencil buffers from each object, so I only have to shadow once but still get the results from every object, uncorrupted from the following objects. Am I doing this right? Is there something obvious I should be doing? Let me know if you need anymore information. Thanks for your help.

Share this post


Link to post
Share on other sites
Rhawk187    122
I've been reading around and I think I've narrowed it down to a problem mentioned in

http://www.gamedev.net/columns/hardcore/shadowvolume/page3.asp

Their suggestion is to use the z-bias, but I'm using OpenGL, and I've never done that before so I'm looking around trying to figure out how to do that right now. Is this actually the common solution, or was it just a quick one that guide gave?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this