Shadow Mapping

Started by
4 comments, last by Yann L 17 years, 8 months ago
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
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 ?
Do you have an example of how could i do that using the alpha test?


Thanks
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.
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?
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.

This topic is closed to new replies.

Advertisement