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, remember that most of the properties of a material can be modified at runtime. Some though (for example, side
) can't be modified at runtime. If you change such a value, you need to set the needsUpdate
property to true
. For a complete overview of...