Volumetric Scattering (screen-space) done efficiently ?

Started by
14 comments, last by kalle_h 9 years, 2 months ago

Try to add some jittern to mix. Even half step jittern with checkerboard pattern produce lot better results. As optimization you can get Weight multiply part out of the inner loop.

Advertisement

Yeah mines just the pure radial blur without gpu gems physically based additions, Weird, well only other thing is my setup does look undersampled and close to yours if I don't divde the sample distance of the blur in half after each pass. Maybe try it with the same distance on each of the three passes.

All three 8x8x8 passes with a density of 0.8

[attachment=25628:noOffset.png]

Unfortunately I can't upload a video here because of my crappy internet line but I exported screenshots from RenderDoc showcasing it using the 8x8x8 with different densities each.

Note: Seems like it doesn't gamma correct when exporting that's why they look so dark here.

Input Mask:

JQ4qv0p.jpg

First 8 sample pass (Density = 1.0):

3PEVZX2.jpg

Second 8 sample pass (Density = 0.5):

1HfFd57.jpg

Final 8 sample pass Density = 0.25):

S4FOxyL.jpg

If I multiply the final color by 0.2 or so it doesn't look as overblown but the sky completely fades to black which is not what I want...

The best quality/performance result I've gotten at this point is downsample to 1/2 using a wide gaussian blur then scatter using ~96 samples and upsample again using wide gaussian. Runs at about 1.8ms on my AMD Radeon 5750M. However the result is obviously a little blurry and not as tight as pure 128 samples in full res.

@kalle_h I'm not very familiar with using the jittering you describe. How is this done ? Multiply the Density by some random 2D vector ?

Or could I use a different step size every frame and combine these ?

Are you doing your additve blending back into your main color only once in a final blend pass? so the three intermediate blur passes not additively blended then combine them in your final additive combine shader, so I guess (Blurpass1 > Blurpass2 > Blurpass3 > combinePass) I guess it needs the same treatment as to how multipass bloom is done.

I'm not combining them seperately in a final pass I'm using the blurred output from the first as the input to the second and at the third pass.

By the way the above screens were taken using your code. I don't get why we have so different results.

float2 uv = input.TexCoord;

float jittern = frac(0.5 * (input.position.x + input.position.y)); //pixel positions

uv -= jittern * deltaTexCoord;

This basically start half step away from start position every second pixel. Basically you trade banding for high freq noise. Another name for jittern is dithering. There is good source for broader knowledge. http://loopit.dk/banding_in_games.pdf

This topic is closed to new replies.

Advertisement