Skip to content

Commit

Permalink
Merge pull request #146 from ux3d/fix/alhpaTransmission
Browse files Browse the repository at this point in the history
Change drawing order of transmissive and transparent objects
  • Loading branch information
UX3D-becher authored Feb 23, 2021
2 parents fd6a11d + f4cd6b1 commit 53571c5
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions source/Renderer/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,10 +242,6 @@ class gltfRenderer
{
this.drawPrimitive(state, drawable.primitive, drawable.node, this.viewProjectionMatrix);
}
for (const drawable of transparentDrawables)
{
this.drawPrimitive(state, drawable.primitive, drawable.node, this.viewProjectionMatrix);
}

// filter materials with transmission extension
let transmissionDrawables = drawables
Expand All @@ -256,6 +252,11 @@ class gltfRenderer
{
this.drawPrimitive(state, drawable.primitive, drawable.node, this.viewProjectionMatrix, this.opaqueRenderTexture);
}

for (const drawable of transparentDrawables)
{
this.drawPrimitive(state, drawable.primitive, drawable.node, this.viewProjectionMatrix);
}
}

// vertices with given material
Expand Down

0 comments on commit 53571c5

Please sign in to comment.