Summary
With that, we have completed this chapter on textures. As you’ve seen, a lot of textures are available in Three.js, each with a different use. You can use any image in PNG, JPG, GIF, TGA, DDS, PVR, TGA, KTX, EXR, or RGBE format as a texture. Loading these images is done asynchronously, so remember to either use a rendering loop or add a callback when you load a texture. With the different types of textures available, you can create great-looking objects from low-poly models.
With Three.js, it is also easy to create dynamic textures, using either the HTML5 canvas
element or the video
element – just define a texture with these elements as the input, and set the needsUpdate
property to true
whenever you want the texture to be updated.
With this chapter out of the way, we’ve pretty much covered all of the important concepts of Three.js. However, we haven’t looked at an interesting feature that Three.js offers: postprocessing. With postprocessing...