Jump to content
  • Advertisement
Kripto289

R&D Screen Space Planar Reflections

Recommended Posts

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.

 

Spoiler

Image

jW9p3uk.png


Here is the contents of the hash buffer

Spoiler

9WcsYur.png



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

Spoiler

 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

Share this post


Link to post
Share on other sites
Advertisement
On 6/8/2019 at 10:13 AM, Kripto289 said:

Why does the example use reflection along the Z axis? After all, the example is reflected on the horizontal surface Y?

Some games use Y is up, some games use Z is up.

On 6/8/2019 at 10:13 AM, Kripto289 said:

Here is the contents of the hash buffer

Looks like you're not skipping pixels that are below the plane and shouldn't be reflected?

On 6/8/2019 at 10:13 AM, Kripto289 said:

Temporary reprojection for static images will not work (or am I mistaken?)

Look into temporal anti aliasing (taa). Usually when using this technique, you move the camera by a fraction of a pixel even when static, so there is a small amount of new information. And yeah, for the second part it sounds like if the temporal filter doesn't work, they simply use the last valid reflection color that appeared at this pixel (i.e. draw over the previous reflection texture without clearing it). Camera movement would then "smear" somewhat appropriate colours around in the holes.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!