KarelAnker Posted November 24, 2015 Share Posted November 24, 2015 https://github.com/BabylonJS/Babylon.js/tree/master/materialsLibrary/materials/terrain Haven't found out how it works, there's not really any documentation about it. Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted November 24, 2015 Share Posted November 24, 2015 Hello KarelAnker, You are right, I'm writing the documentation with a playground example. For now, you can use this commented code:// Create materialvar terrain = new BABYLON.TerrainMaterial("terrain", scene);// Set specular colorterrain.specularColor = new BABYLON.Color3(0.5, 0.5, 0.5);terrain.specularPower = 64;// Set the mix texture (RGB). Each color channel represents the intensity of the following// diffuse textures (R: diffuseTexture1, G: diffuseTexture2, B: diffuseTexture3)// Such as https://github.com/BabylonJS/Babylon.js/blob/master/materialsLibrary/test/textures/mixMap.pngterrain.mixTexture = new BABYLON.Texture("textures/mixMap.png", scene);// Set the 3 diffuse textures (required)terrain.diffuseTexture1 = new BABYLON.Texture("textures/grass.png", scene); // Red, grass textureterrain.diffuseTexture2 = new BABYLON.Texture("textures/rock.png", scene); // Green, rock textureterrain.diffuseTexture3 = new BABYLON.Texture("textures/floor.png", scene); // Blue, floor texture// Add bump maps (not required)terrain.bumpTexture1 = new BABYLON.Texture("textures/grassn.png", scene);terrain.bumpTexture2 = new BABYLON.Texture("textures/rockn.png", scene);terrain.bumpTexture3 = new BABYLON.Texture("textures/floor_bump.png", scene); Quote Link to comment Share on other sites More sharing options...
MarianG Posted November 24, 2015 Share Posted November 24, 2015 hi Luaacro. I made something similar, and I use 8 colors for mix 8 different textures. Take a look here . It's extremly beta version. So please, be patient ) And if you what you can expend your terrain material for using more colors. Vousk-prod. 1 Quote Link to comment Share on other sites More sharing options...
julien-moreau Posted November 29, 2015 Share Posted November 29, 2015 Hey bulisor, Great job! I'll have a look to the material and then, I think, fix the one in the materials library Thanks! 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.