BabylonJS: Materials Cheat Sheet

Syntax

var materialforshapes = new BABYLON.StandardMaterial("texture1", scene);

Properties

Transparency

materialforbox.alpha = 0.5;

Diffuse

materialforbox.diffuseColor = new BABYLON.Color3(1.0, 0.2, 0.7);

Emissive

materialforbox.emissiveColor = new BABYLON.Color3(1, .2, .7);
materialforbox.emissiveTexture = new BABYLON.Texture("images/nature.jpg", scene);

Ambient

materialforbox.ambientColor = new BABYLON.Color3(1, 0, 0.2);

Specular

  • Specular color
materialforbox.specularColor = new BABYLON.Color3(1.0, 0.2, 0.7);
  • Specular texture
materialforbox.specularTexture = new BABYLON.Texture("grass.png", scene);

WireFrame

materialforbox.wireframe = true;

Basic Material Property – FresnelParameters

Below are properties are available for Fresnel:

StandardMaterial.diffuseFresnelParameters
StandardMaterial.opacityFresnelParameters
StandardMaterial.reflectionFresnelParameters
StandardMaterial.emissiveFresnelParameters
StandardMaterial.refractionFresnelParameters

Leave a Reply

Your email address will not be published. Required fields are marked *