Просмотр исходного кода

Fix using a texture not ready in NormalMapProceduralTexture

Popov72 5 лет назад
Родитель
Сommit
56d54991ef

+ 8 - 0
proceduralTexturesLibrary/src/normalMap/normalMapProceduralTexture.ts

@@ -30,6 +30,14 @@ export class NormalMapProceduralTexture extends ProceduralTexture {
         this.updateShaderUniforms();
     }
 
+    public isReady(): boolean {
+        if (!this._baseTexture || !this._baseTexture.isReady()) {
+            return false;
+        }
+
+        return super.isReady();
+    }
+
     @serializeAsTexture()
     public get baseTexture(): Texture {
         return this._baseTexture;