- does all this make sense?
- atm i send u_LightPosition as the plain translation vector. is this correct or should i multiply it by the view matrix before?
- and finally: how to access the depth map in my lighting shader, i.e. how to get the correct uv coordinates?!

thanks!

Brolingstanz

04-24-2007, 12:59 PM

Personally, I've never even really looked at DPSM. Seems to me you'd be far better off looking into shadow cube-maps using the G80 and the upcoming R600. This new technology is insane; it's here to stay; it's much easier to use; it's probably going to look better; and it requires no subdivision of your world geometry for reasonable results.

Check out the texture_array extension and the *_shader4 flavors as well.

P.S. Are those Doom3 characters?

Vexator

04-24-2007, 02:20 PM

yeah but i cannot afford a gf8 atm and i also cannot require such hardware for my project, so dpsm looks like an interesting solution.

can anyone who has already worked with this technique or who is familiar with the math behind it help me out?

Brolingstanz

04-24-2007, 02:24 PM

BTW, Nvidia has a demo of a texture atlas approach that simulates hw shadow cubemaps. I haven't played with that, but you might want to check it out.

Vexator

04-26-2007, 01:50 PM

ok as i got no further replies i tried to implement shadow cubemaps. so far i've managed to render the six views next to each other into one 3072x2048 texture. i'm not sure how to get them into a cubemap, however. can i have shadow cubemaps on a gf7 at all?

Relic

04-27-2007, 01:21 AM

can i have shadow cubemaps on a gf7 at all?Nope.
See table 4.6 Texture Formats in this doc:
http://developer.nvidia.com/object/gpu_programming_guide.html
I think GF8 can, but haven't found a link now.

Vexator

04-27-2007, 06:20 AM

ah crap.. so what can i do? use a regular color cubemap and do the depth compararison myself in the fragment shader? i'll lose filtering on nv cards then, right?

oc2k1

04-27-2007, 04:58 PM

Cubemaps are ugly on GPUs that didn't support them (6 renderpasses per lighsource).
Look at my project http://sourceforge.net/project/screenshots.php?group_id=186618
The shadow gear is an included example. It shouldn't be a problem to translate the scriptcode to another language...
your code looks a little similar to mine :D

Vexator

04-28-2007, 08:48 AM

yeah i guess we both have the code from the tutorial at delphigl.com :D however, it seems to work fine in your example, but not for me. i'm quite sure that i'm not reading the shadow map correctly in my fragment shader. you're doing it for eight lights at the same time which is even more confusing. maybe we could pm or chat on icq, i'd greatly appreciate that :) you seem to be the only one here who supports dpsm anyway.

Vexator

05-15-2007, 05:56 AM

ok as almost everyone told me that i should use cube maps instead of dual-paraboloid maps, i gave that a try; as you can see there are (at least) two issues left:

- there are artifacts in the corners (probably caused by too little precision? i'm using 16bit floating point textures already, though)

- the shadows are not consistent at the borders of the cube maps (see klesk's feet)

i can solve #2 by reducing the projection's angle from 90° to 85°, but then i get worse artifacts; or i can increase the depth offset (when rendering the shadow maps) a bit, this gets rid of the artifacts but then the inconsistence at the border gets worse.

http://vexator.net/schatten.jpg

zed

05-15-2007, 02:55 PM

i cant see anything wrong with the corners.

u will have issues at the border, (with GL_LINEAR) due to cubemaps not sampling from adjacent faces
but no way should they be as bad as what youre seeing.
it looks like youre creating the side + bottom SMs from different positions

see here http://www.realityflux.com/abba/

Vexator

05-16-2007, 08:48 AM

well i took a look at the rendered cube maps in gdebugger and i realized that adjacent faces are not consistent at the borders at all:

for cubemaps, the projection matrix must be 90 degree FOV and 1.0 aspect ratio. i just use:
gluPerspective(90, 1.0, zNear, zFar)

btw... i have experimented a lot with DPSM and i didn't like them. tessellating a large map takes forever(!), especially as you really have to subdivide a lot. DPSM demos have small maps and don't tessellate quite as much as is really needed to avoid artifacts. the massive number of vertices makes it very vertex-limited.

also, i needed a 1024x1024 sized DPSM to match the shadow-edge quality of a 512 sized cube shadow map. that is 4 MB compared to 6 MB. not very much of a savings considering the massive number of vertices needed.

the only benefit for DPSM is larger batches, and the ability to use depth-textures.

if you really want, i can see if i still have any of my fragment-program code to sample a DPSM from a 3-component direction vector. maybe DPSM will work better for you?

Vexator

05-21-2007, 03:04 PM

d'oh.. it really was a problem in my projection matrix setup - thanks! :) works great now :D