Incorrect display of glb model

Hello, I load the glb model on the page, everything is displayed normally.
But when I try to load it into the game, I get this result. help me please
I use this code here. babylon js and babylonjs-loaders installed via npm


Which result did you get? Errors in the console?

No, there are no errors in the console. The result is shown in the third picture.Something similar to what was in this post, the model is black, apparently due to the lack of light, but these are trifles. Wrong export babylon sandbox

Did you make sure to add environment ? This is mandatory when using gltf because of PBR materials

You can use shortcuts like here though:

1 Like

Created, the result is almost the same, only some colors appeared. I combine Babylon.js and Pixi.js. And for some reason, now this flag does not work this.scene.autoClear = false; I can throw off the glb file so that you try downloading it from yourself.

Please create a playground to show us the problem :slight_smile:
We are shooting in the dark here without having a repro

ok, I’m trying)

I can share the code through ngrok, I tried to build the application in codesandbox but the model from the remote resource is not loaded there. By the way, the model without combining with pixijs loads fine, and only when I need to combine scenes do problems arise

Please rebuilt it in the playground (you can use that doc to load external assets: Using External Assets - Babylon.js Documentation)

1 Like
Hi) The first time it does not start, you need to click the start button. That’s something like this it works for me)

It works when you comment the line:

if (pixiRenderer) pixiRenderer.render(stage);

So there’s a conflict between PIXI and Babylon, but I can’t tell more, I don’t know what PIXI is doing.

Note that as soon as your display is screwed up, even commenting the line won’t make the playground works! You have to reload the page and comment the line before starting the replay.

Also, you get an error the first time because you should wait for the script to be loaded before trying to access PIXI.


Useful notes, thanks)
Fixed the error “PIXI not defined”

This is not a problem with pixi:

glb file seems broken:

Why? I followed the links and I have a model, and there and there it was successfully displayed

Pinging @bghgary for more info

1 Like

Thank ) - Candle is better, but looks very strange while moving it.

Babylon logo cube

There is definitely some conflict between rendering scripts, cannot say more at the moment.

1 Like


The glb has vertex colors which are being multiplied with the material’s base color.

Turning off vertex colors makes it look right.

It looks like this model was converted from an FBX using FBX2glTF. As FBX is not always well-specified how attributes are supposed to be interpreted, it’s not FBX2glTF’s fault either. I suggest fixing the source FBX to not include vertex colors.

1 Like