Soft shadow in Doom3

Reverend

Banned
Kinda :)

John Carmack said:
Reverend said:
...

Anyway, how should I experiment with the cvar r_lightSourceRadius? It is described as "for soft shadow sampling" but using various values (positive and negative values) for this cvar results in "moving" shadows and lights instead of "soft shadows". This is on a NV40.

That is unrelated to the shadow buffer technology. If you take screenshots with large sample numbers while r_lightSourceRadius is enabled, you will get accumulated soft shadows, but because they are jittered light source positions, you need much larger values to get good looking results. For screenshots, you might as well use values like 64 or more samples, especially if you have larger values of r_lightSourceRadius set.

The screenshot command optionally takes width / height / samples parameters, and does multiple renders to tile large images if necessary. You are still limited to the hardware viewport limit, but a 4096 x 3064 x 128 sample shot with jittered light positions looks pretty good...

John Carmack

So basically, a console command of "screenshot 1024 768 128" will grab a screenshot of 1024x768 with 128 samples (or, alternatively like John suggested, you can issue a "screenshot 4096 3064 128" command with the expected result). It is interesting to see the screenshot grabbing process (if you use smaller samples, like 8, you see jittering... if you use larger values at super high rez, you see what John refers to as "tiling"). However, I still can't quite grasp the r_lightSourceRadius cvar in connection with this. I still get funky disco lights when this cvar is enabled (with various values). John hasn't replied to my additional queries about this and I don't really wish to bug him so soon after the birth of his child... perhaps some of you guys know.

PS. John's mention of shadow buffer seems out of place but this is due to the fact that my email to him was about his QuakeCon04 talk, where he talked a great deal about shadow buffers.
 
r_lightSourceRadius just controls the radius from the current lights location of where its allowed to be jittered within. If you do it while playing the game with a value else than 0 hehe then your shadows and lights will move around :p

But if you take a screenshot with multiple samples since each light is jittered different you get soft shadows.
 
Damnit Rev, I thought you had discovered how to enable shadow buffers! ;)

Anyway, I tried several values on the cvar, anything above 4 and I usually get weird shadows poping all over the place. And I tried 64, 128 and 256 samples with cvar radius of 4 but all the resulting screenshots come out as if you're using SSAA (which is basically what it does) and not soft shadows in the sense of umbra/penumbra. Am I doing something wrong?

I had mailed Robert Duffy before D3 came out asking if the engine was capable of soft shadows by jittering point lights but his reply was that the only soft shadows D3 had was from texture projection.
 
Well, no I'm not talking about shadow buffers in Doom3 but the following may be interesting info nonetheless :

John Carmack said:
Reverend said:
One of the issues with shadow buffers as you stated is the aliasing. You said that with some jitter samples this can generate reasonably good results. Tim Sweeney informed me quite some time ago (prior to public knowledge) that his UnrealEngine3 would be using shadow buffers with up to 16x oversampling as a shadow anti-aliasing solution. In your on-going work with regards to shadow buffers, how many jittered AA samples would be required to have very satisfactory AA'ed shadows? With the current gen hardware, how expensive is that?
4 samples is acceptable if the jittering is per-pixel, but it still gives a noticeable fizzle to the shadow edges. 16 looks very good, but for film quality work, especially with broad soft shadows, you might want as many as 128.

16 is a noticeable slowdown on NV40, but will probably be pretty common by the time we ship.

John Carmack
 
Cryect said:
r_lightSourceRadius just controls the radius from the current lights location of where its allowed to be jittered within. If you do it while playing the game with a value else than 0 hehe then your shadows and lights will move around :p

But if you take a screenshot with multiple samples since each light is jittered different you get soft shadows.
Doesn't work like that for me. r_lightSourceRadius makes the lights jitter around, but as soon is I took a screenshot (screenshot 640 480 32) they stopped jittering, and all 32 samples were taken with the lights in their last position.
 
Reverend said:
Well, no I'm not talking about shadow buffers in Doom3 but the following may be interesting info nonetheless :

John Carmack said:
Reverend said:
One of the issues with shadow buffers as you stated is the aliasing. You said that with some jitter samples this can generate reasonably good results. Tim Sweeney informed me quite some time ago (prior to public knowledge) that his UnrealEngine3 would be using shadow buffers with up to 16x oversampling as a shadow anti-aliasing solution. In your on-going work with regards to shadow buffers, how many jittered AA samples would be required to have very satisfactory AA'ed shadows? With the current gen hardware, how expensive is that?
4 samples is acceptable if the jittering is per-pixel, but it still gives a noticeable fizzle to the shadow edges. 16 looks very good, but for film quality work, especially with broad soft shadows, you might want as many as 128.

16 is a noticeable slowdown on NV40, but will probably be pretty common by the time we ship.

John Carmack


Is he talking about their next generation engine or their next game with doom3 engine?
 
Reverend said:
Well, no I'm not talking about shadow buffers in Doom3 but the following may be interesting info nonetheless :

John Carmack said:
4 samples is acceptable if the jittering is per-pixel, but it still gives a noticeable fizzle to the shadow edges. 16 looks very good, but for film quality work, especially with broad soft shadows, you might want as many as 128.

