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

NgtpOutline

The outline effect draws an outline around selected objects, useful for highlighting or selection feedback.

import { NgtpEffectComposer, NgtpOutline } from 'angular-three-postprocessing';
@Component({
template: `
<ngt-mesh #mesh>
<ngt-box-geometry />
<ngt-mesh-standard-material />
</ngt-mesh>
<ngtp-effect-composer>
<ngtp-outline [options]="{
selection: [meshRef],
edgeStrength: 3,
visibleEdgeColor: 0xffffff
}" />
</ngtp-effect-composer>
`,
imports: [NgtpEffectComposer, NgtpOutline],
})
export class SceneGraph {
meshRef = viewChild<ElementRef<THREE.Mesh>>('mesh');
}
PropertyTypeDefaultDescription
selectionObject3D[][]Objects to outline
edgeStrengthnumber1Strength of the outline
pulseSpeednumber0Speed of pulse animation (0 = no pulse)
visibleEdgeColornumber0xffffffColor of visible edges
hiddenEdgeColornumber0x22090aColor of hidden edges
blurbooleanfalseApply blur to outline
xRaybooleantrueShow outline through objects
@Component({
template: `
<ngt-mesh #mesh (click)="selected.set(mesh)">
<ngt-box-geometry />
<ngt-mesh-standard-material />
</ngt-mesh>
<ngtp-effect-composer>
@if (selected()) {
<ngtp-outline [options]="{
selection: [selected()],
edgeStrength: 5,
visibleEdgeColor: 0x00ff00,
pulseSpeed: 0.5
}" />
}
</ngtp-effect-composer>
`,
})
export class SceneGraph {
selected = signal<THREE.Mesh | null>(null);
}