Global Light Info in Custom Shader, similar to the Lights Node

Yes, it’s a bit involved, see #include directives in shader code output from Node Material Editor - #2 by Evgeni_Popov for more information.

The ShaderMaterial is not meant to be interfaced with lights. You should better use either a custom material, a node material or a material plugin (new in 5.0: Material Plugins | Babylon.js Documentation).

1 Like