Browse Source

Misc Fixes (Env helper no mesh, pbr mat eho seo)

Sebastien Vandenberghe 7 years ago
parent
commit
5b1fd01c1a

+ 4 - 0
src/Helpers/babylon.environmentHelper.ts

@@ -459,6 +459,10 @@ namespace BABYLON {
             let groundSize = this._options.groundSize;
             let skyboxSize = this._options.skyboxSize;
             let rootPosition = this._options.rootPosition;
+            if (!this._scene.meshes || this._scene.meshes.length === 1) { // 1 only means the root of the helper.
+                return { groundSize, skyboxSize, rootPosition };
+            }
+            
             const sceneExtends = this._scene.getWorldExtends();
             const sceneDiagonal = sceneExtends.max.subtract(sceneExtends.min);
             let bias = 0.0001;

+ 2 - 2
src/Materials/PBR/babylon.pbrBaseMaterial.ts

@@ -275,13 +275,13 @@
          * This parameters will enable/disable Horizon occlusion to prevent normal maps to look shiny when the normal
          * makes the reflect vector face the model (under horizon).
          */
-        protected _useHorizonOcclusion = false; // USEHORIZONOCCLUSION
+        protected _useHorizonOcclusion = true;
 
         /**
          * This parameters will enable/disable radiance occlusion by preventing the radiance to lit
          * too much the area relying on ambient texture to define their ambient occlusion.
          */
-        protected _useRadianceOcclusion = false;
+        protected _useRadianceOcclusion = true;
         
         /**
          * Specifies that the alpha is coming form the albedo channel alpha channel for alpha blending.

+ 2 - 2
src/Materials/PBR/babylon.pbrMaterial.ts

@@ -418,7 +418,7 @@
          */
         @serialize()
         @expandToProperty("_markAllSubMeshesAsTexturesDirty")
-        public useHorizonOcclusion = false;
+        public useHorizonOcclusion = true;
         
         /**
          * This parameters will enable/disable radiance occlusion by preventing the radiance to lit
@@ -426,7 +426,7 @@
          */
         @serialize()
         @expandToProperty("_markAllSubMeshesAsTexturesDirty")
-        public useRadianceOcclusion = false;
+        public useRadianceOcclusion = true;
 
         /**
          * Gets the image processing configuration used either in this material.