O'Reilly logo

Babylon.js Essentials by Julien Moreau-Mathis

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using the Babylon.js standard material

Babylon.js allows you to create materials, which means that it can create the custom materials with custom shaders; however, it provides a standard material with already-developed shaders that are designed to be adapted by many customizations.

In fact, when you add a light to a Babylon.js scene, the light properties such as diffuse color, are sent to the materials of the scene to compute the light contributions on the meshes.

The standard material and its common properties

In Babylon.js, each mesh has a material and the meshes can share the same material. Creating a standard material and assigning it to a mesh with Babylon.js is as easy as writing the following:

myMesh.material = new BABYLON.StandardMaterial("materialName", ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required