16 is a noticeable slowdown on NV40, but will probably be pretty common by the time we ship.

John Carmack

He must be talking about 4 Percentage Closer Filtered (PCF) samples. Could you confirm this?

4 unfiltered samples look really bad. 4 PCF samples means 16 unfiltered samples (each sample takes 4 texels and blends them using some weights).

Percentage Closer Filtering is almost free on Nvidia hardware. ATI cards don't support PCF. Simulating PCF with pixel shaders is very expensive (naive implementation takes about 19 PS2.0 instructions).

If Carmack uses PCF, ATI's cards owners should be concerned, because ID's next generation engine will work significantly slower on their hardware (or image quality will be decreased).
 
He must be talking about 4 Percentage Closer Filtered (PCF) samples. Could you confirm this?

That is also what he said in the QuakeCon keynote, yes.

If Carmack uses PCF, ATI's cards owners should be concerned, because ID's next generation engine will work significantly slower on their hardware (or image quality will be decreased).

ATi owners should already be used to that from ID by now :p
Seriously though, that engine is years away from release. By then ATi could well have PCF in hardware... or perhaps we're doing something completely different by then.
Any idea what UnrealEngine 3.0 uses for its shadowing btw?
 
Scali said:
Any idea what UnrealEngine 3.0 uses for its shadowing btw?


cubemaps
and from the Unreal Tech website:

- Dynamic stencil buffered shadow volumes supporting fully dynamic, moving light sources casting accurate shadows on all objects in the scene.
- Dynamic characters casting dynamic soft, fuzzy shadows on the scene using 16X-oversampled shadow buffers.
- Ultra high quality and high performance pre-computed shadow masks allow offline processing of static light interactions, while retaining fully dynamic specular lighting and reflections.
 
phenix said:
Is he talking about their next generation engine or their next game with doom3 engine?
I don't think id will make another game using the Doom3 engine, especially when John's already said the next engine (the one he's currently working on) won't take as long to complete as Doom3.
 
Thowllly said:
Cryect said:
r_lightSourceRadius just controls the radius from the current lights location of where its allowed to be jittered within. If you do it while playing the game with a value else than 0 hehe then your shadows and lights will move around :p

But if you take a screenshot with multiple samples since each light is jittered different you get soft shadows.
Doesn't work like that for me. r_lightSourceRadius makes the lights jitter around, but as soon is I took a screenshot (screenshot 640 480 32) they stopped jittering, and all 32 samples were taken with the lights in their last position.

Yeah thats what I get for saying how something supposedly should work based on what Carmack says :p

Reverend could you email Carmack and tell him it only uses one jittered position in a screenshot instead of one for each sample?
 
Reverend said:
phenix said:
Is he talking about their next generation engine or their next game with doom3 engine?
I don't think id will make another game using the Doom3 engine, especially when John's already said the next engine (the one he's currently working on) won't take as long to complete as Doom3.

When they said that their next game will take considerable shorter amount of time because they are now more familiar with the engine I was thinking that their next game would be out in about 2 years using the same engine (with some tweaks and make up).

But, you are probably right. :)
 
soft_s_01.JPG


Just copy&paste the links below or they will not work

With Boss Spoiler:
http://www.doom3tweaker.netfirms.com/soft/soft1.JPG

No Spoiler:
http://www.doom3tweaker.netfirms.com/soft/soft2.JPG

With Boss Spoiler:
http://www.doom3tweaker.netfirms.com/soft/soft3.JPG

With Boss Spoiler:
http://www.doom3tweaker.netfirms.com/soft/soft4.JPG

With Boss Spoiler:
http://www.doom3tweaker.netfirms.com/soft/soft5.JPG

No Spoiler:
http://www.doom3tweaker.netfirms.com/soft/soft7.JPG

With Boss Spoiler:
http://www.doom3tweaker.netfirms.com/soft/soft8.JPG
 
Curious how did you get the soft shadows to work with the multiple samples? Heh or did you freeze time and do it manually?
 
Carmack wasn't exaggerating at all when he said it'd look "pretty good." :oops:

So, yeah.... exactly how do you take those screenshots? :D
 
Alstrong said:
Carmack wasn't exaggerating at all when he said it'd look "pretty good." :oops:

So, yeah.... exactly how do you take those screenshots? :D
I just found out how but I'm not telling in this thread :) . At least, not until I reveal it in a forthcoming "beta" article. Hopefully, nobody reveals this anywhere before my article :) 8)
 
blast you!!!!!


.........but it'd be good to have it somewhere where we can all find this information easily instead of it getting lost here on the forum. :)
 
epi:

Aside from the fact that those pictures show (almost? didn't check all pics) all the bosses you could have included a spoiler warning. :rolleyes:

Reverend: u r teh bad boy! ;)

EDIT:

Hmm I think I found out how to do it but it seems very fickle. Take a look at the pic below. Some shadows became soft while the major one stayed harsh. Reverend, the other thing only needs a "1" or needs to have a value equal to the radius we put in r_lightsourceradius?

soft_1.jpg
 
Wow, those are mighty impressive shadows. Pity you can't have them in game but at leas you can make really purty screenshots :D
 
Back
Top