I created a terrain with noise and wanted to change the material to the height of “y”.
I used BABYLON.MultiMaterial and the loop caught indices with “y” <1.5 as “WaterMaterial” else “StandardMaterial”
I get the error as pic attach. Does anyone have suggestions for me or give me examples to handle this problem?
I tried to fix the error in my code on Playground that no longer shows the error but the grid and multi-materials don’t show up, I don’t know where the problem is anymore.
After removing the following two lines of code I get the same error at the beginning
// matWater.addToRenderList(scene.getMeshByName(‘skyBox’));
// matWater.addToRenderList(scene.getMeshByName(‘ground’));
I am trying to create an automatic, non-duplicated automatic map algorithm with the sea, rivers, lakes, mountains, … distributing plants according to the natural height. But the best way to create mountains is to change the height of the ground net, if connecting multiple ground with many overlapping materials will make it more difficult for me.
Great, this is what I’m looking for. What method did you use to create it? Can you share important points to consider when implementing it as well as the difficulties you encounter when making it?
I have looked into your code but probably because I have just started learning babylon, there is a lot of reading that I don’t understand
ex: how do you locate and increase the height and change the material?
ex: this._effect = engine.createEffect("./Source_Clone/water",
[“position”, “normal”, “uv”],
[“worldViewProjection”, “world”, “view”, “vLightPosition”, “vEyePosition”, “waterColor”, “vLevels”, “waveData”, “windMatrix”],
[“reflectionSampler”, “refractionSampler”, “bumpSampler”],
“”);
I have read Amit’s article from this page http://www-cs-students.stanford.edu/~amitp/game-programming/polygon-map-generation/
It inspired me to make a game with a realistic map and never overlap without human intervention. But I had difficulty in doing Amit’s theory conversion because of babylon’s ground made of triangular mesh.
Do you have any ideas to help me create Polygonal Map Generation or another way to create all of them with triangular mesh BABYLON?
I think the first step is probably to get the code and play with it. I create a Ground material which is a custom shader. Maybe you can read the shader code to better understand how it works