ShaderMaterial with gl_FragColor.a = 0.0 will not effect when the material.alpha equals 1.0

In shader material the needalphablending function is overriden with Babylon.js/shaderMaterial.ts at master · sebavan/Babylon.js · GitHub

so alpha < 1 should work and have the precedence here.

Your pg actually works

But you do not see anything cause your glFragColor is fully transparent so not the one from the material… you should either pass it in as part of the output color. (Here is a hardcoded pg just proving out the issue https://playground.babylonjs.com/#1OH09K#1570)

1 Like