From 2af0443501fdbe66566dedaa2c942887d575f430 Mon Sep 17 00:00:00 2001 From: Chau Tran Date: Mon, 3 Apr 2023 00:44:54 -0500 Subject: [PATCH] fix: adjust types of ref on custom material shaders --- .../src/lib/mesh-distort-material/mesh-distort-material.ts | 4 ++-- .../lib/mesh-refraction-material/mesh-refraction-material.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/angular-three-soba/materials/src/lib/mesh-distort-material/mesh-distort-material.ts b/libs/angular-three-soba/materials/src/lib/mesh-distort-material/mesh-distort-material.ts index 841a292..500b9e0 100644 --- a/libs/angular-three-soba/materials/src/lib/mesh-distort-material/mesh-distort-material.ts +++ b/libs/angular-three-soba/materials/src/lib/mesh-distort-material/mesh-distort-material.ts @@ -1,6 +1,6 @@ import { Component, CUSTOM_ELEMENTS_SCHEMA, inject, Input } from '@angular/core'; import { injectBeforeRender, injectNgtRef, NgtArgs, NgtRxStore } from 'angular-three'; -import { NGTS_DISTORT_MATERIAL_SHADER } from 'angular-three-soba/shaders'; +import { MeshDistortMaterial, NGTS_DISTORT_MATERIAL_SHADER } from 'angular-three-soba/shaders'; @Component({ selector: 'ngts-mesh-distort-material', @@ -24,7 +24,7 @@ export class NgtsMeshDistortMaterial extends NgtRxStore { readonly material = new this.MeshDistortMaterial(); - @Input() materialRef = injectNgtRef(); + @Input() materialRef = injectNgtRef>(); @Input() set time(time: number) { this.set({ time }); diff --git a/libs/angular-three-soba/materials/src/lib/mesh-refraction-material/mesh-refraction-material.ts b/libs/angular-three-soba/materials/src/lib/mesh-refraction-material/mesh-refraction-material.ts index 5d40d8f..9e65603 100644 --- a/libs/angular-three-soba/materials/src/lib/mesh-refraction-material/mesh-refraction-material.ts +++ b/libs/angular-three-soba/materials/src/lib/mesh-refraction-material/mesh-refraction-material.ts @@ -36,7 +36,7 @@ const isCubeTexture = (def: THREE.CubeTexture | THREE.Texture): def is THREE.Cub schemas: [CUSTOM_ELEMENTS_SCHEMA], }) export class NgtsMeshRefractionMaterial extends NgtRxStore implements OnInit { - @Input() materialRef = injectNgtRef(); + @Input() materialRef = injectNgtRef>(); /** Environment map */ @Input() set envMap(envMap: THREE.CubeTexture | THREE.Texture) { this.set({ envMap });