Jump to content

Anyone discovered how the splatmapping works?


KarelAnker
 Share

Recommended Posts

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);
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...