3
$\begingroup$

Raw volume raymarching especially aligned with frustum seem to produce a lot of aliasing/banding on edges of shadow map. Especially when fragment pos is far because step length is then getting bigger. Making some research how to correct it I found out about temporal reprojection technique.

So basically I have an two 2D textures, current and previous where I store exponential moving average of raymarching result of previous frames like:

$s(n) = w*f(n)+(1-w)*s(n-1)$

where:

$w$ - weight

$f(n)$ - current frame calculation

$s(n-1)$ - result of previous frames calculation

This seem to be working when camera is moving because then bands are moving and blending with each other. But when camera stands still everything returns to normal. I tried to:

  • add some noise aligned with ray direction to starting position every other frame but banding is still at the same positions
  • add noise not aligned with ray direction but then bands are shifted ramdomly and raymarching results are wrong

Here (FrostBite engine) it is smooth constantly independent of camera movement.

So is there a way to simulate camera movements? Or any other technique to correct the issue?

Here you can download some content describing subject.

$\endgroup$
1
$\begingroup$

You can look into alias-free volumetric sampling algorithm by Huw Bowles for potential solution to the ray marching aliasing issues. The basic idea is to snap your samples to planes based on the ray direction that's best explained with this Shadertoy demo.

$\endgroup$
  • $\begingroup$ This sounds interesting. Could you expand on the basic idea and explain why it works? $\endgroup$ – trichoplax Oct 12 '16 at 16:04
  • $\begingroup$ It's quite clever. I will study it more. $\endgroup$ – narthex Oct 12 '16 at 17:03
0
$\begingroup$

Well actually I think I was doing it wrong. I stored raymarching effects in 2D texture. This is not correct because it suffers from issues.

Correct way is store raymarching effect in 3D texture, to get linear interpolation and no banding. And then perform sampling from it.

It seems to improve the result because it fixes some discontinuities. However it still needs temporal blending to get it smooth during camera movement.

Indeed the way to get smooth temporal blending independent of camera movement is to add some jitter which is shifted each frame, but it is hard to get it working right.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.