I’m trying to make a custom PBR shader for a project I’m working on because I don’t know how to append to Babylon’s PBR shaders, but how would I use Babylon’s glow layer in the shader to implement emissive maps.
(this isn’t needed at the moment but how would I also implement shadows?)
You can use a PBRCustomMaterial to leverage the existing PBR material and add custom code inside of it, or for even more freedom you can use the NME to create your material.
[EDIT]
Regarding shadows, I forgot you can use the new (in 4.2 ) ShadowDepthWrapper class to quickly support shadows in custom shaders!
Thanks for replying, I had no idea ShadowDepthWrapper or PBRCustomMaterial existed it would have saved me a lot of time! And the NME is very useful but the exported shader code doesn’t look so pretty so it’s hard to manage without going back to the editor every time.
As for the emissive map I was asking how to include the mesh that has the ShaderMaterial to the glow layer’s pass, and identifying the emissive map, but the scene isn’t even setup for that yet I was just asking ahead.