PBR Material doesn't update alpha under some circumstances

I’ve run into a strange problem with the alpha-value on PBR materials. It seems this affects only materials where transparencyMode is set to PBRMATERIAL_ALPHATESTANDBLEND.

If there is an opacityTexture active and alpha value is 1, and we then disable the opacityTexture by setting it to null, changes in alpha value don’t update the material anymore until the opacityTexture is set to a texture again.
If alpha is set to a value below 1 however, disabling the opacityTexture has no unexpected effect and alpha updates as expected.

I’ve supplied a minimal example in the playground at https://www.babylonjs-playground.com/#U9AC0N#87

Any info on this would be appreciated.

pinging @Sebavan

looks like a bug, I will fix it ASAP.

PR up this will be in the next nightly: Fix Alpha changes detection for dirty defines by sebavan · Pull Request #6523 · BabylonJS/Babylon.js · GitHub

Wow, that was fast. Thanks a lot!

We are fast :smiley: