supersoupcan Posted November 12, 2018 Share Posted November 12, 2018 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. Quote Link to comment Share on other sites More sharing options...
supersoupcan Posted November 12, 2018 Author Share Posted November 12, 2018 Sorry I've only just now realized that this is not a straight forward question, but more of a bug. Should I re-post this in the bug forum? Quote Link to comment Share on other sites More sharing options...
Guest Posted November 12, 2018 Share Posted November 12, 2018 Pinging @JCPalmer Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted November 13, 2018 Share Posted November 13, 2018 Can you share your .blend too? I think issue come from material configuration. Quote Link to comment Share on other sites More sharing options...
supersoupcan Posted November 13, 2018 Author Share Posted November 13, 2018 Here is the .blend with the textures What would be a better approach? Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted November 14, 2018 Share Posted November 14, 2018 Some objects doesn't have materials, so of course there are not exported (ex: water_water_water.tile) Quote Link to comment Share on other sites More sharing options...
supersoupcan Posted November 14, 2018 Author Share Posted November 14, 2018 I'm not trying to export the objects in the first layer. I want to export the objects on the second layer which all have materials. Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted November 14, 2018 Share Posted November 14, 2018 OK. It seems this mesh was broken, so I attached it to a new Cube and it solved the issue Quote Link to comment Share on other sites More sharing options...
supersoupcan Posted November 14, 2018 Author Share Posted November 14, 2018 How do you find out if a mesh is broken? And how does attaching a Cube fix the issue? Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted November 14, 2018 Share Posted November 14, 2018 I just had a feeling, and I suppose attaching to a new primitive just made a kind of data cleaning/reset. Quote Link to comment Share on other sites More sharing options...
supersoupcan Posted November 14, 2018 Author Share Posted November 14, 2018 How would I replicate that precisely, because I tried joining the mesh with a Cube, and then deleting the added Cube, and the mesh was still broken in babylon.js. Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted November 14, 2018 Share Posted November 14, 2018 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: 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. supersoupcan 1 Quote Link to comment Share on other sites More sharing options...
supersoupcan Posted November 14, 2018 Author Share Posted November 14, 2018 Thanks for your help V!nc3r its working perfectly now! I guess the key takeaway is that blender uses keys to store UV references, while the Babylon.js exporter uses indices. Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted November 14, 2018 Share Posted November 14, 2018 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.