How to use clustered lighting with PBR NME

Hey there!

I see clustered lighting has been merged in the engine recently Initial clustered lights implementation (tiled clustering only) by matanui159 · Pull Request #16866 · BabylonJS/Babylon.js · GitHub that’s amazing!

I looked at the doc and it works great for “classic” PBR materials.

However I tried using it with a PBR NME, and I thought it would result in identical shader code, but I instead got an error:

[11:27:02]: Offending line [784] in fragment code: {int sliceIndex=min(getClusteredSliceIndex(light0.vSliceData,vViewDepth),CLUSTLIGHT_SLICES-1);

Looks like the PBR node does not generate the shader code necessary for clustered lighting to work :thinking:

Is there a way I can make this work?

Clustered lights are not yet supported in node materials, but it’s coming soon!

2 Likes

Glad to know it’s coming! I will be patient then :slight_smile: