浏览代码

Merge pull request #6610 from mkmc/master

Fix check for material needing alpha blending in OutlineRenderer
David Catuhe 6 年之前
父节点
当前提交
18aed4afb8
共有 2 个文件被更改,包括 3 次插入2 次删除
  1. 1 0
      dist/preview release/what's new.md
  2. 2 2
      src/Rendering/outlineRenderer.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -106,6 +106,7 @@
 - Make planeDragGizmo usable on its own ([TrevorDev](https://github.com/TrevorDev))
 - Make planeDragGizmo usable on its own ([TrevorDev](https://github.com/TrevorDev))
 - Fix useObjectOrienationForDragging for pointerDragBehavior when using a single axis drag ([TrevorDev](https://github.com/TrevorDev))
 - Fix useObjectOrienationForDragging for pointerDragBehavior when using a single axis drag ([TrevorDev](https://github.com/TrevorDev))
 - Fix VR button not positioning correctly in canvas ([haroldma](https://github.com/haroldma))
 - Fix VR button not positioning correctly in canvas ([haroldma](https://github.com/haroldma))
+- Fix check for material needing alpha blending in OutlineRenderer ([mkmc](https://github.com/mkmc))
 
 
 ## Breaking changes
 ## Breaking changes
 - Setting mesh.scaling to a new vector will no longer automatically call forceUpdate (this should be done manually when needed) ([TrevorDev](https://github.com/TrevorDev))
 - Setting mesh.scaling to a new vector will no longer automatically call forceUpdate (this should be done manually when needed) ([TrevorDev](https://github.com/TrevorDev))

+ 2 - 2
src/Rendering/outlineRenderer.ts

@@ -296,7 +296,7 @@ export class OutlineRenderer implements ISceneComponent {
         this._savedDepthWrite = this._engine.getDepthWrite();
         this._savedDepthWrite = this._engine.getDepthWrite();
         if (mesh.renderOutline) {
         if (mesh.renderOutline) {
             var material = subMesh.getMaterial();
             var material = subMesh.getMaterial();
-            if (material && material.needAlphaBlending) {
+            if (material && material.needAlphaBlending()) {
                 this._engine.cacheStencilState();
                 this._engine.cacheStencilState();
                 // Draw only to stencil buffer for the original mesh
                 // Draw only to stencil buffer for the original mesh
                 // The resulting stencil buffer will be used so the outline is not visible inside the mesh when the mesh is transparent
                 // The resulting stencil buffer will be used so the outline is not visible inside the mesh when the mesh is transparent
@@ -318,7 +318,7 @@ export class OutlineRenderer implements ISceneComponent {
             this.render(subMesh, batch);
             this.render(subMesh, batch);
             this._engine.setDepthWrite(this._savedDepthWrite);
             this._engine.setDepthWrite(this._savedDepthWrite);
 
 
-            if (material && material.needAlphaBlending) {
+            if (material && material.needAlphaBlending()) {
                 this._engine.restoreStencilState();
                 this._engine.restoreStencilState();
             }
             }
         }
         }