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

Hence we complete this chapter on textures. As you've seen, there are lots of different kinds of textures available in Three.js each with their different uses. The most important steps to remember when working with textures are the following:

  • You can use any image in PNG, JPG, or GIF 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 the texture.
  • You'll get the best result when you use a square texture whose size is a power of 2 (for example, 256x256, 512x512, and 1024x1024). The reason is that scaling such textures can be done using mipmaps which provide better results.
  • You can use textures to create great-looking objects from low poly models. Using ...

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