Skip to content

Properties

Shader

The Cavity and Curvature effect is achieved through a multi-pass shader that combines edge detection and an ambient occlusion algorithm. The original shader is based on Blender's cavity screen space and world space options found in the viewport shading settings.

Custom depth

The result is then combined in post-processing using the 'Combine Material' shader.

Custom depth

Warning

To correctly use Custom Depth and Stencil ID you have to enable it in Project Settings.

This property is used to calculate the shader exclusively on objects with defined custom depth and/or stencil IDs.

Custom depth

Reconstruct Normal

When set to true, the World Normal used for the shader elaboration is not provided by the engine, but is reconstructed from the Depth value. This technique is also used by Unreal in some Mobile shaders when the World Normal buffer is not available. For example, when Unlit materials are present in the world, Unreal does not compute the Normal, and as a result, enabling this option is necessary for proper functionality. If this is not your case, leave this option disabled.

Custom depth

Cavity

Cavity corresponds to Blender's World Space Cavity. It is an ambient occlusion shader used to highlight edges and corners.

Custom depth

Properties

  1. Sample: Random sample around the current pixel (Best result with higher values at the expense of performance, optimal value = 16)
  2. ValleyPower: Power exponent for concave edge
  3. RidgePower: Power exponent for convex edge
  4. ValleyAttenuation: Attenuation for concave edge
  5. RidgeAttenuation: Attenuation for convex edge
  6. Distance: Sample distance from current pixel
  7. FarZ: Mask for pixels with greater distance from camera
  8. IntraZMask: Reduces the intensity of cavities when the edge has a step greater than this distance
  9. BlurIntensity: Blur intensity after cavity calculation (Best result with higher values at the expense of performance, optimal value = 5-15, 0 = Off)
  10. BlurDownsample: Downsample before the blur, how many times half the resolution before the blur (Best result with lower values at the expense of performance, 0 = Off)

Curvature

Curvature corresponds to Blender's Screen Space Cavity. It is an edge detection shader.

Custom depth

Properties

  1. ValleyPower: Power exponent for concave edge
  2. RidgePower: Power exponent for convex edge
  3. Threshold: Mask Curvature with this angle Threashold
  4. FarZ: Mask for pixels with greater distance from camera

Material

Within this material, you can obtain the shader result values to combine it with the scene's color in post-processing. (check Material to see how to create your own material).

Custom depth