BabylonJS Sandbox - Texture cannot be displayed

Hi

I exported the glTF file of the model in 3dsmax, and then dragged it to the sandbox, the textures were not displayed at all, but the Textrue files did exist.

How can I dispaly all textures?

Files:
image

sandbox:

Hi. Drag and drop all exported files with textures to sandbox or export to glb

Thank you,but I have dragged all the files with Textures to the sandbox,all the pictures of textures are included,but none of them can be displayed. :sweat:

Have you tried to export a glb file instead?

Seems that your textures have wrong relative URL in GLTF file (or you drop them to Sandbox with wrong relative URLS). They exist in file but links to them are incorrect.
Do you drop them into Sandbox retaining the same directory structure as it is in GLTF file? I mean, if they are in Textures folder, for example, you need to drop all this folder into Sandbox.
Or use GLB format, where all assets are packed into one binary file.

1 Like

Yes,I have tried,but it didn’t work,If it was imported correctly, the URL of the texture is not empty, right?

I put all the exported files in the same folder, including bin file, models and all texture pictures, and then named the folder demo2(as shown in my question).

But when I dragged the demo2 folder directly into the sandbox, the error was reported as follows:

Then I chose to import the files, opened the demo2 folder and selected all, I can successfully import, but the textures can not be displayed. Did my import process cause the wrong relative URLS?

After the file was imported, I got an error: Your file has some validation issues.

also,textures cannot be displayed, URLS were empty

I have tried GLB format, I can successfully drag and drop the demo2-glb folder, but the textures were also not displayed,so did URLS.

You may check if URIs of your textures are correct if you open GLTF file in some text editor
Below there is is screenshot from a GLTF file.

These are my URLs of textures:
image

and these are my file directory,5 files are included in demo2 folder:
image

  • image

Do you have any console errors when loading this file?

Yes ,I didn’t notice before

Can you provide the .glb file so that we can have a look?

Yes
demo-glb.zip (91.6 KB)

There are some validation issues with your file:

      {
        "code": "MESH_PRIMITIVE_TOO_FEW_TEXCOORDS",
        "message": "Material is incompatible with mesh primitive: Texture binding '/materials/1/pbrMetallicRoughness/baseColorTexture' needs 'TEXCOORD_0' attribute.",
        "severity": 0,
        "pointer": "/meshes/1/primitives/0/material"
      },
      {
        "code": "MESH_PRIMITIVE_TOO_FEW_TEXCOORDS",
        "message": "Material is incompatible with mesh primitive: Texture binding '/materials/1/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform' needs 'TEXCOORD_0' attribute.",
        "severity": 0,
        "pointer": "/meshes/1/primitives/0/material"
      },
      {
        "code": "MESH_PRIMITIVE_TOO_FEW_TEXCOORDS",
        "message": "Material is incompatible with mesh primitive: Texture binding '/materials/2/pbrMetallicRoughness/baseColorTexture' needs 'TEXCOORD_0' attribute.",
        "severity": 0,
        "pointer": "/meshes/2/primitives/0/material"
      },
      {
        "code": "MESH_PRIMITIVE_TOO_FEW_TEXCOORDS",
        "message": "Material is incompatible with mesh primitive: Texture binding '/materials/2/pbrMetallicRoughness/baseColorTexture/extensions/KHR_texture_transform' needs 'TEXCOORD_0' attribute.",
        "severity": 0,
        "pointer": "/meshes/2/primitives/0/material"
      },

It seems you don’t have any uv coordinates in your meshes or they have not been correctly generated in the file.

1 Like

I have solved this problem, it was all my fault, I didn’t define UV map so textures cannot be mapped correctly :sweat_smile:

1 Like