Sign in to follow this  
skwee

OpenGL Shadows, How to do them?

Recommended Posts

Hello all. I think its my first post here hehe :P Well I read about Shadow Volume, didn't have enough luck with realizing it. But as I understood to get shadow volume work correct I need to render the scene twice, it can affect the fps if the scene have many triangles. Anyway I wanted to ask for references about how to make shadows in OpenGL and what is the "best" way to do it? Hmm also wanted some references/tutorials (better with code) for frustum culling if possible. Thanks.

Share this post


Link to post
Share on other sites
There are two real ways of doing Shadows:

1.)Shadow Mapping
Render the Scene twice once from the view of the light the second time compare depth values to determine if an pixel is in shadow or not. For this there are various technices to improve the shadow quality like PSM (perspectific shadow mapping)

2.)Shadow Volumes
Through drawing the Shadow Volumes and Objects various times (depents on the used method) the number of rayintersetions with the shadowvolume is counted in the stencil buffer.
Even number => no shadow
uneven Number => Shadow
The only real way to produce robust shadow volumes is Carmack's reverse on which creative has a patent on. Also it is a bit of a hack to code it with opengl because there is no standard extension, you have to write the code twice for ati / nvidia.

I would recommend Shadow Mapping
Usefull google phrases:
Shadow Mapping (^^)
Frame Buffer Object

Share this post


Link to post
Share on other sites
There is really nothing to add: Real time shadaows rely on implementation of these two classes of algorithms. The Doom 3 engine (quake 4, prey, fear) use volume shadows. My opinion is that Shadow mapping are a better choice for future games, the only problem being that SM have a number of issues (aliasing, z precision artifacts atc) not yet fully solved. AFAIK, you should be able to address them in accettable ways though (a lot of papers recently focus on ne versions of SM). By the way, I think that Crisys use them.

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