瀏覽代碼

changed to use ongenerate in texture transform extension code

Kacey Coley 7 年之前
父節點
當前提交
1e1d570823
共有 1 個文件被更改,包括 1 次插入8 次删除
  1. 1 8
      serializers/src/glTF/2.0/Extensions/KHR_texture_transform.ts

+ 1 - 8
serializers/src/glTF/2.0/Extensions/KHR_texture_transform.ts

@@ -92,14 +92,7 @@ module BABYLON.GLTF2.Exporter.Extensions {
                 proceduralTexture.setTexture("textureSampler", babylonTexture);
                 proceduralTexture.setMatrix("textureTransformMat", babylonTexture.getTextureMatrix());
 
-                if (!proceduralTexture.isReady()) {
-                    proceduralTexture._effect.onCompiled = () => {
-                        proceduralTexture.render();
-                        resolve(proceduralTexture);
-                    }
-                }
-                else {
-                    proceduralTexture.render();
+                proceduralTexture.onGenerated = () => {
                     resolve(proceduralTexture);
                 }
             });