The ShaderMaterial
is not really meant to be used with lights, see
It is in the context of trying to use the code generated by “Generate code” in the NME, but the explanations regarding the ShaderMaterial
not supporting lights is what matters.
You should try to use a node material instead, if you want to support the standard lights from Babylon.
Another possibility is to use a CustomMaterial
, which is a wrapper around StandardMaterial
and lets you inject some custom code at some specific parts of the shader (you also have PBRCustomMaterial
as a wrapper for PBRMaterial
).