Scene space reflection (SSR) is also called realtime local reflection (rlr). It was first seen in the course "secrets of cryengine 3 graphics technology" of crytek in Siggraph in 2011. Traditional reflection processes reflection information in a plane or cubecmap, while cubemap processes static reflection environments. SSR is used as a supplement to realize the dynamic reflection problem with a low overhead on the irregular surface.
The basic principle of SSR is very simple. The basic idea is:
. Calculate the reflection vector pixel by pixel. For defferedshading, you can simply use the depth and Normal Values in G buffer.
. Track the reflected rays. The specific method is to sample the depth of the stepping point from the reflection point along the reflection direction and compare the depth of the sampling point and the depth of the Step direction for intersection, if the distance between two depth values is smaller than the error range
For light with intersection points, the color of the point at the previous frame is sampled. The sampling color is mixed to contribute to the final coloring of the target reflection point.
In addition to the basic SSR algorithm, crytek also provides some basic optimization methods:
. Using the step size after jitter, you can avoid the steps produced by the fixed step size to a certain extent.
. Filter the SSR results to get a smoother result.
The SSR fade-out process is performed based on the distance from the viewpoint and the screen distance. The farther the reflection is from the viewpoint, the blurrier the reflection.
Currently, the implementation of SSR varies across major engines. The initial algorithm of cryengine uses the current screen point as the reflection point as long as the screen depth is smaller than the stepping point depth, the implementation in ue4 will have more accurate light intersection-when the distance between depth is smaller than the specified error, it will be treated as the intersection point. When we find that the current sampled depth is less than the reflected ray depth, the SSR will return the plastic to perform binary lookup for the approximate Intersection Point. The SSR implementation of klayge is performed in the UV space, while many other implementations are mostly performed in the projection space.
In addition, on Siggraph 2014, the course reflections and volumetrics of Killzone shadow fall of Killzone systematically introduced how Killzone combines SSR into the rendering pipeline, and how to implement correct local reflection Based on Image Parallax.
Screen Space reflection