joestrong Posted May 3, 2016 Share Posted May 3, 2016 Hi I've exported a blender scene as a .babylon file. I'm able to load the scene, including materials with colour, however I can't get my bump map (using normal mapping) to work. When I try it I can see that chrome's dev tools has loaded the normal map png file, however I don't see any bump in the scene/mesh. I'm new to Babylon.js and Blender, so it's possible I may have made a silly error somewhere. I've attached the .babylon, .png, and .blend file just in case. Any help really appreciated! normals-babylon.zip Quote Link to comment Share on other sites More sharing options...
JCPalmer Posted May 3, 2016 Share Posted May 3, 2016 Looking at your blend file, you assigned 4 materials to Plane (Grass, Snow, Sand, & Westeros). Grass, snow, & sand are just a diffuse color, and they all have areas / vertices assigned. This results in a multi-materials, which displays as you saw. The 4th material, Westeros, with the Bump texture, has no area assigned. Based on the similarity of shape, you want to apply the bump across the whole plane. This is not going to work as is. A single Babylon standard material, has various colors difuse, ambient, etc. It also can have a number of textures applied. You either need to break up your bump map texture into 3, and apply each to the grass, snow, & sand. Or, bake the grass, snow, & sand into a diffuse texture, then create a single material with the 2 textures. I am not the one to direct you, but the 2 texture / single BJS material would perform better. gryff 1 Quote Link to comment Share on other sites More sharing options...
joestrong Posted May 3, 2016 Author Share Posted May 3, 2016 Thank you! I'll give this a try! Quote Link to comment Share on other sites More sharing options...
lesterhaus Posted May 3, 2016 Share Posted May 3, 2016 Hey! Mr Palmer beat me to an answer, so I delete most of what i wrote ... and just focus on the part of the westeros.babylon file which causes your problem "subMeshes":[{"materialIndex":0,"verticesStart":0,"verticesCount":165,"indexStart":0,"indexCount":642},{"materialIndex":1,"verticesStart":165,"verticesCount":110,"indexStart":642,"indexCount":396},{"materialIndex":3,"verticesStart":275,"verticesCount":21,"indexStart":1038,"indexCount":60},{"materialIndex":3,"verticesStart":296,"verticesCount":0,"indexStart":1098,"indexCount":0}] he Plane mesh has 4 subMeshes. The last one, which is the one with the multimatID 3 (which also has the bumpmap) has neither a vertexCount nor an indexCount. Without fixing the whole subMeshes I just tested by assigning the mutlimatID3 to the 3rd submesh and the bumpmap is being displayed just fine Love the wall up north btw Quote Link to comment Share on other sites More sharing options...
joestrong Posted May 3, 2016 Author Share Posted May 3, 2016 Thank you lesterhaus! Hehe, I'm making a mini westeros map Put this down to my lack of knowledge in 3D! Blender rendered it OK which confused me though Gonna go with a single material! Seems cleaner! Quote Link to comment Share on other sites More sharing options...
gryff Posted May 3, 2016 Share Posted May 3, 2016 Well looks like JC beat me to it too And he is dead right the normal map is in a material that is not assigned to any vertices. I just added a normal map to the sand material - nothing else. Result below in red border is new file in BJS sandbox. cheers, gryff Quote Link to comment Share on other sites More sharing options...
joestrong Posted May 3, 2016 Author Share Posted May 3, 2016 Wow, thanks for the input guys! Love the quick responses and activity in this forum! Gryff, is that Windows Xp? P.S. I got this working now with 1 Material, thanks everyone! Quote Link to comment Share on other sites More sharing options...
gryff Posted May 5, 2016 Share Posted May 5, 2016 Quote Gryff, is that Windows Xp? Yep Joe - my workhorse machine. I have a Win7 machine too on my desk - but the XP machine has lots of software installed (my local web server, video editing software, terrain editing software and 16 versions of Blender. I'm not doing all those installations on the Win7 machine. cheers, gryff 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.