Local reflections
IntermediateArtistProgrammer
Warning
Currently, local reflections aren’t compatible with mobile platforms and cause crashes.
Note
As with other depth-aware post effects, enabling local reflections nullifies MSAA (multisample anti-aliasing). local reflections are enabled, the scene is reflected in glossy materials. Local reflections dramatically increase the realism of scenes. They’re most obvious when they reflect bright spots onto other surfaces. The effect is especially striking in dark scenes, which have high contrast, and in conditions with lots of reflective surfaces and highlights.
Where to use local reflections
screenspace effect, which means they only reflect objects that are already on the screen; they don’t reflect objects that are offscreen or obscured by other objects. Put simply, if the camera can’t see an object at that moment, then that object isn’t reflected. This means local reflections work well in enclosed areas such as corridors and rooms, but less well in open spaces, where you’d expect more of the world to be reflected. They also work best on bumpy surfaces, which hide imperfections in reflections, and less well on very glossy, mirror-like surfaces. Missing reflections are noticeable in mirrors, for example.
Algorithm
Xenko processes local reflections in four passes:
- raycast pass performs screenspace ray tracing over the depth buffer to find intersections.
- resolve pass resolves the rays and calculates the reflection color.
- temporal pass uses the history buffer to blur constantly between the current and previous frames. This reduces noise in the reflection, but produces an animated “jittering” effect that is sometimes noticeable. You can adjust or disable this step to create the effect you want.
- combine pass mixes the results of the effect with the rendered image.
Enable local reflections
graphics compositor. - Asset View (in the bottom pane by default), double-click the Graphics Compositor asset. The graphics compositor editor opens.
- post-processing effects node.
Tip
Create > post-processing effects to create one. On the new forward renderer node, on the PostEffects slot, click and drag a link to the post-processing effects node. - Property Grid (on the right by default), enable Local reflections.
gloss threshold (see below) to set how glossy materials should be to reflect the scene.
Properties
The local reflections properties affect all reflections in the scene.Raycast properties
BRDF bias
0.82.Depth resolution
Downscales the depth buffer to optimize raycast performance. Full gives better quality, but half improves performance. The default is half.Gloss threshold
0.4, only materials with a gloss map value of0.4or above reflect the scene. The default value is0.55.Note
Invert check box is selected in the material micro surface properties, the opposite is true. For example, if the reflections gloss value is set to0.4, only materials with a gloss map value of less than0.4reflect the scene. Materials — geometry attributes.Max steps
60.Note
This is the most important property for controlling performance.Resolution
full and half. Full gives better quality, but half improves performance. The default value is half.Ray start bias
0.03or lower. The default value is0.01.Resolve properties
Resolution
full and half. Full gives the best results, but half improves performance. The default value is full.Samples
4.Reduce highlights
Reduces the brightness of particularly bright areas of reflections. This has no effect on performance.Edge fade factor
0.1.Use color buffer mips
Downscales the input color buffer and uses blurred mipmaps when resolving the reflection color. This produces more realistic results by blurring distant parts of reflections in rough (low-gloss) materials. It also improves performance on most platforms. However, it uses more memory, so you might want to disable it on (for example) mobile platforms.Temporal properties
Temporal effect
Enables the temporal pass. This reduces noise, but produces an animated “jittering” effect that is sometimes noticeable. The temporal effect is enabled by default.Note
If the temporal effect is disabled, the other temporal properties have no effect.Response
How quickly reflections blend between the reflection in the current frame and the history buffer. Lower values produce reflections faster, but with more jittering. Note the jittering in the reflection below:1. The default value is0.9.Scale
4.See also
- Materials
- Materials — geometry attributes
- Post effects
- Graphics compositor
