Screen Space Reflections

Started by
-1 comments, last by Quat 10 years, 8 months ago

I've been working on screen space reflections, and I am struggling with "false" reflections with concave shapes, or shapes that are "floating" off the reflective surface. For example, let's say I have a a reflective floor and an object O floating above it. Some reflective rays will shoot under O and not intersect it. However, they will eventually be occluded by O, which makes them "cross" the depth buffer, so it registers a false intersection. I am having a hard time handling this case robustly. I tried taking the distance between the ray sample point and the depth buffer value, and if it is too large, then don't register it as an intersection. This works only part of the time, and I sometimes get noisy rendering artifacts as the test passes for some pixels but not neighboring pixels that are near the threshold distance. It almost seems better to live with the false reflection as it is less distracting than the noise. Does anyone have any tips?

Also, what is preferred: ray marching in view space and projecting the ray sample points to compare with the depth buffer, or just working completely in screen space marching pixel by pixel?

I've tried both, and both have aliasing problems. I sort of liked the view space approach because I could easily march along the reflection vector some fixed world space length (like support reflections 50 meters out) using a coarse linear search followed by a refinement bisection search. Also, The problem with marching pixel by pixel in screen space, is that your might have to march across the screen to find the reflected pixel (very expensive).

-----Quat

This topic is closed to new replies.

Advertisement