Added an object to the gltf model as a child node and how set the object texture

I added an object to the gltf model as a child node and set the object texture.There is a problem with the picture display. After searching in the forum, set inverty to false

const myDynamicTexture = new Texture(src, scene,false, false)

Now some pictures are normal and some are abnormal. I don’t know how to deal with them
Find three JS has these materials

GLTFLoader will automatically configure textures referenced from a .gltf or .glb file correctly, with the assumption that the renderer is set up as shown above. When loading textures externally (e.g., using TextureLoader) and applying them to a glTF model, colorspace and orientation must be given:

`// If texture is used for color information, set colorspace.
texture.encoding = THREE.sRGBEncoding;

// UVs use the convention that (0, 0) corresponds to the upper left corner of a texture.
texture.flipY = false;`

What should I do in babylonjs

In addition, and I also found problems using

scene. useRightHandedSystem=true;

const myDynamicTexture = new Texture(src, scene,false, false)

All pictures are displayed normally, but gltf’s checkcollisions run incorrectly

invertY does the same thing as flipY on Three.
@sebavan @Deltakosh about the encoding, is there a way to set the colorspace of a texture?
About the useRightHandedSystem, which version are you using? There was a recent fix with collisions on a right handed scene: Fix camera collisions for RHS scenes with GLTF models by carolhmj · Pull Request #11707 · BabylonJS/Babylon.js (github.com)

1 Like

there is a useSRGBBuffer in the texture creation options and invertY should do the trick.

2 Likes

i use @babylonjs/core 4.2.0

After I used inverty, only some pictures are displayed normally, and some pictures are not displayed normally, and I can’t find the reason for the abnormal display
If it is not displayed normally, it looks like a flip along one (x or Z) coordinate

I now try to solve the problem of adding self elements to gltf in this way.
https://playground.babylonjs.com/#TRAIXW

It can also achieve the effect of converting gltf local coordinates into world coordinates, and then creating elements

Hello @qqqzhch just checking in, do you still have any issues?