Jump to content

Textures not being rendered properly, babylon.js and blender exporter


Recommended Posts

Hello HTML game  devs. First time poster.

Some textures aren't appearing in babylon.js in a tile set I exported from blender using the Blender To Babylon 5.6 exporter.

Here is the tile set scene in blender, as well as a simple hand crafted scene built in blender using the tiles to give an idea of what the final product should look like.


Here is the default tile set scene imported into babylon.js as well as a scene generated by from my map-generation script.


Despite my horrible lighting,  it's clear the wall texture is not being rendered in all the models. Neither the exporter or babylon.js are generating any errors or warnings.

Here is an archive containing the .babylon file and textures
Here is the blender exporter log

I am new to 3D rendering and only have a basic understanding of Materials, Lighting, UV Maps and Textures, so if somebody could have a crack at it I'd really appreciate it.

Link to comment
Share on other sites

actually I was on the wrong track: some meshes share the same material, but some have UV use by "wall" material on first channel, others on the second, and other doesn't have second channel


and as the exporter log says:


        processing begun of Standard material:  wall
            Diffuse texture found "wall"
                Image texture found, type:  diffuseTexture, mapped using: "WallUV"

and I have also this in the .babylon:

    "materials": [
            "name": "hextiles_2_0.wall",
                "name": "wall.png",
                "coordinatesIndex": 1

As your mesh doesn't have two UV chans, coordinatesIndex = 1 can't work on it.

Link to comment
Share on other sites

Actually, Blender use indices too, but you can give a name to them.

For example, if you have an active object and type


in the console, you should read your first UV channel name. If you change the 0 by 1, you'll see the second UV channel name, etc. This index number is exactly the same than the coordinatesIndex one.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...