I’m testing out exporting cameras/lights from Blender to BabylonJS as a .glb file and everything gets exported out properly but there is a fairly big difference in the lighting in BabylonJS. Here is what the scene looks like in Blender (2.9):
I’m using a sun light in Blender, which I assume would be used as a directional light in BabylonJS. Cycles is what I’m using for the Render Engine. When I export this out using no other lighting this is what I see in BabylonJS:
The lighting looks like it’s washing out the colors of the bust and I’m wondering if I need to adjust anything within BabylonJS to better represent the same lighting. Do I need to adjust the color space? or light settings in BabylonJS?
I am planning on baking the lighting anyways but wanted to see how exporting lights would work with this current scene.
Cycles will look very different because it’s factoring in direct and indirect lighting. Eevee will be closer to Babylon.js but still not the same. Is there a default HDR environment enabled in your Blender scene? If so you could disable that or use that in your Babylon.js scene to get the lighting closer. Even the rotation of HDRs can make a huge difference to lighting, so you’ll need to ensure that also matches between your Blender and Babylon.js scenes.
But yes, baking is your best option if you want the lighting to match.
Thanks, yeah I figure it won’t look the same but it’s a vastly different look in Babylon. I haven’t set up any HDR environments in Blender, I just wanted to test out exporting lights to see what it would look like.
If I created a directional light with the same settings in BabylonJS directly would it look any different? I wanted to use this as an example of why you would want to use baked lighting but I also want to make sure I’m not missing anything relevant that would improve the lighting quality when importing lights from Blender.
Well you’d certainly get those missing specular highlights, but you won’t get shadows or self-shadowing by default, so you’d have to add those in code.