Shadowmaps: Point lights / perspective. Which techniques?

Started by
17 comments, last by MJP 16 years ago
Quote:Original post by wolf
From a practical point of view there is no real advantage in Dual-Paraboloid shadow maps


I'm of two minds about this. In my own experience I found cubemaps to be more intuitive and robust.

However there are some questions I can't really answer...what is better for hardware: 2 tex2dProj calls to sample the DPSMs or a single but more complex texCUBE call for the cubemap...

THe main problem with cubemaps I think is clearing and switching to six surfaces...certainly less efficient than 2 surfaces...especially when we are using floating point surfaces. Poeple are talking about cases when that can be reduced to fewer faces, but this is hardly a reliable reduction...when the light is viewed from any distance at all all 6 sides will need to be updated, and I would argue this is more common than not.

John Carmack of ID seems to recommend against cubemaps for another reason: you cant use different sizes for faces independently at the same time. But i have a hard time believing 6 tex2DProj calls can be efficient so i'm not sure I understand him..maybe he believes that using the smaller size for certain faces is a big win that trumps all the texture samples.. I dont know.

The interesting thing about shadow mapping is how wide open the method is.. there is no "right solution" yet as far as i can see.
Advertisement
Quote:It shipped on both PS3 and 360, with 4 shadowing point lights supported.
Very impressive.

Here is another thought: what you can do as well is trying to get away with 2D shadows :-) ... just tweak your lights to be "spotlights".
Quote:Original post by osmanb
Of course, if I was targeting DX10, I'd almost certainly be using cubemaps, given the ability to render all six faces in one pass, and even on DX9 (for PC), the simpler logic and consistent density of shadow texels would be a good argument for that route.

Yeah it's true that rendering to 6 faces at once is a theoretical win for cube maps on DX10, although in some initial benchmarking that I did rendering the faces separately with some course CPU frustum culling was still faster than the GS-cloning approach. Instancing is another interesting approach that's a bit more hardware-friendly than GS-cloning, and GS-binning is theoretically efficient for this sort of discrete frustum rendering. That said, GS implementations leave a lot to be desired on current hardware (especially G80), particularly when amplification/deamplification is used. Since rendering shadow maps is pretty simple and batch-friendly, throwing all of the geometry at the GPU might end up being the most reasonable in the long run, depending on the CPU setup cost of course.

Certainly there are a few variables to play around with... I'd still say try cube maps first and if they are too slow (particularly on the CPU side), etc. try DP maps.
Everybody; thanks!

It seems was at the right place with cascaded/split shadowMaps (but what's the difference between those two). Anyone some nice papers or demo's (I don't have the GPU Gems book(s), should have asked Santaclaus for it :) ) ?


Point lights seem to be a bigger challenge. I'm not very keen on fragmentating the whole scene into small polygons (and still have 'depth errors'). I was hoping though that there was another solution besides cubemaps. But ok, I think I'll go for that one.


The reason I was questioning cubeMaps is the performance of course. Nowadays more and more games are using shadowMaps (Crysis, Bioshock as well I believe). Maybe I'm totally wrong (since Osmanb is specifically talking about 4 point lights on quite powerfull hardware), but I thought point lights are pretty much used in these games. Although I might be wrong. Maybe only a small amount of lights is actually casting shadows...

About rendering a cubemap in 1 pass, is that possible in OpenGL as well? I guess this has something to do with geometry shaders. I never used them so far, only took a brief look at them. I didn't quite understand the difference between Vertex shaders and geometry shaders, or better said, when/where to use them.


Thanks again for your critical views on the techniques!
Rick
Although many games have some kind of shadows, if you look at the majority of games (even the big names that get credit for their graphics), they generally have VERY simple shadows. Dozens of games from the last two years that have been repeated praised for their amazing graphics feature one of the following:

- Static lighting with pre-baked lightmaps.
- At most one shadowing dynamic light-source, usually a directional light
- Projected texture shadows! (Lost Odyssey, I'm looking at you! That game doesn't even correctly cull shadows from polygons that aren't facing the light. I was able to do that on PSP.)

In total, despite all the cool techniques that have been developed, and the significant horsepower out there, most people just punt on shadows. Of course, the real message might be that it's not worth spending much programmer (or CPU/GPU) time implementing advanced shadows, when no one seems to notice or care.
I see. To be honest, I never really noticed the lack of correct lights/shadows either, unless I really checked every pixel :)

Ow, I see cascaded and splitted shadowmaps is the same thing. I'll try the nVidia OpenGL SDK demo this week. That technique seems to be "a lot" slower as well than a default shadowMap. But yet again, there won't be that much "big range" lights either. The sun is a good example of course, although it will probably be used more for large light beacons in a warehouse (or something like it) in my case.

It comes down to strategically configuring the lighting for each scene, and what the hardware allows of course. 2 point lights, 2 long range lights, a bunch of normal spotlights and fake lights. Something like that...

Allright then. Time to try this at home. Ow, and could someone explain how to render a cubemap in 1 pass? Like I said, it's probably something with geometry shaders. But I haven't start with them yet. I even doubt if Cg 1.5 (which I'm using now) is already supporting them...

Greetings,
Rick
Quote:Original post by spekOw, and could someone explain how to render a cubemap in 1 pass? Like I said, it's probably something with geometry shaders.

Check out the Direct3D 10 sample for single-pass cube map rendering. The technique is the same in OpenGL and indeed does use geometry shaders. In particular you need to be able to decide per-primitive which render target to write to.
Quote:Although many games have some kind of shadows, if you look at the majority of games (even the big names that get credit for their graphics), they generally have VERY simple shadows. Dozens of games from the last two years that have been repeated praised for their amazing graphics feature one of the following:

- Static lighting with pre-baked lightmaps.
- At most one shadowing dynamic light-source, usually a directional light
- Projected texture shadows! (Lost Odyssey, I'm looking at you! That game doesn't even correctly cull shadows from polygons that aren't facing the light. I was able to do that on PSP.)

gears of war is a perfect example, many ppl praised it for the graphics, personally i thought it was a step backwards/sideways from older games WRT shadowing/shading.
Q/ why did ppl think looked good?
A/ im betting cause of the exaggerated normalmaps with specular + DOF/motion

Quote:In total, despite all the cool techniques that have been developed, and the significant horsepower out there, most people just punt on shadows. Of course, the real message might be that it's not worth spending much programmer (or CPU/GPU) time implementing advanced shadows, when no one seems to notice or care.
so true thats why ive sort of given up on going for the perfect result with lighting + just stick something approx in 99% of the ppl cant tell the difference. 10x halfassed pointlights (with shadows) is better than 1 nice pointlight with shadows, things have gotta be inyourface for the populace to notice
Quote:Original post by osmanb
In total, despite all the cool techniques that have been developed, and the significant horsepower out there, most people just punt on shadows. Of course, the real message might be that it's not worth spending much programmer (or CPU/GPU) time implementing advanced shadows, when no one seems to notice or care.


It does seem to happen quite a bit. Even in a game like Crysis I've come across scenes (especially with point lights) where the shadows show some nasty artifacts. I've also never really been a fan of the way they randomly jitter the shadow map samples.

However on the other hand, Uncharted for the PS3 has probably the most impressive shadow map implementation I've ever seen in a game. They must be "faking" a good portion of it, but the end result sure is nice!

This topic is closed to new replies.

Advertisement