Skip to content
🎉 Angular Three v4 is here! Read the announcement

NgtpN8AO

N8AO (N8 Ambient Occlusion) is a high-quality screen-space ambient occlusion effect that adds realistic shadowing to crevices, corners, and areas where objects meet.

N8AO requires an additional dependency:

Terminal window
npm install n8ao
import { NgtpEffectComposer } from 'angular-three-postprocessing';
import { NgtpN8AO } from 'angular-three-postprocessing/n8ao';
@Component({
template: `
<ngtp-effect-composer>
<ngtp-n8ao [options]="{
aoRadius: 0.5,
intensity: 1
}" />
</ngtp-effect-composer>
`,
imports: [NgtpEffectComposer, NgtpN8AO],
})
export class SceneGraph {}
PropertyTypeDefaultDescription
quality'performance' | 'low' | 'medium' | 'high' | 'ultra'-Quality preset
intensitynumber5Strength of AO effect
aoRadiusnumber5.0Radius in world units
aoSamplesnumber16Samples for AO calculation
denoiseSamplesnumber8Denoising samples
denoiseRadiusnumber12Denoising filter radius
halfResbooleanfalseRender at half resolution
screenSpaceRadiusbooleanfalseScreen-space vs world-space radius
colorColorRepresentation'black'AO shadow color
// Performance preset - fastest, lowest quality
<ngtp-n8ao [options]="{ quality: 'performance' }" />
// Ultra preset - slowest, highest quality
<ngtp-n8ao [options]="{ quality: 'ultra' }" />
  • Use halfRes: true for better performance on lower-end devices
  • Increase aoRadius for larger, softer shadows
  • Use color to tint AO shadows (e.g., slight blue for outdoor scenes)
  • screenSpaceRadius: true makes AO consistent regardless of camera distance
  • N8AO is more performant than traditional SSAO while providing better quality