PDA

View Full Version : Highly compatible shadow maps... how?



flamz
09-24-2003, 07:41 AM
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!

Tom78
09-24-2003, 01:02 PM
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 http://www.opengl.org/discussion_boards/ubb/frown.gif.

cu
Tom

Korval
09-24-2003, 02:24 PM
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. http://www.opengl.org/discussion_boards/ubb/rolleyes.gif

EG
09-24-2003, 10:46 PM
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

Tom78
09-24-2003, 11:15 PM
Originally posted by Korval:
Shadow mapping. A per-fragment, texture-based effect. In a vertex shader. That can't access textures.

Yeah. OK. Right. http://www.opengl.org/discussion_boards/ubb/rolleyes.gif

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

cu
Tom

Mazy
09-25-2003, 03:03 AM
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.