MarianG Posted November 9, 2017 Share Posted November 9, 2017 Hello. Let's explain my problem. I have an array of points. Tasks: 1. Create a mesh according to input points. It was simple, using CreateRibbon. 2. Add a material to mesh, according to input points height. I found a few option: - gradient Material - terrain Material - custom Material - or adding color property direct to the vertex data, like here http://www.babylonjs-playground.com/#VKBJN#104 https://playground.babylonjs.com/#NLV5X5#4 Personally, I prefer last option, but I don't understand to good how colors works I am willing to try any option. . I feel like and idiot because I think it's not too complicate. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 9, 2017 Share Posted November 9, 2017 Hello I'm with you. Vertex color is the best option here. You can add face color easily to the ribbon: http://doc.babylonjs.com/how_to/createbox_per_face_textures_and_colors#colors Quote Link to comment Share on other sites More sharing options...
MarianG Posted November 9, 2017 Author Share Posted November 9, 2017 Huh, I deal with it. But I have a new problem. The mesh is single sided. I have to add a material with backFaceCulling set to false if I want my mesh to be double sided (line 79), although I set it as double sided when I created it.(line 57). https://playground.babylonjs.com/#NLV5X5#5 Quote Link to comment Share on other sites More sharing options...
Gijs Posted November 9, 2017 Share Posted November 9, 2017 @bulisor You have "BABYLON.DOUBLESIDE", which should be "BABYLON.Mesh.DOUBLESIDE" MarianG 1 Quote Link to comment Share on other sites More sharing options...
MarianG Posted November 9, 2017 Author Share Posted November 9, 2017 That was. Thank you, Today wasn't my lucky day Quote Link to comment Share on other sites More sharing options...
MarianG Posted November 10, 2017 Author Share Posted November 10, 2017 Hi. I know I marked it as solved but I have one more question on this subject. :))) https://playground.babylonjs.com/#NLV5X5#6 If I use a standard material on ribbon, it keeps the colors previously set. But if i set a grid material it loses its settings. Can I force it to keep colors, or I have to modify grid shader? Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted November 10, 2017 Share Posted November 10, 2017 Unfortunately the grid material does not support vertex colors 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.