Skip to content

NgtsStage

NgtsStage is a port of Drei’s Stage which provides a complete stage setup for presenting 3D models with lighting, shadows, and environment.

Automatically centers content, sets up professional lighting presets, and configures shadows.

Usage

Basic Stage

<ngts-stage>
<ngt-mesh>
<ngt-box-geometry />
<ngt-mesh-standard-material color="orange" />
</ngt-mesh>
</ngts-stage>

With Lighting Preset

<ngts-stage [options]="{ preset: 'rembrandt' }">
<app-model />
</ngts-stage>

Available presets:

  • rembrandt - Classic Rembrandt lighting (default)
  • portrait - Portrait photography lighting
  • upfront - Front-facing even lighting
  • soft - Soft, diffused lighting

Contact Shadows

<ngts-stage [options]="{ shadows: 'contact', preset: 'portrait' }">
<app-model />
</ngts-stage>

Accumulative Shadows

<ngts-stage [options]="{ shadows: 'accumulative', preset: 'soft' }">
<app-model />
</ngts-stage>

No Shadows

<ngts-stage [options]="{ shadows: false }">
<app-model />
</ngts-stage>

Custom Environment

<ngts-stage [options]="{ environment: 'sunset', preset: 'rembrandt' }">
<app-model />
</ngts-stage>

No Environment

<ngts-stage [options]="{ environment: null }">
<ngt-ambient-light [intensity]="0.5" />
<app-model />
</ngts-stage>

Adjusted Intensity

<ngts-stage [options]="{ intensity: 1, preset: 'upfront' }">
<app-model />
</ngts-stage>

Manual Camera Control

Disable automatic camera adjustment:

<ngts-stage [options]="{ adjustCamera: false }">
<app-model />
</ngts-stage>
<ngts-orbit-controls />

Custom Shadow Options

<ngts-stage
[options]="{
shadows: {
type: 'contact',
opacity: 0.8,
blur: 2,
far: 10
}
}"
>
<app-model />
</ngts-stage>

With Center Options

<ngts-stage [options]="{ center: { top: true } }">
<app-model />
</ngts-stage>

Product Showcase

<ngts-stage
[options]="{
preset: 'portrait',
environment: 'studio',
shadows: 'contact',
intensity: 0.8
}"
>
@if (productGltf(); as gltf) {
<ngt-primitive *args="[gltf.scene]" />
}
</ngts-stage>
<ngts-orbit-controls [options]="{ enableZoom: false, autoRotate: true }" />

Lighting Presets

PresetDescription
rembrandtClassic dramatic lighting with strong shadows
portraitFlattering front-side lighting for subjects
upfrontEven, front-facing lighting with minimal shadow
softDiffused, ambient-like lighting

Notes

  • Stage automatically centers its children using NgtsCenter
  • The adjustCamera option uses NgtsBounds to fit the camera
  • Environment maps are applied using NgtsEnvironment
  • Shadows can be either NgtsContactShadows or NgtsAccumulativeShadows
  • Use camera controls with makeDefault: true for proper bounds integration
  • The intensity option multiplies the lighting intensity of the preset

Options

options input accepts any properties from THREE.Group in addition to the following:

Properties

name type description
preset 'rembrandt' | 'portrait' | 'upfront' | 'soft' | NgtsStageLightingOptions Lighting preset or custom lighting configuration. Default: 'rembrandt'
shadows false | 'contact' | 'accumulative' | NgtsStageShadowsOptions Shadow type configuration. Default: 'contact'
adjustCamera boolean Whether to automatically adjust the camera to fit the content. Default: true
environment string | NgtsEnvironmentOptions | null Environment map configuration: preset name, options object, or null. Default: 'city'
intensity number Overall lighting intensity multiplier. Default: 0.5
center NgtsCenterOptions Options for centering the content within the stage.