Jump to content
  • Advertisement
Sign in to follow this  
siberianstar

OpenGL Shadow Mapping

This topic is 4352 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, i've read about depth-shadow mapping method to render dynamic shadows, my problem is that i don't support any OpenGL extension. How could I render a Shadow-Map without GL Extensions ? Do you have an example of how i can do it ? Thanks

Share this post


Link to post
Share on other sites
Advertisement
Quote:

How could I render a Shadow-Map without GL Extensions ?

You can't. At least not on unextended OpenGL 1.1 (which is what you get on Windows without using extensions). Well, you could try to do it with an 8bit alpha depthmap and by abusing the alpha test for the comparison, but that will both be very slow, and very, very ugly.

What's the reason for not supporting extensions ?

Share this post


Link to post
Share on other sites
Why don't you want to use OpenGL extensions? It goes against the whole purpose of OpenGL :/ You can use Mesa if you don't have a good graphics card.

Share this post


Link to post
Share on other sites
I'm coding on PSP not on PC. There is an OpenGL implementation for PSP, but it doesn't have any extension for shadow mapping/pbuffers etc.. (PSP Doesn't have them).

What is mesa?

Share this post


Link to post
Share on other sites
Quote:
Original post by siberianstar
Do you have an example of how could i do that using the alpha test?

That's pretty easy. You first render the light's view, mapping the depth values to the alpha channel. This can be done by using a 1D range remapping alpha texture. Then copy the alpha portion of the framebuffer to an alpha texture. This is your alpha encoded depth map.

Then, when rendering from the camera point of view, apply the alpha texture using projective texturing, and the remapping 1D texture depending on the depth of each vertex as seen from the light. Then subtract the remapped depth alpha from the depth texture alpha. Finally, use the alpha test to differentiate between shadowed and lit regions (by comparing to zero).

This technique is very inefficient though, especially if you don't have support for multitexturing. It's also not very precise, due to the limited range of an 8bit alpha buffer (eventhough the remapping 1D texture will increase precision on a well selected near/far range). You'll get a lot of shadowing artifacts, compared to a modern 24/32 bit depth texture.

If you're interested, this paper describes the technique in detail (see chapter 2.1).

Mesa is a full featured software OpenGL implementation. However, it is very slow compared to hardware support. It will probably not even run on a PSP.

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!