浏览代码

Merge branch 'master' of https://github.com/BabylonJS/Babylon.js

David Catuhe 8 年之前
父节点
当前提交
9d0cc29d04

+ 1 - 0
.gitignore

@@ -23,6 +23,7 @@ proceduralTexturesLibrary/src/**/*.js
 postProcessLibrary/src/**/*.js
 canvas2D/src/**/*.js
 inspector/src/**/*.js
+serializers/src/**/*.js
 
 # Build results
 [Dd]ebug/

+ 1 - 1
Playground/debug.html

@@ -117,7 +117,7 @@
                 <li><a href="http://www.html5gamedevs.com/forum/16-babylonjs/">Forum</a></li>
                 <li><a href="https://babylonjs.azurewebsites.net/sandbox">Sandbox</a></li>
                 <li><a href="https://github.com/BabylonJS/Babylon.js/wiki">Wiki</a></li>
-                <li><a href="http://www.sokrate.fr/documentation/babylonjs/index.html">Documentation</a></li>
+                <li><a href="https://doc.babylonjs.com">Documentation</a></li>
             </ul>
         </div>
     </div>

+ 1 - 1
Playground/index-local.html

@@ -85,7 +85,7 @@
                 <li><a href="http://www.html5gamedevs.com/forum/16-babylonjs/">Forum</a></li>
                 <li><a href="http://www.babylonjs.com/sandbox">Sandbox</a></li>
                 <li><a href="https://github.com/BabylonJS/Babylon.js/wiki">Wiki</a></li>
-                <li><a href="http://www.sokrate.fr/documentation/babylonjs/index.html">Documentation</a></li>
+                <li><a href="https://doc.babylonjs.com">Documentation</a></li>
             </ul>
         </div>
     </div>

+ 1 - 1
Playground/index.html

@@ -116,7 +116,7 @@
                 <li><a href="http://www.html5gamedevs.com/forum/16-babylonjs/">Forum</a></li>
                 <li><a href="https://babylonjs.azurewebsites.net/sandbox">Sandbox</a></li>
                 <li><a href="https://github.com/BabylonJS/Babylon.js/wiki">Wiki</a></li>
-                <li><a href="http://www.sokrate.fr/documentation/babylonjs/index.html">Documentation</a></li>
+                <li><a href="https://doc.babylonjs.com">Documentation</a></li>
             </ul>
         </div>
     </div>

+ 14 - 16
src/Materials/Textures/babylon.renderTargetTexture.ts

@@ -241,6 +241,20 @@
                 return;
             }
 
+            // Set custom projection.
+            // Needs to be before binding to prevent changing the aspect ratio.
+            if (this.activeCamera) {
+                engine.setViewport(this.activeCamera.viewport);
+
+                if (this.activeCamera !== scene.activeCamera)
+                {
+                    scene.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(true));
+                }
+            }
+            else {
+                engine.setViewport(scene.activeCamera.viewport);
+            }
+
             // Prepare renderingManager
             this._renderingManager.reset();
 
@@ -304,22 +318,6 @@
                 }
             }
 
-            // Set states for projection (this does not change accross faces)
-            if (!this.isCube || faceIndex === 0) {            
-                if (this.activeCamera && this.activeCamera !== scene.activeCamera) {
-                    scene.setTransformMatrix(this.activeCamera.getViewMatrix(), this.activeCamera.getProjectionMatrix(true));
-                } else {
-                    scene.setTransformMatrix(scene.activeCamera.getViewMatrix(), scene.activeCamera.getProjectionMatrix(true));               
-                }
-
-                if (this.activeCamera) {
-                    engine.setViewport(this.activeCamera.viewport);
-                }
-                else {
-                    engine.setViewport(scene.activeCamera.viewport);
-                }
-            }
-
             this.onBeforeRenderObservable.notifyObservers(faceIndex);
 
             // Clear

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

@@ -1328,8 +1328,7 @@
                 this._overloadedIntensity.w = this.overloadedEmissiveIntensity;
                 this._effect.setVector4("vOverloadedIntensity", this._overloadedIntensity);
 
-                this.convertColorToLinearSpaceToRef(this.overloadedAmbient, this._tempColor);
-                this._effect.setColor3("vOverloadedAmbient", this._tempColor);
+                this._effect.setColor3("vOverloadedAmbient", this.overloadedAmbient);
                 this.convertColorToLinearSpaceToRef(this.overloadedAlbedo, this._tempColor);
                 this._effect.setColor3("vOverloadedAlbedo", this._tempColor);
                 this.convertColorToLinearSpaceToRef(this.overloadedReflectivity, this._tempColor);