From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

Viewport Compositing

User Documentation

Frank from project gooseberry with SSAO and Depth of Field.

The current viewport compositing system includes two effects that can be used as a post process in the 3D viewport and during offscreen rendering. The goal is to generalize the system and allow node definition of effects in the future but for now there are only two hard-coded effects that can be used:

The controls for the effects can be found in a few places:
To control how the effect appears in a certain 3D viewport, use the checkboxes, "SSO" and "Depth Of Field" located under the "Shading" panel. Camera objects, also have a new panel in their properties, "GPU Depth of Field" that controls the real time depth of field effect. This is used during sequencer or OpenGL rendering and when looking through a camera in the 3D viewport.

Limitations:

  • The current system depends on the scene depth buffer to generate information for the effects. As such, invalidating the depth buffer will cause the effects to fail. The most common case where this might happen is when XRay is set on an object.
  • Any drawing that writes to the depth buffer, such as widgets and wires will contribute in the effects.
  • The SSAO effect relies on the surface normals to function, however since the current system is not true deferred shading, those get composited from the depth buffer and smooth shading is not taken into account.


Ambient Occlusion
This effect tries to simulate the effects of ambient occlusion by doing raycasting in screen space. To control the effect, the following controls are added:

Strength:
This factor directly multiplies the computed color of the effect, so increase this for a stronger effect.

Distance:
The maximum world space distance the effect is computed in.

Attenuation:
How strongly the effect attenuates with distance. Increasing this makes far away surfaces contribute less to the effect. Use this to get rid of some banding artifacts.

Samples:
The amount of samples used for the effect. Higher is better, but the actual number used is squared so use with caution.

Color:
Color of the effect, can be modified to give a different feel, from ambient lighting to dirt/rust.


Depth Of Field
This effect tries to simulate a depth of field effect, similar to one produced by a camera. The effect is controlled by certain options of the active camera, namely, the GPU fstop option (in the depth of field panel), the focal length, the sensor size and the focus distance/focus object.

Options influencing the effects. Ambient Occlusion settings in green, Depth of Field settings in yellow

Viewport f-stop:
This setting is relevant to the aperture of the camera lens. Less means more blur.

Distance:
The distance where the focus of the lens is. Using the eyedropper (E) it's possible to sample directly on the 3D viewport to set the focus

Focus:
Same as above but uses the centre of an object to define the focus. Overrides distance when used.

Focal Length:
More focal length means more blur.

Size:
Bigger sensor size means less blur.