Expose NodeMaterial._buildWasSuccessful?

I’m adding glow effect, but materials in my case are loaded dynamically by some config files.
And in Babylon.js Playground, it gets block to register onBeforeRenderMeshToEffect.

So I can get that block after build (onBuildObservable), but cannot know it has been built then get the block directly.

After fiddle the source, I find there is a _buildWasSuccessful in NodeMaterial:

I’d like to expose this property, as .isBuilt or something like that.

However there’s a short circuit if in NodeMaterial's parent PushMaterial.isReady:

If it’s called without mesh, it always returns false. Is it intended?
Shouldn’t it be true after built?
And how can I get build state?

Yep it is intented as all PushMaterial are storing their data per mesh so the shader will also be recompiled per mesh if required

In your case the best option is to check mat.isReadyForSubMesh(mest, subMesh)

Thanks for your clarification!
It’s a little bit out of my sense :sweat_smile: I will dig into the code to understand them better.

Besides, I notice that mesh.dispose leaves its uniqueId in glowLayer._meshesUsingTheirOwnMaterials. Is it my duty to call unReferenceMeshFromUsingItsOwnMaterial before dispose the mesh?

Nope this is a bug
I’ll fix it!