Create a textured skybox in Babylon.js 2.0

Example of creating a textured skybox in Babylon.js 2.0
// Skybox - we create a skybox
	    var skybox = BABYLON.Mesh.CreateBox("skyBox", 100.0, scene);

//skybox.infiniteDistance = true; // <-- with this you can make the skybox of infinite size
	    
	    // create material for the skybox
	    var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene);
		    skyboxMaterial.backFaceCulling = false;
		    skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture("images/seabox/sea", scene);
		    skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
		    skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0);
		    skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
		    
		    skybox.material = skyboxMaterial;
		    
		    skybox.x = 1000;

Responses

0 Replies