DocsGRADEReference

Cavity

4 min read

On this page

Brightens ridges and darkens creases from the surface normals (normal maps included) at a fine and a coarse scale, with ridge / valley colours (viewport cavity, edge wear, dirt in creases).

Studio categoryScene
Pipeline stageScene (scene-linear HDR, before the tonemapper)
Default position2 in its stage
Works inLive views only (viewports, PIE, games, Movie Render Queue): needs scene depth or the level
C++ / BlueprintFGradeLayer::Effects.Cavity (FGradeCavity)

Manual: Cavity. Every numeric parameter can be set at runtime with Set Layer Parameter using the path shown (see Animation).

Parameters

Cavity / curvature shading from depth (ridges brighter, valleys darker), like viewport cavity in DCC tools. Curvature from the GBuffer / Substrate detail normals (depth normals as fallback), fine + coarse scales in screen or world units, ridge / valley colours, blend modes, sharpness, luminance protection and debug views.

ParameterBlueprint pathValuesDefaultDescription
EnabledEffects.Cavity.Enabledon/offoffTurns this on or off (the other values are kept while it is off).
RidgeEffects.Cavity.Ridge0..10040Brightening of convex edges, 0..100.
ValleyEffects.Cavity.Valley0..10050Darkening of concave creases, 0..100.
RadiusEffects.Cavity.Radius0.5..81.5Sampling radius in pixels (at 1080 lines).
Fade DistanceEffects.Cavity.FadeDistance>= 0 cm (slider to 50000)5000Fades out beyond this distance (cm, 0 = never).
Show OnlyEffects.Cavity.ShowOnlyon/offoff
Normal SourceEGradeSurfaceNormalsAuto (GBuffer / Substrate)Normals the curvature is measured on: Auto = GBuffer / Substrate detail normals (normal maps add fine cavity), Geometry = depth only.
SharpnessEffects.Cavity.Sharpness0..10050Edge sharpness, 0..100: higher = only the strongest curvature shows, with a crisper transition (50 = the classic look).
DebugEGradeCavityDebugNoneDebug view (Show cavity only = Cavity factor).
Fade StartEffects.Cavity.FadeStart>= 0 cm (slider to 50000)0Distance where the fade out starts (cm); it ends at Fade Distance. 0 = automatic (70% of Fade Distance, the classic fade).

Scale

ParameterBlueprint pathValuesDefaultDescription
Radius SpaceEGradeCavityRadiusScreen (pixels)Screen: Radius and Coarse Radius in pixels; World: World Radius and Coarse World Radius in cm (the cavity shrinks with distance).
World RadiusEffects.Cavity.WorldRadius>= 0.1 cm (slider to 50)2Fine radius in cm (World radius space).
CoarseEffects.Cavity.Coarse0..1000Second, wider curvature scale (large shapes, panel seams, soft rounded forms), 0..100 (0 = fine scale only).
Coarse RadiusEffects.Cavity.CoarseRadius1..326Coarse radius in pixels at 1080 lines (Screen radius space).
Coarse World RadiusEffects.Cavity.CoarseWorldRadius>= 0.5 cm (slider to 200)12Coarse radius in cm (World radius space).
Ridge WidthEffects.Cavity.RidgeWidth25..400100Width of the ridge (convex) lines, % of the radii (100 = the radius as set). Different Ridge / Valley widths cost a second curvature pass.
Valley WidthEffects.Cavity.ValleyWidth25..400100Width of the valley (concave crease) lines, % of the radii (100 = the radius as set).

Look

ParameterBlueprint pathValuesDefaultDescription
Blend ModeEGradeCavityBlendMultiplyHow ridges and valleys change the colour (Multiply = the classic look).
Ridge ColorEffects.Cavity.RidgeColor.R/G/B/AcolourwhiteColour of the ridges (Multiply: brightening tint; Exposure: tint; Overlay: painted colour). White = neutral.
Valley ColorEffects.Cavity.ValleyColor.R/G/B/AcolourblackColour of the valleys (Multiply: the colour creases darken towards; Exposure: tint; Overlay: painted colour). Black = neutral darkening.
Luminance ProtectionEffects.Cavity.LuminanceProtection0..10030Keeps bright pixels (lights, emissive, sky reflections) free of cavity, 0..100.

Quality

ParameterBlueprint pathValuesDefaultDescription
Silhouette RejectionEffects.Cavity.SilhouetteRejection0..10075Ignores neighbours across silhouettes and depth steps (an object in front of another one), 0..100: no halos or crosses where an edge passes in front of a surface; real creases and contact corners keep their cavity. 0 = off (every neighbour counts).
QualityEGradeCavityQualityAuto (Studio quality)Sampling quality (Auto = the Studio quality setting).

Enumerations

Surface Normals (EGradeSurfaceNormals)

Normals the Cavity and Bevel effects read.

ValueMeaning
Auto (GBuffer / Substrate)Detail normals of the GBuffer (the Substrate top layer with Substrate's Adaptive GBuffer): normal maps add fine detail. Falls back to the depth normals where they are unavailable or implausible.
Geometry (depth)Geometry only: normals rebuilt from the scene depth (normal maps ignored, like a clay render).

Cavity Radius (EGradeCavityRadius)

How the Cavity radii are measured.

ValueMeaning
Screen (pixels)Pixels at 1080 lines: the same line width at every distance (viewport cavity).
World (cm)Centimetres in the world: the cavity shrinks with distance like a real surface feature.

Cavity Blend (EGradeCavityBlend)

How ridges and valleys change the colour.

ValueMeaning
MultiplyMultiplies the colour: ridges brighter, valleys darker, tinted by the ridge / valley colours (classic viewport cavity).
ExposureRidges and valleys in stops of exposure: soft, photographic, keeps saturation.
OverlayPaints the ridge / valley colours over the image: edge wear and dirt in creases, also on dark surfaces.

Cavity Debug (EGradeCavityDebug)

Cavity debug views.

ValueMeaning
None-
Cavity factorThe cavity factor on a light grey (same as Show cavity only).
CurvatureSigned curvature: ridges orange, valleys blue.
NormalsThe normals the curvature is measured on (view space).

Cavity Quality (EGradeCavityQuality)

Cavity sampling quality. Auto follows grade.Quality (the Studio quality setting). Cost at 1080p: Low ~0.10 ms, Medium ~0.13 ms, High ~0.20 ms, Epic ~0.26 ms (+ ~60% with Coarse, x2 when Ridge / Valley widths differ).

ValueMeaning
Auto (Studio quality)-
LowTwo sample axes, no midpoint check (fastest; a few halos can remain at tight silhouettes).
MediumTwo axes + the midpoint silhouette check.
HighFour axes (diagonals: rounder, smoother lines) + midpoint check.
EpicHigh + a second ring at half the radius (softest falloff).

Generated from the GRADE C++ headers. Back to the reference index.