Dual-paraboloid omnidirectional shadow mapping demo

I have just released a techdemo of my own engine.
http://www.doomiii.jp/slang/flx_demo_pa_1_0.htm

It demonstrates the Dynamic Dual-Paraboloid Omnidirectional Soft Shadow Mapping using GLSL.
Please let me hear your opinions, questions or bug reports.

BTW, the demo version is still 0.8 because the penumbras of soft shadows are not blended well.

I get about 15fps on my gf5900 Ultra - AMD64 3200+ - but I don’t get any shadows. The shadow maps don’t include the pillars or the torus (so no shadows).

It’s working great here (radeon 9800 pro 128 mo) at 45 fps in windowed mode.
Shadows are nicely soften, even if you can notice some blocky artefact when you’re nose is on the wall.

I was so waiting for a flexion engine demo =)
Great job slang

wizzo

Originally posted by rgpc:
I get about 15fps on my gf5900 Ultra - AMD64 3200+ - but I don’t get any shadows. The shadow maps don’t include the pillars or the torus (so no shadows).
Unfortunately, I have no NVIDIA videocards to test it.
Sorry about that.

However, to make up for the issue, I made a movie of the demo.
http://www.doomiii.jp/slang/files/demos/dposm08.m1v

Please enjoy (though it’s only 30 seconds).

Originally posted by wizzo:
It’s working great here (radeon 9800 pro 128 mo) at 45 fps in windowed mode.
Shadows are nicely soften, even if you can notice some blocky artefact when you’re nose is on the wall.

Yes, I’m working on the aliasing problem of the shadow maps.

Currently I’m using two 512x512 textures for shadow maps,
and another two 512x512 textures for blurred edge maps,
then I get 50 FPS on my ATI Radeon 9800 pro (Athlon XP 2800+).
But totally four 1024x1024 textures to avoid the blocky artifacts, I get only 20 FPS.

And also the DPOSM is a little heavy on R3x0 or NV3x because it requires vertex shader processing power
due to the transformations of all the vertices into the dual-paraboloid light space.
(These transformations are described in “data\shaders\dp_osm.vsh”.
The shaders tell mush more than I speak in my poor English. :smiley: )
However, I guess it runs 60 FPS or higher on NV40 and R420, though I don’t have any of them.

You can run the demo in fullscreen mode by setting the commandline as “-fullscreen”, by the way.

No shadows on GFFX 6800. Only specular component seems shadowed (but shadow has hard edges).

By pressing F3 once, the dual-paraboloid shadow maps looks correct, same as the bottom picture in your page. Pressing a second time gives only a white quad.

As a side comment, even if the demo is pretty fluid (more than 20fps at 1280x960), the mouse moves does not seem fluid at all, it is very jerky.

The engine looks very nice, I hope you will find a way to make it work on all GLSL cards.

Alright, I got email from NVIDIA and fixed bugs!
Now it should run correctly on NVIDIA-based videocards, I think.

Please download and try it again.
I’m very looking forward to hearing your opinions.

Originally posted by ZbuffeR:
As a side comment, even if the demo is pretty fluid (more than 20fps at 1280x960), the mouse moves does not seem fluid at all, it is very jerky.
Yes, I’m understanding the problem and now working on it.
Please wait for the updates.

EDIT: Also changed the mouse movement smoothly.

Oops! Looks like still bugs in there.
And I’ve just fixed’em and released the version 0.84.

This time I bet! :slight_smile:

That hasn’t fixed it I’m afraid. I’m getting the same problems as ZBuffer on my GF5900.

runs ok on a gffx5900 70.90

And also the DPOSM is a little heavy on R3x0 or NV3x because it requires vertex shader processing power
due to the transformations of all the vertices into the dual-paraboloid light space
did u try offloading some of the work from the gpu to the cpu? im speaking from my experiences (yes i know all the docs mention let the gpu as much as possible but they would say that wouldnt they?)

With good reason, as all the time you spend processing render data on the CPU is time the GPU could spend actually rendering it, unless you double-buffer it, which then reveals the problem of memory consumption and management. And that’s aside from the non-trivial cost of transferring that amount of vertex data to the GPU every frame.

The fact is there’s no “one answer fits all” solution to the gpu/cpu load ballancing question.

GF5200 66.93, still doesn’t work.

Actually there is very, very pale, barely visible shadow for short moments when light is far from viewer and behind pillars (shadow oriented towards viewer). Too difficult to even tell if it’s soft or hard. This happens in all versions I downloaded, the only thing that has changed is there are no GLSL compiler errors anymore.

