There are so many variations of the shadow / render_to_texture extension that I find it difficult to get at a “common denominator” shadow map solution that will work on the widest range of hardware.
For what I am trying to acheive, hardware-specific stuff like DEPTH_COMPONENT_NV is out of the question.
Anyone know of a good example somewhere showing a nice, generic solution to hardware shadow maps?
You could try to do it in a vertex shader. This would give you a wide range of graphic boards.
Or you could try this : http://oss.sgi.com/projects/ogl-sample/registry/ARB/shadow.txt
, but i don’t know how many boards support it. It’s an arb_extension, but you never know in OpenGL until it becomes a part of the core .
ARB_shadow_map extension isnt that common either… all cards that supports it does support vertexprogram ( please correct me if im wrong) and most supports some kind of fragment shading system, and all supports p-buffers.
just render to a pbuffer with a depthbuffer and copy the depth component to a texture (instead of render to it directly). that will work on most cards.
other solutions is to encode the depth into RGBA and use a normal RGBA texture ( and make the shadow test in a fragment program aswell, not using the arb_shadow_map thingie at all.