I’m doing some basic shadow mapping using the arb_shadow and arb_depth_texture extensions. Works perfectly on my PC using an nVidia card.
However, when I run the same program (and other samples I found) on a machine running an ATI card, it doesn’t work. Basically, the shadows just don’t show up. But the ATI card does report that these extensions are supported! That doesn’t seem fair to me!
Has anyone else had this problem? Is there a solution? If not, is there a simple shadow mapping option that works on both chipsets?
Have you checked that the depth you’ve rendered has come out properly on the ATI card by rendering that texture to screen first or something, one thing which might be the problem is that ATI cards need to be given 16bit (GL_DEPTH_COMPONENT16) depth whereas Nvidia work with 24bit (GL_DEPTH_COMPONENT24), unless recent drivers updates have added this to ATI cards, I think even if you go the FBO route and give an ATI card 24bit depth it won’t give the framebuffer incomplete status and continue as normal, but the output to texture would not work.
Depth texture extensions are not working on ATI cards. Neither the texture compare more nor the comparison function will work (unless I’ve missed something ?)
Instead, you must do the comparison yourself in the program: do the perspective divide op in the pixel shader and use something like a SGE instruction to simulate the comparison function.
Btw, depth textures are 16 bits only, even if you speficy the 24 bits format.
Hope this helps.
Whoa hang on. I’m not using a pixel shader or anything. I haven’t needed to because it all worked so nicely as basic shadow maps on the nVidia card. So these extensions just don’t work? Surely ATI wouldn’t allow them to stay not working for long?
Hang on, that can’t be right. I just ran a java example from: jogl-demos.dev.java.net and the shadow mapping seemed to work fine.
So the extensions must work. Now the question is, why wouldn’t it work in my C++ program…?
Most likely there is a bug in your application. You should use glGetError to locate it.
The shadow extensions work on the ATI cards however the driver is picky about settings used to render them.
For me they work when rendering into GL_DEPTH_COMPONENT16 texture using the FBO without color attachment.
You can alternatively use sampler2DShadow in GLSL, it works too, with or without using FBO.
What doesn’t work on ATI is an array of shadow samplers accessed in a for cycle.