Swiftwork Posted September 25, 2016 Share Posted September 25, 2016 Hi, I have ran into the issue that capped faces (CAP_START, CAP_END, CAP_ALL) will only display a diffuse color and not a texture http://www.babylonjs-playground.com/#RF9W9#370. The issue seems to persist at least on ExtrudedShapes and Tubes. My theory is that the face UVs aren't properly calculated. Anyone know of a solution or is this a bug? Kind Regards Swiftwork Quote Link to comment Share on other sites More sharing options...
JohnK Posted September 25, 2016 Share Posted September 25, 2016 It is all to do with extrusion keeping the number of vertices to a minimum and so shared normals and uvs among vertices. The texture is displayed on the caps however because of the way the uvs are shared you do get a small area (perhaps one pixel worth) shared across the cap. These explain in more detail: http://babylonjsguide.github.io/advanced/Custom http://babylonjsguide.github.io/advanced/Normals http://babylonjsguide.github.io/advanced/Facets If you are just using cuboids then the MeshBuilder method is preferable to build your box as this creates the boxes with separate faces and hence separate uvs For example http://www.babylonjs-playground.com/#RF9W9#372 (Note what is being subtracted from what is swapped in line 28 - can see why this way works in my PG but not why your way round in yours?) You might also like to check out https://doc.babylonjs.com/tutorials/Mesh_CreateXXX_Methods_With_Options_Parameter https://doc.babylonjs.com/tutorials/CreateBox_Per_Face_Textures_And_Colors jerome 1 Quote Link to comment Share on other sites More sharing options...
adam Posted September 25, 2016 Share Posted September 25, 2016 This is a bug with extrusion though, right? Quote Link to comment Share on other sites More sharing options...
Swiftwork Posted September 25, 2016 Author Share Posted September 25, 2016 Then it was as I expected @JohnK, I also found that it was easier using other parametric shapes and then scaling them up or down to get the same frame effect. @adam, I am suspecting it might be an oversight, but it might be a desired one for some, however I am not sure how ^^ Thank you for your help. 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.