Node Materials not compiling in 4.2.beta14

I have updated to the latest preview version of babylonjs, since it contains some updates to CSM that I wanted to try out.
But currently I am not able to get my app to work, since node materials are not compiling correctly. Strangely, I can easily load them through as well as playground. But when I start my app, it says:

Uncaught (in promise) TypeError: block is undefined
and points to this line of code: Babylon.js/nodeMaterial.ts at 3b397b7cc910917fdedfaf413b9a44afd7a59b4c · BabylonJS/Babylon.js · GitHub

When I create a new nme material, it also complains and the resulting material in the nme is empty:

Uncaught TypeError: Cannot read property 'World' of undefined

@dennemark are there any simple ways for us to repro ???

@Evgeni_Popov would you wind having a quick look ?

I could protect it but not sure it is the right approach here what do you think ?

Are you using PBR blocks in your node material?

There has been some breaking changes lately due to PBR (re)design…

Hey! I guess this must be it! I will try to research it! Just realised that the online nme version now is running beta14, too. I think earlier today it was 13, if I am not mistaken. Now my material is complaining, too, in the online nme.

Update: Yes, the new PBR node was the issue. I think it is mostly, because the reflectivity node is not existent anymore. So a workaround is currently, to find the reflectivity and pbr block inside of the json and delete them as well as their position. Afterwards place a new pbr material inside and connect the missing links.


Yes, sorry for this, we simplified the PBR blocks quite a bit and we think it’s clearer now but it’s a breaking change for some people (we still did it because it’s a new feature in 4.2 and 4.2 is not released yet).

1 Like