Jelajahi Sumber

Merge pull request #3404 from julien-moreau/master

Good setState for geometry renderer (used by SSAO2 and StandardRender…
David Catuhe 7 tahun lalu
induk
melakukan
81f5491d11

+ 17 - 1
src/Particles/babylon.particleSystem.ts

@@ -672,6 +672,15 @@
             serializationObject.customShader = this.customShader;
             serializationObject.preventAutoStart = this.preventAutoStart;
 
+            serializationObject.startSpriteCellID = this.startSpriteCellID;
+            serializationObject.endSpriteCellID = this.endSpriteCellID;
+            serializationObject.spriteCellLoop = this.spriteCellLoop;
+            serializationObject.spriteCellChangeSpeed = this.spriteCellChangeSpeed;
+            serializationObject.spriteCellWidth = this.spriteCellWidth;
+            serializationObject.spriteCellHeight = this.spriteCellHeight;
+
+            serializationObject.isAnimationSheetEnabled = this._isAnimationSheetEnabled;
+
             return serializationObject;
         }
 
@@ -684,7 +693,7 @@
                 var defines: string = (program.shaderOptions.defines.length > 0) ? program.shaderOptions.defines.join("\n") : "";
                 custom = scene.getEngine().createEffectForParticles(program.shaderPath.fragmentElement, program.shaderOptions.uniforms, program.shaderOptions.samplers, defines);
             }
-            var particleSystem = new ParticleSystem(name, parsedParticleSystem.capacity, scene, custom);
+            var particleSystem = new ParticleSystem(name, parsedParticleSystem.capacity, scene, custom, parsedParticleSystem.isAnimationSheetEnabled);
             particleSystem.customShader = program;
 
             if (parsedParticleSystem.id) {
@@ -744,6 +753,13 @@
             particleSystem.textureMask = Color4.FromArray(parsedParticleSystem.textureMask);
             particleSystem.blendMode = parsedParticleSystem.blendMode;
 
+            particleSystem.startSpriteCellID = parsedParticleSystem.startSpriteCellID;
+            particleSystem.endSpriteCellID = parsedParticleSystem.endSpriteCellID;
+            particleSystem.spriteCellLoop = parsedParticleSystem.spriteCellLoop;
+            particleSystem.spriteCellChangeSpeed = parsedParticleSystem.spriteCellChangeSpeed;
+            particleSystem.spriteCellWidth = parsedParticleSystem.spriteCellWidth;
+            particleSystem.spriteCellHeight = parsedParticleSystem.spriteCellHeight;
+
             if (!particleSystem.preventAutoStart) {
                 particleSystem.start();
             }

+ 2 - 0
src/PostProcess/RenderPipeline/Pipelines/babylon.standardRenderingPipeline.ts

@@ -99,6 +99,8 @@
         private _hdrCurrentLuminance: number = 1.0;
 
         private _floatTextureType: number;
+
+        @serialize()
         private _ratio: number;
 
         // Getters and setters

+ 1 - 1
src/Rendering/babylon.geometryBufferRenderer.ts

@@ -144,7 +144,7 @@ module BABYLON {
                 }
 
                 // Culling
-                engine.setState(material.backFaceCulling);
+                engine.setState(material.backFaceCulling, 0, false, scene.useRightHandedSystem);
 
                 // Managing instances
                 var batch = mesh._getInstancesRenderList(subMesh._id);