Summary

Three.js gives you a lot of materials you can use to skin your geometries. The materials range from the very simple (THREE.MeshBasicMaterial) to the complex (THREE.ShaderMaterial), where you can provide your own vertexShader and fragmentShader programs. Materials share a lot of basic properties. If you know how to use a single material, you'll probably also know how to use the other materials. Note that not all materials respond to the lights in your scene. If you want a material that takes lighting into effect, use THREE.MeshPhongMaterial or THREE.MeshLamberMaterial. Determining the effect of certain material properties just from code is very hard. Often, a good idea is to use a dat.GUI approach to experiment with these properties.

Also, ...

Get Learning Three.js – the JavaScript 3D Library for WebGL - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.