addterrain.js 1.1 KB

12345678910111213141516171819
  1. window.prepareTerrain = function() {
  2. var terrain = new BABYLON.TerrainMaterial("terrain", scene);
  3. terrain.specularColor = new BABYLON.Color3(0.5, 0.5, 0.5);
  4. terrain.specularPower = 64;
  5. terrain.mixTexture = new BABYLON.Texture("/playground/textures/mixMap.png", scene);
  6. terrain.diffuseTexture1 = new BABYLON.Texture("/playground/textures/floor.png", scene);
  7. terrain.diffuseTexture2 = new BABYLON.Texture("/playground/textures/rock.png", scene);
  8. terrain.diffuseTexture3 = new BABYLON.Texture("/playground/textures/grass.png", scene);
  9. terrain.bumpTexture1 = new BABYLON.Texture("/playground/textures/floor_bump.PNG", scene);
  10. terrain.bumpTexture2 = new BABYLON.Texture("/playground/textures/rockn.png", scene);
  11. terrain.bumpTexture3 = new BABYLON.Texture("/playground/textures/grassn.png", scene);
  12. terrain.diffuseTexture1.uScale = terrain.diffuseTexture1.vScale = 10;
  13. terrain.diffuseTexture2.uScale = terrain.diffuseTexture2.vScale = 10;
  14. terrain.diffuseTexture3.uScale = terrain.diffuseTexture3.vScale = 10;
  15. return terrain;
  16. };