Interesting Soft Shadows Demo

cybamerc

Veteran
I just stumbled upen this demo which shows how to get soft shadows with stencil volumes like seen in SH3 and Axel Impact :)P). It's a rather interesting technique which gives a much more pleasing result than than regular hard edged volumes. Only problem in this case is significant ghosting. I wonder if there is any way to deal with that? Fafalada?

http://tfpsly.planet-d.net/english/3d/SoftShadows.html
 
Only problem in this case is significant ghosting. I wonder if there is any way to deal with that? Fafalada?
I have noticed that in some of the SH3 videos, but only in *some* scenes. I have no idea when it appears and when it doesn't. Definitely looks much better and more natural than hard edged shadows, though, even with occasional ghosting.

*Edit* Now that I've seen what is going on in this demo, I'm almost 100% sure it's not the same thing that is used in SH3. This is not the kind of 'ghosting' I had in mind.
 
I think the best hack for soft shadow volumes is using a cluster of 12 lights like NV had shown. Though not so good for performance, but the hardware will only get faster.
 
I think the best hack for soft shadow volumes is using a cluster of 12 lights like NV had shown.
Even then, you get only 12 shades of softness, no? That wouldn't be so great if the shadow has to project far away. The best method might be the shadow buffers, like the renderman is doing for offline render. Obviously, for such shadows to look really good no matter the circumstances, hardware again has to get better.
 
12 shades is pretty good, you only need it to soften the edges of the shadow. The body of the shadow is normaly one shade anyway.
 
V3 said:
Even then, you get only 12 shades of softness, no?

That's pretty good IMO. You can always use more.

That wouldn't be so great if the shadow has to project far away.

why is that ?

As the shadow is projected the edges of the different shadow regions caused by the jittering will diverge along its length. If it is projected over a long distance then the edges will diverge noticeably and you won't get a soft-edged shadow, you will instead get a mess of hard shadow edges.
 
V3:

> I think the best hack for soft shadow volumes is using a cluster of 12
> lights like NV had shown.

I disagree. It's a rather crude hack and a real performance killer. PowerVR has a demo of said technique (only goes up to 8 volumes though) and the quality of the shadows is far below what is achieved by the other one.
 
cybamerc said:
V3:

> I think the best hack for soft shadow volumes is using a cluster of 12
> lights like NV had shown.

I disagree. It's a rather crude hack and a real performance killer. PowerVR has a demo of said technique (only goes up to 8 volumes though) and the quality of the shadows is far below what is achieved by the other one.



agreed. even thinking about using 12 lights to have one shadow is just plain ridiculous, unless your chip was a REAL monster... in which case people would still employ much more efficient techniques...
 
It's a rather crude hack and a real performance killer. PowerVR has a demo of said technique (only goes up to 8 volumes though) and the quality of the shadows is far below what is achieved by the other one.
Actually, unless I'm misreading something badly, the method described here is essentially the same thing, just distributing the load across multiple frames to maintain performance, while relying on temporal coherency to avoid major artifacts.
In other words, in static pictures, it should generate results identical to the plain multi-volume approach. It's a rather cunning approach to the problem though, I have to say.

That PVR demo wasn't casting on any kind of textured scene, which made all the banding between mutliple volumes far more apparent then these pics.

And Marc is right, it's not really the same thing as what we use either.
 
I agree with Faf,
this is just a hack, basically it distributes the load accross multiple frames. In a static scene it should look pretty similar to the NVidia demo, and in moving scenes I would expect ghosting artifacts which there is just no way to address.

I have a scribble on a piece of paper in my office that tends to imply that you can do soft shadows in a single pass with a stencil buffer, but it needs to be >8 bits deep when occluder density gets high. It's sort of similar in approach to MS's volumetric fog demo in the DX9 SDK. After E3 when I get a little breather I might try and get it working.
 
I have a scribble on a piece of paper in my office that tends to imply that you can do soft shadows in a single pass with a stencil buffer, but it needs to be >8 bits deep when occluder density gets high.
Well that wouldn't really be a problem for DX9 hw and beyond anyhow :p

But, just curious, since you mentioned occluder density - shouldn't drawing stencil counting geometry in single pass (switching inc/dec flag per poly) help alleviate this need for higher precision?
 
In my case I need to be able to count fractional entry into the volume, aswell as total entries.

I might be able to do it with a combination of dest alpha and stencil, but I don't really have access to both of them in the same place which makes it a bit tricky. I might also be able to do it with render to a texture and rereading it for a final pass, I still need to think through the implementation a little.

It should be pretty easy to do on a DX9 class card, but I don't have a machine with one in and I'm a sucker for a challenge.
 
I disagree. It's a rather crude hack and a real performance killer. PowerVR has a demo of said technique (only goes up to 8 volumes though) and the quality of the shadows is far below what is achieved by the other one.

I haven't seen PVR demo myself, but this hack is similar to PVR demo you described, PVR demo should be superior since it is doing all 8 compare to this one.
 
V3 said:
I disagree. It's a rather crude hack and a real performance killer. PowerVR has a demo of said technique (only goes up to 8 volumes though) and the quality of the shadows is far below what is achieved by the other one.

I haven't seen PVR demo myself, but this hack is similar to PVR demo you described, PVR demo should be superior since it is doing all 8 compare to this one.
IIRC, one limitation with that demo is the limited precision of the Framebuffer, i.e. only 8bits per channel. While accumulating the results of the various shadows it really needs higher precision and so would look a lot better with, say, DX9. The final result only needs a 16/24 bit framebuffer though.
 
aargh this is horrible. how much fillrate do you have to burn?

image-based techniques reign supreme again.


basically, the method i'm using is:

- render your volumes as usual.
- switch render target to a clean white surface.
- render a single big black quad over the entire surface, using the stencil you made previously. NO Z-WRITE.
(actually, its more complex, what you draw into the surface than this, but big and black will work OK)
- very aggressively oversample that buffer
- switch back to your main render target
- render the big black quad using subtractive with saturation.

sound ok? it sounds a bit crazy to me, but it works nice. 200fps+ on my r9600pro with a bunch of lights.

if subtractive is costly on your particular GPU, do a white-on-back multiplicative. still playing with this, but it does look nice.

you can do better if sampling your framebuffer isnt gonna cost you the entire world in performance. things like applying a sobel filter with edge detection onto your z-buffer, do you can do hacked-aniso on the oversampling.

email me and ill hook you up with some screens and hopefully a demo, but it needs a dx9 card at the mo. codemonkey@dont-spam-me@orcon.net.nz

-codemonkey
 
Back
Top