PDA

View Full Version : Shadow mapping w/out GL_ARB_shadow



soconne
09-20-2003, 09:01 AM
How do you compare the depth values in the depth texture with the current incoming z value? I'm using a Radeon 9000 Mobility, and it doesn't support GL_ARB_shadow, but I can run Nvidia's shadowmapping demo. Except that I cannot seem to find the GL calls to compare the z values. Could someone point me in the right direction?

rgpc
09-21-2003, 02:55 AM
Your card most likely supports GL_SGIX_shadow which is an "equivalent" of GL_ARB_shadow. I don't use ATI cards but I'd guess that you may have old drivers. If you update then you may find that your card does support GL_ARB_shadow.

soconne
09-21-2003, 05:36 AM
Nah, I looked it up on ATi's site and they list every extension and which ones are supported by which cards, and my Radeon 9000 doesn't support GL_ARB_shadow or the SGIX one. Of course, I can't update my drivers because I have a laptop with the Radeon 9000 and every time I donwnload the new drivers it says it can't find an equiavelant driver.

Anyone know how to get passed this issue with upgrading laptop display drivers for ATI cards?

wimmer
09-21-2003, 05:56 AM
You are probably looking at dual texture shadow mapping, introduced by Wolfgang Heidrich in 1999 in his PhD thesis. It doesn't need specific shadow mapping extensions, and you can look it up in his thesis or on NVidia's developer website (http://developer.nvidia.com/object/ogl_shadowmap.html).

Michael

AdrianD
09-21-2003, 07:29 AM
http://mirror.ati.com/developer/samples/shadowmap.html

this demo is for directX, but it still demostrates how to do HW-shadowmapping on your ATI9000 card.(you'll have to use ATI_fragemnt_program for a openGL version)


EDIT: the correct name of the extension is ATI_fragment_shader.

[This message has been edited by AdrianD (edited 09-21-2003).]

jwatte
09-22-2003, 08:59 AM
Radeons < 9500 do not support depth compare necessary for the SGIX-style shadow maps. Boo-hoo!

Instead, you can do ID based shadow mapping. Render each triangle (or each mesh component) in a specific color, and set up the fragment shader to compare the calculated color for a pixel with the ID buffer for that pixel; if the same, it's lit; else not.

Korval
09-22-2003, 11:35 AM
Radeons < 9500 do not support depth compare necessary for the SGIX-style shadow maps. Boo-hoo!

As long as you can texture fetch, and do a compare, you can do shadow mapping. You can still build it out of ATI_fragment_shader.

flo
09-22-2003, 11:20 PM
The NVidia demo has a code path that uses a linear alpha ramp to simulate depths: an 1D-alpha texture with a linear rise from 0 to 1 is bound and texture generation is used such that the near clipping plane has an alpha value of 0, the far clipping plane of 1. Then the resulting alpha texture is used as a depth map; the alpha(depth) comparison can be simulated with texenv and alpha test.

I think this is the rendering path that is used on the radeon 9000. Of course you only get 256 different depth values because alpha is only 8 bit.