Преглед изворни кода

Merge pull request #6191 from sebavan/master

Fix vertex Alpha
David Catuhe пре 6 година
родитељ
комит
9336c84755
2 измењених фајлова са 8 додато и 4 уклоњено
  1. 2 2
      src/Layers/effectLayer.ts
  2. 6 2
      src/Shaders/glowMapGeneration.fragment.fx

+ 2 - 2
src/Layers/effectLayer.ts

@@ -507,7 +507,7 @@ export abstract class EffectLayer {
             this._effectLayerMapGenerationEffect = this._scene.getEngine().createEffect("glowMapGeneration",
             this._effectLayerMapGenerationEffect = this._scene.getEngine().createEffect("glowMapGeneration",
                 attribs,
                 attribs,
                 ["world", "mBones", "viewProjection",
                 ["world", "mBones", "viewProjection",
-                    "color", "morphTargetInfluences",
+                    "glowColor", "morphTargetInfluences",
                     "diffuseMatrix", "emissiveMatrix", "opacityMatrix", "opacityIntensity"],
                     "diffuseMatrix", "emissiveMatrix", "opacityMatrix", "opacityIntensity"],
                 ["diffuseSampler", "emissiveSampler", "opacitySampler"], join,
                 ["diffuseSampler", "emissiveSampler", "opacitySampler"], join,
                 undefined, undefined, undefined, { maxSimultaneousMorphTargets: morphInfluencers });
                 undefined, undefined, undefined, { maxSimultaneousMorphTargets: morphInfluencers });
@@ -664,7 +664,7 @@ export abstract class EffectLayer {
 
 
             this._effectLayerMapGenerationEffect.setMatrix("viewProjection", scene.getTransformMatrix());
             this._effectLayerMapGenerationEffect.setMatrix("viewProjection", scene.getTransformMatrix());
 
 
-            this._effectLayerMapGenerationEffect.setFloat4("color",
+            this._effectLayerMapGenerationEffect.setFloat4("glowColor",
                 this._emissiveTextureAndColor.color.r,
                 this._emissiveTextureAndColor.color.r,
                 this._emissiveTextureAndColor.color.g,
                 this._emissiveTextureAndColor.color.g,
                 this._emissiveTextureAndColor.color.b,
                 this._emissiveTextureAndColor.color.b,

+ 6 - 2
src/Shaders/glowMapGeneration.fragment.fx

@@ -14,12 +14,16 @@ varying vec2 vUVEmissive;
 uniform sampler2D emissiveSampler;
 uniform sampler2D emissiveSampler;
 #endif
 #endif
 
 
-uniform vec4 color;
+#ifdef VERTEXALPHA
+    varying vec4 vColor;
+#endif
+
+uniform vec4 glowColor;
 
 
 void main(void)
 void main(void)
 {
 {
 
 
-vec4 finalColor = color;
+vec4 finalColor = glowColor;
 
 
 // _____________________________ Alpha Information _______________________________
 // _____________________________ Alpha Information _______________________________
 #ifdef DIFFUSE
 #ifdef DIFFUSE