Pārlūkot izejas kodu

Fixed outlineRenderer with alpha

David Catuhe 8 gadi atpakaļ
vecāks
revīzija
44ffd8cdba

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 559 - 559
dist/preview release/babylon.d.ts


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3 - 3
dist/preview release/babylon.js


+ 5 - 5
dist/preview release/babylon.max.js

@@ -20419,6 +20419,10 @@ var BABYLON;
             else if (!effectiveMaterial.isReady(this, hardwareInstancedRendering)) {
                 return this;
             }
+            // Alpha mode
+            if (enableAlphaMode) {
+                engine.setAlphaMode(effectiveMaterial.alphaMode);
+            }
             // Outline - step 1
             var savedDepthWrite = engine.getDepthWrite();
             if (this.renderOutline) {
@@ -20444,10 +20448,6 @@ var BABYLON;
             else {
                 effectiveMaterial.bind(world, this);
             }
-            // Alpha mode
-            if (enableAlphaMode) {
-                engine.setAlphaMode(effectiveMaterial.alphaMode);
-            }
             // Draw
             this._processRendering(subMesh, effect, fillMode, batch, hardwareInstancedRendering, this._onBeforeDraw, effectiveMaterial);
             // Unbind
@@ -63842,7 +63842,7 @@ var BABYLON;
             var material = subMesh.getMaterial();
             engine.enableEffect(this._effect);
             this._effect.setFloat("offset", useOverlay ? 0 : mesh.outlineWidth);
-            this._effect.setColor4("color", useOverlay ? mesh.overlayColor : mesh.outlineColor, useOverlay ? mesh.overlayAlpha : 1.0);
+            this._effect.setColor4("color", useOverlay ? mesh.overlayColor : mesh.outlineColor, useOverlay ? mesh.overlayAlpha : material.alpha);
             this._effect.setMatrix("viewProjection", scene.getTransformMatrix());
             // Bones
             if (mesh.useBones && mesh.computeBonesUsingShaders) {

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 559 - 559
dist/preview release/babylon.module.d.ts


Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 3 - 3
dist/preview release/babylon.worker.js


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

@@ -1123,6 +1123,11 @@
                 return this;
             }
 
+            // Alpha mode
+            if (enableAlphaMode) {
+                engine.setAlphaMode(effectiveMaterial.alphaMode);
+            }
+            
             // Outline - step 1
             var savedDepthWrite = engine.getDepthWrite();
             if (this.renderOutline) {
@@ -1152,11 +1157,6 @@
                 effectiveMaterial.bind(world, this);
             }
 
-            // Alpha mode
-            if (enableAlphaMode) {
-                engine.setAlphaMode(effectiveMaterial.alphaMode);
-            }
-
             // Draw
             this._processRendering(subMesh, effect, fillMode, batch, hardwareInstancedRendering, this._onBeforeDraw, effectiveMaterial);
 

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

@@ -23,7 +23,7 @@
 
             engine.enableEffect(this._effect);
             this._effect.setFloat("offset", useOverlay ? 0 : mesh.outlineWidth);
-            this._effect.setColor4("color", useOverlay ? mesh.overlayColor : mesh.outlineColor, useOverlay ? mesh.overlayAlpha : 1.0);
+            this._effect.setColor4("color", useOverlay ? mesh.overlayColor : mesh.outlineColor, useOverlay ? mesh.overlayAlpha : material.alpha);
             this._effect.setMatrix("viewProjection", scene.getTransformMatrix());
 
             // Bones