浏览代码

Fix create env texture buttonf or inspector

David Catuhe 6 年之前
父节点
当前提交
69ab6fbf14

+ 1 - 1
inspector/src/components/actionTabs/tabs/toolsTabComponent.tsx

@@ -145,7 +145,7 @@ export class ToolsTabComponent extends PaneComponent {
                     <ButtonLineComponent label="Export to GLB" onClick={() => this.exportGLTF()} />
                     <ButtonLineComponent label="Export to Babylon" onClick={() => this.exportBabylon()} />
                     {
-                        !scene.getEngine().premultipliedAlpha && scene.environmentTexture && scene.activeCamera &&
+                        !scene.getEngine().premultipliedAlpha && scene.environmentTexture && (scene.environmentTexture as CubeTexture).isPrefiltered && scene.activeCamera &&
                         <ButtonLineComponent label="Generate .env texture" onClick={() => this.createEnvTexture()} />
                     }
                 </LineContainerComponent>

+ 7 - 0
src/Materials/Textures/cubeTexture.ts

@@ -215,6 +215,13 @@ export class CubeTexture extends BaseTexture {
     }
 
     /**
+     * Gets a boolean indicating if the cube texture contains prefiltered mips (used to simulate roughness with PBR)
+     */
+    public get isPrefiltered(): boolean {
+        return this._prefiltered;
+    }
+
+    /**
      * Get the current class name of the texture useful for serialization or dynamic coding.
      * @returns "CubeTexture"
      */