How to check if node-material build is ready?

Hi,

what is the correct way to check if a nodeMaterial was build and is ready to use? it seems like nodeMaterial.isReady() always returns false. for example here: https://playground.babylonjs.com/#9B0DNU#288 line 34 - the material should be ready by then right?)

Thanks a lot!

Hey there! isReady is a function used for non pushMaterial. This is a bit of a complex discussion but here is the summary:

  • A material (inheriting from PushMaterial) is cached per submesh. So the correct function to call would be isReadyForSubmesh
  • IsReady is meaningless for a PushMaterial as it needs information stored per submesh
  • For your case, I think you want to use mat.onBuildObservable

Thanks! i hope i can continue with this!

1 Like