Hello all,
Sorry for my English!
I found a description about the fastest reflection algorithm for flat surfaces. http://www.remi-genin.fr/blog/screen-space-plane-indexed-reflection-in-ghost-recon-wildlands
I want to recreate it in unity. Attached an example for testing https://www.drive.google.com/open?id=1WfgCpxwx8k6lgALHY6s_588p1D4lYEb6
I have some problems.
1) Why does the example use reflection along the Z axis? After all, the example is reflected on the horizontal surface Y?
2) In my implementation, an incorrect hash buffer.
Perhaps the buffer is written in reverse?
I added a z-buffer distance limit for test. You can see what's happen on 40/100/1000 meters.
Image
Here is the contents of the hash buffer
I tried to change the interlocked Max / min, reversed the value of the z-buffer, tried without hashing (just write uv), still did not succeed.
3) Another interesting question is filling holes. The author writes this
A classic temporal reprojection helps a lot and very little movement actually suffices to almost completely fill the cracks.
As a fallback for pixels that still couldn’t be filled with relevant information but which could still be valid (i.e not in the sky), we’ll just make the reflection surface we generated the frame before “bleed” on the current one. It surely isn’t correct but it gracefully avoids any discontinuity and fills the remnant gaps with a coherent color/luminosity.
Temporary reprojection for static images will not work (or am I mistaken?)
And in the second part I did not understand what he was doing? Is it blending the previous frame and the current frame of the reprojection?
ps There are a couple more links for this method, but the code is more complicated and confusing.
http://www.guitarjawa.net/wordpress/wp-content/uploads/2018/04/IMPLEMENTATION-OF-OPTIMIZED-PIXEL-PROJECTEDREFLECTIONS-FOR-PLANAR-REFLECTORS.pdf
http://www.advances.realtimerendering.com/s2017/PixelProjectedReflectionsAC_v_1.92.pdf