Pārlūkot izejas kodu

Set ignoreCameraMaxZ to true for default skybox

Gary Hsu 4 gadi atpakaļ
vecāks
revīzija
1b50887212
1 mainītis faili ar 5 papildinājumiem un 5 dzēšanām
  1. 5 5
      src/Helpers/sceneHelpers.ts

+ 5 - 5
src/Helpers/sceneHelpers.ts

@@ -168,9 +168,9 @@ Scene.prototype.createDefaultSkybox = function(environmentTexture?: BaseTexture,
     }
 
     // Skybox
-    var hdrSkybox = Mesh.CreateBox("hdrSkyBox", scale, this);
+    const hdrSkybox = Mesh.CreateBox("hdrSkyBox", scale, this);
     if (pbr) {
-        let hdrSkyboxMaterial = new PBRMaterial("skyBox", this);
+        const hdrSkyboxMaterial = new PBRMaterial("skyBox", this);
         hdrSkyboxMaterial.backFaceCulling = false;
         hdrSkyboxMaterial.reflectionTexture = environmentTexture.clone();
         if (hdrSkyboxMaterial.reflectionTexture) {
@@ -179,21 +179,21 @@ Scene.prototype.createDefaultSkybox = function(environmentTexture?: BaseTexture,
         hdrSkyboxMaterial.microSurface = 1.0 - blur;
         hdrSkyboxMaterial.disableLighting = true;
         hdrSkyboxMaterial.twoSidedLighting = true;
-        hdrSkybox.infiniteDistance = true;
         hdrSkybox.material = hdrSkyboxMaterial;
     }
     else {
-        let skyboxMaterial = new StandardMaterial("skyBox", this);
+        const skyboxMaterial = new StandardMaterial("skyBox", this);
         skyboxMaterial.backFaceCulling = false;
         skyboxMaterial.reflectionTexture = environmentTexture.clone();
         if (skyboxMaterial.reflectionTexture) {
             skyboxMaterial.reflectionTexture.coordinatesMode = Texture.SKYBOX_MODE;
         }
         skyboxMaterial.disableLighting = true;
-        hdrSkybox.infiniteDistance = true;
         hdrSkybox.material = skyboxMaterial;
     }
     hdrSkybox.isPickable = false;
+    hdrSkybox.infiniteDistance = true;
+    hdrSkybox.ignoreCameraMaxZ = true;
     return hdrSkybox;
 };