View Full Version : New Demo: Soft shadows for PS3.0 hardware

Abba Zabba
04-24-05, 10:51 PM
This demo written in OpenGL shows some areas where the use of PS3.0 over PS2.0 is more advantageous.
A while back when I was browsing through NVIDIA SDK, I noticed an interesting soft shadow demo where the penumbra was generated by jittering the sampling position up to 64 times and averaging the results.
That demo however was using a directional light source, and as JC would say (:p), 90 % of the lights in nature are omni directional, therefore I extended the concept discussed in the SDK and created this demo.
The advantage of PS3.0 is that we don't have to over sample unless we're on a shadow edge. If we detect that we're on a lit or completely shadowed area, we can skip the 28 x 2* of 32x2* texture fetch necessary to blur the penumbra.
Sometimes the performance gain is up to 50%, however donít expect this demo to run beyond the 100 FPS, my current configuration (read sig) barely manage to maintain a 50FPS.
Please pardon the poor quality of the textures/models: I'm a coder, not an artist :'(

* For every shadow sample, we also fetch a 1D texture element that encodes the new jittered position;

PS: Hey MikeC, could you please upload this demo to nvnews server and let me know about it.
My bw is totally sucked out :/

You really need drivers that support FBO to fully enjoy this one.
Binaries (http://www.realityflux.com/abba/C++/Soft%20Shadows/SoftShadows.zip)
Source (http://www.realityflux.com/abba/C++/Soft%20Shadows/SoftShadowsSRC.zip)
Engine source (http://www.realityflux.com/abba/C++/SXMLEngine/SXMLEngine.zip)

04-24-05, 11:27 PM
Wow very nice demo. :D

With PS 3.0 I get 43 fps and when switched to PS 2.0 it drop to 20 fps, it showed that PS 3.0 is twice faster than PS 2.0. :)

04-24-05, 11:40 PM
Interesting demo. When I set the light range to 290, the SM3 path runs around 52-57 fps. The SM2 path takes a nose dive to 22-30 fps.

04-24-05, 11:45 PM
wow, you are really turning these sweet demos out! that's 4 in the last few weeks... one question (may have been previously answered): why is vsync on? is there a way to disable it? my framerates always halve which is kind of annoying, but perhaps there will be too much tearing without it.

Abba Zabba
04-24-05, 11:53 PM
Nah I don't force V-Sync on at all, this demo is really demanding that's why unlike the previous ones, you need some sort of miracle to go over 100 FPS :angel:

04-25-05, 10:04 AM
When you start seeing your framerate halve due to Vsync, does that mean you should drop a notch down on the resolution? (Assuming of course you don't just upgrade, heh.)


04-25-05, 10:35 AM
for some reason i confused PS3 with PlayStation 3 and PS2 with PlayStation2 when i read the title. :retard:

this article makes a lot more sense now lol. nice demo btw ;)

04-25-05, 01:49 PM
HEY, lets get tertsi to include these soft shadows in the Doom3 quality mod! :D

04-25-05, 03:51 PM
Abba, what drivers are u using?My demo keeps running only on Pixel-Buffer
P.S: I'm using 71.89 XG

Abba Zabba
04-25-05, 04:05 PM
Abba, what drivers are u using?My demo keeps running only on Pixel-Buffer
P.S: I'm using 71.89 XG

76.44, the 71.xx have no support for FBOs.
PS: Yeah it's utter slow when using PBufffers :eek: