It seems that after the refactoring of PBR fragment shader code the order of
#define CUSTOM_FRAGMENT_... blocks inside of it got broken.
For example, now this block:
comes before that block:
So since custom uniforms have to be defined in the latter block, while being used in the first block, shader fails to compile with
FRAGMENT SHADER ERROR: undeclared identifier error.
Please check Babylon.js Playground for the reference. There’s an error with the latest version of BJS, while with v.4.1.0 everything works fine.