Problems loading babylon file with jpg texture

I exported successfully a model with a material from blender
and I get 4 files:

  • a babylon file
  • a jpg with the texture
  • a manifest file
  • and a text log file

then with javascript I perform a
function (scene) { etc etc

and the model loads well, I can see it, but black, without material,
and in javascript console I can see

index.js:1 BJS - [00:33:59]: Unable to load from ./models/m1/model.babylon: Error in onSuccess callback

what could be the reason?
thank you :slight_smile:

Hard to tell, you would need to setup a repro in the playground for us to be able to help.

thank you, It works now, there was an issue exporting from blender but now it works, my issue now is with lighting

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

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

You must have something wrong with your model or scene as it should work out of the box, a repro could tell.

However, your light intensity seems really too big, you should lower it. You can also try to use a directional light instead.

Lights are using real unities (see Mastering PBR Materials | Babylon.js Documentation), that’s why you may need to raise the values compared to the standard material that is not PBR.

1 Like