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)$
$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.