Hi I've been working on implementing LPV in Unity3D. It looks quite nice but I can't seem to get my head around how to avoid flickering when objects or the light move. I'm assuming this is because the reflective shadow map depth values are changing. I noticed other people's videos have no flickering so I'm stumped.
I think I'm doing a lot of things wrong. Basically I
- Render depth normal and flux from light view.
- Recreate world pos from depth and frustum of the light camera.
- I inject into the volume converting from world position to unwrapped light propagation volume texture space. (Is this correct? Or should I be using the light's view space -> LPV?) I inject the world normal offset by the surface normal and light direction dotted with the first 2 band SH multiplied by the luminance of the flux. (only SH no occlusion data yet). Because Unity3D has no gl point I have to setup a pixel matrix then render a small quad the size of a pixel to write to the unwrapped texture.
- Propagate on the 6 corners.
- Then I grab the world pos from the camera view and convert it to LPV tex coord. I then do a manual trilinear interpolation (Unity3D dx9 has no tex3D) in the shader of the SH values. Then dot the trilinear lerp value with the first 4 coefficients dot with the worldspace normals.
My questions are
What it means by calculating the weight of the surfel? Is that just how much I multiply the value when injecting it into the volume?
How do I prevent flickering?
- I heard of texel snapping but I'm not sure how to implement it.
- Does RSM downsampling help?
- Is it caused because I'm doing a manual trilinear interpolation? I use the method stated in wikipedia.
Sorry for all the questions.
Here is a screen shot with exaggerated irradiance along with LPV textures rendered on top.