O'Reilly logo

Learning Three.js: The JavaScript 3D Library for WebGL by Jos Dirksen

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

Summary

The Three.js library gives you a lot of materials that you can use to skin your geometries. The materials range from the very simple MeshBasicMaterial to the complex ShaderMaterial, where you can provide your own vertex and fragment shaders. The most important subjects that were discussed in the chapter are as follows:

  • The 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.
  • Not all materials respond to the lights in your scene. If you want a material that takes lighting into effect, use the MeshPhongMaterial or MeshLambertMaterial.
  • When you want to create a transparent material, it isn't enough to just set the opacity property, you also have to set ...

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