Shader crash with OIT

Thanks so much Evgeni!
Will try your fix.

Hi Evgeni,
yes, your fix works in the playground - no, I doesn’t help in our project. I still get the same error. So, something else must trigger this copy block in the shader code.

Ah, too bad!

I think at this point I won’t be able to help without a repro, unfortunately.

Of course. I try to bring everything we do into to a playground case and let you know.

Found something:

This creates the same crash, even w/o SSRRenderingPipeline. BUT, when you change the timeout from 160 to 32 ms, it works. So 1 frames seem ok, >1 frames lead to this crash (my monitor makes 30hz).

Of course, your fix via Object.defineProperty(BABYLON.Material.prototype, “alpha”, {… helps, but perhaps this timing issue can point in the right direction?

In our project, we change mesh.visibilty a lot. So I created a playground and try to make the same fix for visibility as you did, but I’m not familiar enough with Babylon’s internals to do it right. Can you please have look?

Thanks!

In fact, that’s what my PR corrects, the material state was not reset properly when changing the alpha value after the OIT was activated (or deactivated after being activated).

will this cover the mesh.visibility part of the issue, too?

Sorry, I didn’t understand you were also using visibility!

There’s the same problem indeed, but it should be corrected like this:

Going to make another PR to update the visibility property too.

1 Like

This PR will fix it:

Thank you! Now, the project starts with OIT enabled.

1 Like