Issues lighting a blender exported model with baked texture

I export a blender model with a shader that gets baked to a texture,
and I load it successfully in babylon.js

issue is the lighting.

if I use
var environment = scene.createDefaultEnvironment({
createGround: false,
enableGroundShadow: false,
groundYBias: 1,
groundOpacity: 0.5,
});

then I can see the texture applied to the model, great. But I want to light it better. So I add lights like:

var light = new PointLight(“pointLight”, new Vector3(50, 333, 1), scene);
light.diffuse = new Color3(1, 1, 1);
light.specular = new Color3(0, 0, 0);
light.intensity = 10000000;

but the light behaves very strangely and only if I put a super high intensity I can see something.
Also If I give it a neutral color, it colors the entire object so I don’t see its texture properly anymore.

If instead I don’t use the createdefaultenvironment line, then similar thing happens.

the question is, how can I bring more neutral light/brightness to different parts of my model without changing
the colors that the applied texture is giving it?

If I choose a light with neutral color it just gets rid of the color in the texture

thank you

(issues lighting a blender exported model with baked texture)

Lights are exported from Blender. You can also isolate what mesh(es) a light will use by placing the light / meshes combo in the same Blender collection. There is a custom checkbox exporter property for lights called ‘This collection Only’. When checked the extra light only shines on those meshes.

FYI, this has nothing to due with whether a material is baked by the exporter or not.

1 Like

mmm very interesting,
because so far i didnt notice lights exported appearing in babylon, maybe because they were not inside the collection, will give it a try now again

yes I notice a difference now, but lights exported seem to behave very differently in babylon.js, like they need tons of extra power and then they dont behave in the same way, I think the best seems to be not to export the lights and light it in babylon directly,

the other thing that i am finding is that I have some texts in blender that i want to export, so i convert them all to meshes, and I am finding strange things happening, say i have 5 identical texts converted to meshes, well maybe 2 will appear perfect in babylon and one just wont appear at all (even though the mesh appears in the scene object)