Raanan Weber 7 سال پیش
والد
کامیت
a4fa24490f

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 4995 - 4995
dist/preview release/babylon.d.ts


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 20 - 20
dist/preview release/babylon.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 30 - 4
dist/preview release/babylon.max.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 20 - 20
dist/preview release/babylon.worker.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 1914 - 1914
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.d.ts


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 13 - 13
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 30 - 4
dist/preview release/customConfigurations/minimalGLTFViewer/babylon.max.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 30 - 4
dist/preview release/customConfigurations/minimalGLTFViewer/es6.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 30 - 4
dist/preview release/es6.js


تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 30 - 4
dist/preview release/viewer/babylon.viewer.max.js


+ 18 - 2
src/Layer/babylon.effectLayer.ts

@@ -372,6 +372,18 @@
                 defines.push("#define NUM_BONE_INFLUENCERS 0");
             }
 
+            // Morph targets         
+            var manager = (<Mesh>mesh).morphTargetManager;
+            let morphInfluencers = 0;
+            if (manager) {
+                if (manager.numInfluencers > 0) {
+                    defines.push("#define MORPHTARGETS");
+                    morphInfluencers = manager.numInfluencers;
+                    defines.push("#define NUM_MORPH_INFLUENCERS " + morphInfluencers);
+                    MaterialHelper.PrepareAttributesForMorphTargets(attribs, mesh, {"NUM_MORPH_INFLUENCERS": morphInfluencers });
+                }
+            }            
+
             // Instances
             if (useInstances) {
                 defines.push("#define INSTANCES");
@@ -387,8 +399,9 @@
                 this._cachedDefines = join;
                 this._effectLayerMapGenerationEffect = this._scene.getEngine().createEffect("glowMapGeneration",
                     attribs,
-                    ["world", "mBones", "viewProjection", "diffuseMatrix", "color", "emissiveMatrix"],
-                    ["diffuseSampler", "emissiveSampler"], join);
+                    ["world", "mBones", "viewProjection", "diffuseMatrix", "color", "emissiveMatrix", "morphTargetInfluences"],
+                    ["diffuseSampler", "emissiveSampler"], join,
+                    undefined, undefined, undefined, { maxSimultaneousMorphTargets: morphInfluencers });
             }
 
             return this._effectLayerMapGenerationEffect.isReady();
@@ -558,6 +571,9 @@
                     this._effectLayerMapGenerationEffect.setMatrices("mBones", mesh.skeleton.getTransformMatrices(mesh));
                 }
 
+                // Morph targets
+                MaterialHelper.BindMorphTargetParameters(mesh, this._effectLayerMapGenerationEffect);
+
                 // Draw
                 mesh._processRendering(subMesh, this._effectLayerMapGenerationEffect, Material.TriangleFillMode, batch, hardwareInstancedRendering,
                     (isInstance, world) => this._effectLayerMapGenerationEffect.setMatrix("world", world));

+ 1 - 1
src/Lights/Shadows/babylon.shadowGenerator.ts

@@ -1107,7 +1107,7 @@
                     attribs,
                     ["world", "mBones", "viewProjection", "diffuseMatrix", "lightData", "depthValues", "biasAndScale", "morphTargetInfluences"],
                     ["diffuseSampler"], join,
-                undefined, undefined, undefined, { maxSimultaneousMorphTargets: morphInfluencers });
+                    undefined, undefined, undefined, { maxSimultaneousMorphTargets: morphInfluencers });
             }
 
             if (!this._effect.isReady()) {

+ 1 - 1
src/Mesh/babylon.mesh.ts

@@ -187,7 +187,7 @@
 
                 // Deep copy
                 Tools.DeepCopy(source, this, ["name", "material", "skeleton", "instances", "parent", "uniqueId", 
-                                              "source", "metadata", "hasLODLevels", "geometry", "isBlocked"], 
+                                              "source", "metadata", "hasLODLevels", "geometry", "isBlocked", "areNormalsFrozen"], 
                                               ["_poseMatrix", "_source"]);
 
                 // Metadata

+ 8 - 2
src/Shaders/glowMapGeneration.vertex.fx

@@ -3,6 +3,9 @@ attribute vec3 position;
 
 #include<bonesDeclaration>
 
+#include<morphTargetsVertexGlobalDeclaration>
+#include<morphTargetsVertexDeclaration>[0..maxSimultaneousMorphTargets]
+
 // Uniforms
 #include<instancesDeclaration>
 
@@ -30,14 +33,17 @@ attribute vec2 uv2;
 
 void main(void)
 {
+	vec3 positionUpdated = position;
+
+#include<morphTargetsVertex>[0..maxSimultaneousMorphTargets]
 #include<instancesVertex>
 #include<bonesVertex>
 
 #ifdef CUBEMAP
-	vPosition = finalWorld * vec4(position, 1.0);
+	vPosition = finalWorld * vec4(positionUpdated, 1.0);
 	gl_Position = viewProjection * finalWorld * vec4(position, 1.0);
 #else
-	vPosition = viewProjection * finalWorld * vec4(position, 1.0);
+	vPosition = viewProjection * finalWorld * vec4(positionUpdated, 1.0);
 	gl_Position = vPosition;
 #endif