At a high-level, screen space reflections is ray marching along pixels to see if you can use on-screen information to determine if you can calculate what the reflection should be. It's actually a fairly simple concept, but the math turns out to be fairly nasty if you aren't aware of the caveats.
Some tricky points to be aware of:
- You'll need to march along the ray in screen space coordinates since you want to go pixel by pixel
- You can optimize using a binary search, interesting blog entry on it here
- The depth in screen space coordinates is not linear 99% of the time.
- This is due to the way the projection matrix is created, the depth is made logarithmic to prevent z-fighting between objects that are really close to the camera.
- Because depth isn't linear in screen space, you'll actually want to do the ray intersection in view space
Source:
References:
- Morgan McGuire's post on Screen Space Reflection + Shader Source - Original source that my screen space tracing is based on
- Kode80's Unity 5 Implementation - Great descriptions of how you can take screen space reflections further
- D3D11 Samples - Original code was pulled from here