11import { ChangeDetectionStrategy , Component , CUSTOM_ELEMENTS_SCHEMA } from '@angular/core' ;
22import { injectBeforeRender , NgtCanvas } from 'angular-three' ;
3+ import { injectGLTF } from 'angular-three-soba/loaders' ;
34import { NgtsAccumulativeShadows , NgtsEnvironment , NgtsRandomizedLights } from 'angular-three-soba/staging' ;
45import { Vector3 } from 'three' ;
56import { color , colorAsHex } from './color' ;
67import { Lightformers } from './lightformers' ;
78import { Model } from './model' ;
89
10+ injectGLTF . preload ( ( ) => './911-transformed.glb' ) ;
11+
912@Component ( {
1013 standalone : true ,
1114 template : `
@@ -21,16 +24,20 @@ import { Model } from './model';
2124 </ngt-spot-light>
2225 <ngt-ambient-light [intensity]="0.5 * Math.PI" />
2326
24- <app-porsche [position]="[-0.5, -0.18, 0]" [rotation]="[0, Math.PI / 5, 0]" [scale]="1.6" />
27+ <app-porsche-model #model [position]="[-0.5, -0.18, 0]" [rotation]="[0, Math.PI / 5, 0]" [scale]="1.6" />
2528
26- <ngts-accumulative-shadows [options]="{ position: [0, -1.16, 0], frames: 100, alphaTest: 0.9, scale: 10 }">
29+ <ngts-accumulative-shadows
30+ [options]="{ position: [0, -1.16, 0], frames: 100, alphaTest: 0.9, scale: 10, visible: !!model.gltf() }"
31+ >
2732 <ngts-randomized-lights
2833 [options]="{ amount: 8, radius: 10, ambient: 0.5, position: [1, 5, -1], intensity: 1.5 * Math.PI }"
2934 />
3035 </ngts-accumulative-shadows>
3136
3237 <ngts-environment [options]="{ background: true, blur: 1, resolution: 256, frames: Infinity }">
33- <app-lightformers * />
38+ <ng-template>
39+ <app-lightformers />
40+ </ng-template>
3441 </ngts-environment>
3542 ` ,
3643 schemas : [ CUSTOM_ELEMENTS_SCHEMA ] ,
0 commit comments