Hi slang. dposm084 on 6800GT 6.6.9.3. I think I’m seeing what MZ is seeing. The shadows aren’t anywhere near as well defined as the ones in your mpeg. And they don’t always appear to be in the right place. For example, sometimes a torus casts a shadow on the floor when it should be casting a shadow on the wall. They look aliased to me; not soft. Let us know if there are any specific tests we can try to help you out. I’d like to see this work on my machine.

This dual paraboloid method requires tesselating the geometry right?
It’s not bad, but the shadow edges look shaky.

I’m getting about 36 FPS on R9500 128MB Cat 4.12 Athlon XP 2800+, 512 MB

I’m also getting errors

GL ERROR - Function glPopMatrix() generated error GL_STACK_UNDERFLOW
GL ERROR - Function glPopMatrix() generated error GL_STACK_UNDERFLOW
GL ERROR - Function glPopMatrix() generated error GL_STACK_UNDERFLOW
GL ERROR - Function glPopMatrix() generated error GL_STACK_UNDERFLOW
GL ERROR - Function glPopMatrix() generated error GL_STACK_UNDERFLOW
GL ERROR - Function glPopMatrix() generated error GL_STACK_UNDERFLOW
GL ERROR - Function glPopMatrix() generated error GL_STACK_UNDERFLOW
GL ERROR - Function glPopMatrix() generated error GL_STACK_UNDERFLOW

Version 0.85 is now available.
But I’m not convinced this is gonna work correctly on NVIDIA cards…

Originally posted by zed:
did u try offloading some of the work from the gpu to the cpu?
Well, it is not possible to calculate the dual-paraboloid transformation in CPU
because the texcoords used to fetch the shadow maps are needed to be calculated per-vertex.

Originally posted by mogumbo:
Let us know if there are any specific tests we can try to help you out. I’d like to see this work on my machine.
Thank you.
Okay. Could you send me or upload a screenshot of the issues you’ve got?
Because I’m not good at understanding English, you know. :smiley:

Originally posted by V-man:
This dual paraboloid method requires tesselating the geometry right?
It’s not bad, but the shadow edges look shaky.

Yes, the geometry of the scene is must be tesselated well
in order to transform into the dual-paraboloid light space.

I’m not using any anti-aliasing to the shadow maps
so the soft shadow are somewhat jaggy when you are close to them.

EDIT: New version 0.86 is now available. I’m so sorry, again and again…

I’ve released the version 0.87.

If you still have problems on NV-based videocards,
I’m sorry that there’s nothing I can do any more without NVIDIA cards.
(Doesn’t NVIDIA have the surplus of NV40? :stuck_out_tongue: )

Anyway it runs really correctly on ATI cards.
So, if you are an ATI user, please enjoy!

http://www.reallyslick.com/dposm087_1.jpg

The shadows are pretty faint in this screenshot, but you can make them out if you look closely. They aren’t at all like what you have in your mpeg.

Originally posted by mogumbo:
The shadows are pretty faint in this screenshot, but you can make them out if you look closely.
So, basically you’ve got shadows on the scene at least?
Then please try this out:

1.) Open the “data\shaders\dp_osm.fsh” shader file using notepad or something.
2.) Comment out the following codes.

vec4 disco = textureCube(DiscoLight, CubeTexCoord);
 
vec4  d = (LightType > 0)  ? disco : vec4(1.0);
float k = (depth > shadow) ? blur  : 1.0;
float s = (depth > shadow) ? 0.0   : 0.35 * specular;
 
gl_FragColor = d * k * (diffuse * base + s) * atten + ambient;

3.) Then, copy and paste the following codes to the end of the main().

if (depth > shadow)
   gl_FragColor = vec4(0.0);
else
   gl_FragColor = vec4(1.0);

4.) Finally, save it and run the demo again.

If you get the result like this:
http://www.doomiii.jp/slang/images/osm_demo_04.jpg

then the depth comparison is okay. In other words,
the shadow maps are fetched correctly in the fragment shader
and also the texcoords are calculated correctly too in the vertex shader.

Otherwise, the issue is caused by the shadow map feching or texcoord calculation.

However, even if the depth comparison is no problem,
there may be problems in the blur filtering shader or the edge detection shader.

Anyway, please try out above at first and let me know what you get.

I almost get that same result. But I only see shadows on the near side of the light source. There are no shadows on the other side of the light. It’s as if only one parabaloid is being used.

If I toggle on the shadow maps, the first shadow map looks fine, but the second is all white. Some black pixels flicker into the white occasionally, but most of the time it’s just pure white.