Przeglądaj źródła

Updtae Background Material

sebastien 7 lat temu
rodzic
commit
573f2927e5

Plik diff jest za duży
+ 14829 - 14822
Playground/babylon.d.txt


Plik diff jest za duży
+ 17634 - 17627
dist/preview release/babylon.d.ts


Plik diff jest za duży
+ 5 - 5
dist/preview release/babylon.js


Plik diff jest za duży
+ 160 - 74
dist/preview release/babylon.max.js


Plik diff jest za duży
+ 160 - 74
dist/preview release/babylon.no-module.max.js


Plik diff jest za duży
+ 15 - 15
dist/preview release/babylon.worker.js


Plik diff jest za duży
+ 160 - 74
dist/preview release/es6.js


Plik diff jest za duży
+ 35 - 35
dist/preview release/viewer/babylon.viewer.js


Plik diff jest za duży
+ 160 - 74
dist/preview release/viewer/babylon.viewer.max.js


+ 9 - 1
src/Helpers/babylon.environmentHelper.ts

@@ -418,7 +418,15 @@ module BABYLON {
             }
 
             if (this.groundMirror) {
-                this.groundMirror.clearColor = new Color4(color.r, color.g, color.b, 1.0);
+                if (perceptual && this.groundMaterial) {
+                    this.groundMirror.clearColor = new Color4(this.groundMaterial.primaryColor.r, 
+                        this.groundMaterial.primaryColor.g, 
+                        this.groundMaterial.primaryColor.b, 
+                        1.0);
+                }
+                else {
+                    this.groundMirror.clearColor = new Color4(color.r, color.g, color.b, 1.0);
+                }
             }
         }
 

+ 3 - 0
src/Materials/Background/babylon.backgroundMaterial.ts

@@ -148,6 +148,9 @@
 
         @serializeAsColor3()
         protected _primaryColor: Color3;
+        /**
+         * Key light Color (multiply against the environement texture)
+         */
         @expandToProperty("_markAllSubMeshesAsLightsDirty")
         public primaryColor = Color3.White();
         

+ 3 - 1
src/Materials/Textures/babylon.mirrorTexture.ts

@@ -94,7 +94,9 @@
             this.ignoreCameraViewport = true;
             
             this._updateGammaSpace();
-            this._imageProcessingConfigChangeObserver = scene.imageProcessingConfiguration.onUpdateParameters.add(this._updateGammaSpace)
+            this._imageProcessingConfigChangeObserver = scene.imageProcessingConfiguration.onUpdateParameters.add(() => {
+                this._updateGammaSpace
+            });
 
             this.onBeforeRenderObservable.add(() => {
                 Matrix.ReflectionToRef(this.mirrorPlane, this._mirrorMatrix);