فهرست منبع

Fix using a texture not ready in NormalMapProceduralTexture

Popov72 5 سال پیش
والد
کامیت
56d54991ef
1فایلهای تغییر یافته به همراه8 افزوده شده و 0 حذف شده
  1. 8 0
      proceduralTexturesLibrary/src/normalMap/normalMapProceduralTexture.ts

+ 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;