Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
material.emissiveColor = new Color3(0.5, 0.5, 0.5);
material.alpha = 0.2;
material.specularPower = 16;
// Fresnel
material.reflectionFresnelParameters = new FresnelParameters();
material.reflectionFresnelParameters.bias = 0.1;
material.emissiveFresnelParameters = new FresnelParameters();
material.emissiveFresnelParameters.bias = 0.6;
material.emissiveFresnelParameters.power = 4;
material.emissiveFresnelParameters.leftColor = Color3.White();
material.emissiveFresnelParameters.rightColor = Color3.Black();
material.opacityFresnelParameters = new FresnelParameters();
material.opacityFresnelParameters.leftColor = Color3.White();
material.opacityFresnelParameters.rightColor = Color3.Black();
if(index === 0){
this.logoTween.to(mesh.scaling, 2, { x: 4, y: 4, z: 4 })
this.logoTween.to(mesh.scaling, 2, { x: 2, y: 2, z: 2 })
this.logoTween.to(mesh.rotation, 1, { x: 1, y: 1, z: 1 })
this.logoTween.play();
}
mesh.material = material;
})
}
default: () => Color3.White().toColor4(),
};
var camera = new FreeCamera('camera1', new Vector3(0, 0.3, -0.7), scene)
camera.speed = 0.01
camera.minZ = 0.001
scene.activeCameras.push(camera)
camera.attachControl(canvas, true)
var light = new HemisphericLight('light1', new Vector3(0, 1, 0), scene)
light.intensity = 0.7
var pbr = new PBRMetallicRoughnessMaterial('pbr', scene)
pbr.environmentTexture = CubeTexture.CreateFromPrefilteredData('assets/textures/environment.dds', scene)
var gridSize = 4
for (var i = 0; i < gridSize; i++) {
for (var j = 0; j < 10; j++) {
var sphereMat = pbr.clone()
sphereMat.metallic = 0.1
sphereMat.roughness = (i / gridSize) / 3
sphereMat.baseColor = Color3.White().scale(1 - (j / 10))
var sphere = Mesh.CreateSphere('sphere', 16, 0.2, scene)
sphere.material = sphereMat
sphere.position.y = i * 0.3
sphere.position.x = 0.3
sphere.position.z = j * 0.4
var cubeMat = pbr.clone()
cubeMat.metallic = 0.6
cubeMat.roughness = (i / gridSize) / 3
cubeMat.baseColor = Color3.White().scale(1 - (j / 10))
var box = Mesh.CreateBox('box', 0.2, scene)
box.material = cubeMat
box.position.y = i * 0.3
box.position.x = -0.3
box.position.z = j * 0.4
}