Node Material Post Processes

Creating Post Processes with Node Materials

Starting with Babylon.js v4.2, you can now create post processes with the node material editor.

You need simply to change the mode to Post Process:

PostProcess choice

In this mode, the special block CurrentScreen corresponds to the frame buffer that will be passed to your post process when you use this material as a post process in a real scenario. You can load any texture you want, it's simply an helper for you to see how your post process will render in the end.

Some blocks are made unavailable in this mode (they are hidden from the block list), as they have no meaning: the mesh, particle and animation blocks.

When you have created your post process material in the NME, you can create a regular BABYLON.PostProcess instance by calling the NodeMaterial.createPostProcess method:

const postProcess = nodeMaterial.createPostProcess(camera);

You can also update an existing post process:

const myPostProcess = new BABYLON.PostProcess(...);

PG: NME Post Process Playground Example

As for regular node materials, you can access the blocks programmatically and change their values:

Base material: NME Post Process Base Node Material

Programmatically updated material: NME Post Process Base Material Modification