Error on NodeMaterial constructor call

Hi everyone,

I’ve been working with babylonjs NME for a simple water shader and exported it as waterMat.ts file. The scripts has no error at all but when executing, I got an error right at the declaration of the material :

Uncaught TypeError: Cannot read properties of undefined (reading 'imageProcessingConfiguration')

This error is called on the line where I create my NodeMaterial, like follow :
export var waterMat = new NodeMaterial("WaterMat");

To ensure this comes from the constructor I tried to remove everything from the code except the above line, which results in a simple script :

import { NodeMaterial } from "@babylonjs/core";
export var waterMat2 = new NodeMaterial("Water Material");;

and I still got the error. I’m a bit stuck here since the error seems to comes from source-code itself. But if there is a way around I’d love to know it :slight_smile:


(edit: typo)

Can you pass your scene in the NodeMaterial constructor ? (2nd parameter)

When I had the problem, passing the scene as argument in the constructor did not solve the problem.
However, it seems I do not have the problem anymore. I have no idea how I solved it but, well, it’s gone :man_shrugging:

Thanks for your reply anyway :slight_smile:


1 Like