Jump to content
  • Advertisement
Sign in to follow this  
skwee

OpenGL Shadows, How to do them?

This topic is 3891 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!