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 {
21
21
protected readonly environmentInput = inject ( NgtsEnvironmentInput ) ;
22
22
readonly #defaultTexture = injectNgtsEnvironment ( this . environmentInput . environmentParams ) ;
23
23
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
+ ) ;
28
31
29
32
readonly groundArgs = computed ( ( ) => ( this . texture ( ) ? [ this . texture ( ) ] : [ ] ) ) ;
30
33
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<
55
55
const CUBEMAP_ROOT = 'https://market-assets.fra1.cdn.digitaloceanspaces.com/market-assets/hdris/' ;
56
56
export function injectNgtsEnvironment ( paramsFactory : ( ) => Partial < NgtsInjectEnvironmentParams > , injector ?: Injector ) {
57
57
injector = assertInjectionContext ( injectNgtsEnvironment , injector ) ;
58
+ const textureRef = injectNgtRef < THREE . Texture | CubeTexture > ( ) ;
58
59
return runInInjectionContext ( injector , ( ) => {
59
60
const cdr = inject ( ChangeDetectorRef ) ;
60
- const textureRef = injectNgtRef < THREE . Texture | CubeTexture > ( ) ;
61
61
62
62
inject ( DestroyRef ) . onDestroy ( ( ) => {
63
63
textureRef . untracked . dispose ( ) ;
You can’t perform that action at this time.
0 commit comments