Jump to content

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


supersoupcan
 Share

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.

.blender_tileset.png.b1cb5f0946d75a24a9d93506be50fb68.pngblender_exampleScene.png.40fa6d043e0d6c532b1f5f340af49969.png

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

render_tileSet.png.27d2e7e9f530f2cebf0485075f1bc638.pngrender_generator.png.499ebd575dda77419985500b0bcdc977.png

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

sLouM4Y.gif

and as the exporter log says:

Quote

        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",
           [...]
            "diffuseTexture":
            {
                "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

bpy.context.active_object.data.uv_layers[0].name

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

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