Browse Source

Transparent meshes are not displayed when calling geometryBufferRenderer customRenderFunction before rendering the scene

In my project since babylon 4.1 my transparent instances were not
rendered.

After some investigation if found that i was using a rendertarget that
renders my submeshes with this function.

As this function doesn't render the transparent meshes, those meshes
_internalAbstractMeshDataInfo._isActiveIntermediate property keep
containing true.

So when rendering the next frame, during Scene._evaluteActiveMeshes
those transparent instances are considered as style active when calling
InstancedMesh._activate().

This cause the meshes to not being dispatched in RenderingGroups and not
being rendered.

This fix work but you may take a closer look at the reason why only
alpha and opaque meshes were initially rendered.
Quentin LADEVIE 5 years ago
parent
commit
0f16c8fdd3
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/Rendering/geometryBufferRenderer.ts

+ 4 - 0
src/Rendering/geometryBufferRenderer.ts

@@ -431,6 +431,10 @@ export class GeometryBufferRenderer {
             for (index = 0; index < alphaTestSubMeshes.length; index++) {
                 renderSubMesh(alphaTestSubMeshes.data[index]);
             }
+
+            for (index = 0; index < transparentSubMeshes.length; index++) {
+                renderSubMesh(transparentSubMeshes.data[index]);
+            }
         };
     }