File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed
libs/soba/staging/src/environment Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,13 @@ export class NgtsEnvironmentGround {
2121 protected readonly environmentInput = inject ( NgtsEnvironmentInput ) ;
2222 readonly #defaultTexture = injectNgtsEnvironment ( this . environmentInput . environmentParams ) ;
2323
24- readonly texture = computed ( ( ) => {
25- const defaultTexture = this . #defaultTexture. nativeElement ;
26- return this . environmentInput . environmentMap ( ) || defaultTexture ;
27- } ) ;
24+ readonly texture = computed (
25+ ( ) => {
26+ const defaultTexture = this . #defaultTexture. nativeElement ;
27+ return this . environmentInput . environmentMap ( ) || defaultTexture ;
28+ } ,
29+ { equal : Object . is }
30+ ) ;
2831
2932 readonly groundArgs = computed ( ( ) => ( this . texture ( ) ? [ this . texture ( ) ] : [ ] ) ) ;
3033 readonly height = computed ( ( ) => ( this . environmentInput . environmentGround ( ) as any ) ?. height ) ;
Original file line number Diff line number Diff line change @@ -55,9 +55,9 @@ type NgtsInjectEnvironmentParams = Partial<
5555const CUBEMAP_ROOT = 'https://market-assets.fra1.cdn.digitaloceanspaces.com/market-assets/hdris/' ;
5656export function injectNgtsEnvironment ( paramsFactory : ( ) => Partial < NgtsInjectEnvironmentParams > , injector ?: Injector ) {
5757 injector = assertInjectionContext ( injectNgtsEnvironment , injector ) ;
58+ const textureRef = injectNgtRef < THREE . Texture | CubeTexture > ( ) ;
5859 return runInInjectionContext ( injector , ( ) => {
5960 const cdr = inject ( ChangeDetectorRef ) ;
60- const textureRef = injectNgtRef < THREE . Texture | CubeTexture > ( ) ;
6161
6262 inject ( DestroyRef ) . onDestroy ( ( ) => {
6363 textureRef . untracked . dispose ( ) ;
You can’t perform that action at this time.
0 commit comments