Lighting Materials

Studio provides two lighting materials that can be applied to objects in order to have them react to lights in a scene.

Lighting Material Types

  • Standard lighting material
  • Toon material

For models using the lighting materials we highly recommend exporting your model in the FBX format to ensure all textures are correctly identified during the import process.

Unlit Material

Before discussing the lighting materials, it's important to mention that the default Z.Material (also known as an unlit material) does not react to lighting.

As a result, any lighting effects must be baked directly into the texture that is used with this material.

For more information on the unlit material please see the scripting reference.

Standard Lighting Material

The Z.StandardLightingMaterial uses a standard Blinn-Phong shader, which reacts to lighting in a scene, resulting in models with greater realism.

The material's base colour data is defined by the diffuseMap, with other maps describing how the surface will react to lighting:

  • normalMap - Defines how the object's surface reflects light.
  • ambientMap - Defines how the object's surface reacts to indirect light sources.
  • specularMap - Defines the color of the specular highlights on the object's surface.
  • glossinessMap - Defines how rough or smooth the object's surface is.
  • emissiveMap - Defines areas of the object's surface that appear self-illuminated.
  • opacityMap - Defines the transparency of the object's surface.

Due to the real-time lighting calculations being performed, the use of a standard lighting material has a higher computational expense than that of baked lighting.

The additional texture maps required by this material, as opposed to the default material's single texture file, will also increase the download size of the experience.

For more information on the standard lighting material please see the scripting reference.

Toon Material

The Z.ToonMaterial uses a non-photorealistic toon shader to produce a stylised cel-shaded look. It accomplishes these flat-looking surfaces by limiting shading colors and using harsher gradients (steps), the number of which can bet set through the numShades property.

The toon material is defined using the same texture maps as the standard lighting material (normalMap excluded), but offers an extra outline property allowing you to enable an outline on the object's surface. The color and width of the outline can also be specified.

For more information on the toon material please see the scripting reference.

Using the materials

When importing a 3D model, you can choose the material to use through the 'Using Material' drop-down menu.

The preview on the right displays the model's appearance based on the material currently selected and the textures imported.

You can also add a material to the Hierarchy by right-clicking on the root node (or any other group node) and selecting 'New > Materials' and then choosing one of the material types.

Materials created in the Hierarchy can be assigned to an object using their materials property.

Next Steps

For more information on 3D models please check out our 3D documentation.

zapcode branded_zapcode i