Incorrect display of glb model

Hello, I load the glb model on the sandbox.babylonjs.com 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


girl%20err

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:
https://www.babylonjs-playground.com/#BVK9I0#13

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

https://www.babylonjs-playground.com/#1QJHY3
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.

2 Likes

Useful notes, thanks)

https://www.babylonjs-playground.com/#1QJHY3#6
Fixed the error “PIXI not defined”

This is not a problem with pixi:
https://www.babylonjs-playground.com/#1QJHY3#7

glb file seems broken:
https://www.babylonjs-playground.com/#1QJHY3#8

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 )

https://www.babylonjs-playground.com/#1QJHY3#9 - Candle is better, but looks very strange while moving it.

Babylon logo cube https://www.babylonjs-playground.com/#1QJHY3#10

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

1 Like

Thank)

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

Turning off vertex colors makes it look right.
https://www.babylonjs-playground.com/#1QJHY3#11

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