AmbientOcclusionSettings class Rendering

Screen-space ambient occlusion settings for a Scene.

Reachable through Scene.ambientOcclusion. Ambient occlusion darkens the indirect (image-based) lighting in creases, cavities, and contact points that the smooth environment term would otherwise leave evenly lit. The result reads as soft contact shadowing on edges and concave geometry.

Disabled by default: a fresh scene does no ambient-occlusion work and adds no render passes. Set enabled to turn it on.

The technique is Scalable Ambient Obscurance (McGuire, Mara, and Luebke 2012, https://research.nvidia.com/publication/scalable-ambient-obscurance), evaluated from a camera depth prepass. It takes only a depth buffer (the per-pixel normal is reconstructed from depth), so it fits a forward renderer with no normal buffer, and runs as full-screen fragment passes with no compute.

Constructors

AmbientOcclusionSettings()

Properties

bias double
Distance, in world units, a sampled surface must sit in front of the shaded point before it counts as an occluder. Lifts the estimate off the surface so a flat plane does not occlude itself.
getter/setter pair
enabled bool
Whether ambient occlusion runs. Off by default. When false the scene adds no ambient-occlusion passes and the lighting is unaffected.
getter/setter pair
halfResolution bool
Evaluates the occlusion buffer at half resolution and bilaterally upsamples it, cutting the occlusion pixel work to a quarter at the cost of fine detail. Recommended on mobile.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
intensity double
Strength of the darkening, applied as a power on the occlusion factor. 1.0 is the raw estimate; higher values deepen the occlusion and 0.0 removes it.
getter/setter pair
radius double
World-space radius the occlusion is gathered over. Larger values darken broader cavities; smaller values keep occlusion to tight contact creases.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sampleCount int
Number of samples taken per pixel. More samples cut noise at a roughly linear cost. Reasonable values are about 8 to 32.
getter/setter pair
specularMode SpecularAmbientOcclusionMode
How indirect specular reflections are occluded. See SpecularAmbientOcclusionMode.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited