Skip to content

Commit

Permalink
fix: adjust types of ref on custom material shaders
Browse files Browse the repository at this point in the history
  • Loading branch information
Chau Tran authored and Chau Tran committed Apr 3, 2023
1 parent 458e996 commit 2af0443
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -24,7 +24,7 @@ export class NgtsMeshDistortMaterial extends NgtRxStore {

readonly material = new this.MeshDistortMaterial();

@Input() materialRef = injectNgtRef<typeof this.MeshDistortMaterial>();
@Input() materialRef = injectNgtRef<InstanceType<MeshDistortMaterial>>();

@Input() set time(time: number) {
this.set({ time });
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<typeof MeshRefractionMaterial.prototype>();
@Input() materialRef = injectNgtRef<InstanceType<typeof MeshRefractionMaterial>>();
/** Environment map */
@Input() set envMap(envMap: THREE.CubeTexture | THREE.Texture) {
this.set({ envMap });
Expand Down

0 comments on commit 2af0443

Please sign in to comment.