Highly compatible shadow maps... how?

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?

tx!

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 .

cu
Tom

You could try to do it in a vertex shader.

Shadow mapping. A per-fragment, texture-based effect. In a vertex shader. That can’t access textures.

Yeah. OK. Right.

Besides, fragment programs/pixel shader are hardly “wide ranging” nowadays, they’ll become… in a few years.

If you want a rough idea how widely a particular extension is supported, you can have a look at:
http://www.delphi3d.net/hardware/allexts.php

Originally posted by Korval:
[b] Shadow mapping. A per-fragment, texture-based effect. In a vertex shader. That can’t access textures.

Yeah. OK. Right. [/b]

OK, I thought about shadow volumes, but now i see he wants shadow mapping.

cu
Tom

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.