Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Threejs Texture

Tags:

When I execute my render of some geometry I can see in my console this warning:

THREE.WebGLRenderer: Texture is not power of two. Texture.minFilter should be set to THREE.NearestFilter or THREE.LinearFilter. 

I can't understand the reason and the background of my canvas is completely black.

like image 971
Stefano Maglione Avatar asked Apr 02 '15 20:04

Stefano Maglione


People also ask

What is textures in three js?

Textures are often the part of a three. js app that use the most memory. It's important to understand that in general, textures take width * height * 4 * 1.33 bytes of memory. That image will take 60 MEG OF MEMORY! in three.

What is the three texture?

Texture in music is usually described with one of three terms: monophony, polyphony, and homophony.

What is UV threejs?

UV mapping is a method for taking a 2-dimensional texture and mapping it onto a 3-dimensional geometry. Imagine a 2D coordinate system on top of the texture, with (0,0) in the bottom left and (1,1) in the top right.

What is a texture loader?

Loads an image or a DDS texture from the specified file directly and provides it as texture. Creating and using textures is one of the key elements to achieve a great looking scene.


1 Answers

The size of your texture is not powers of two (ie. 16x16, 32x32, 64x64 ...).

Set yourTexture.minFilter = THREE.LinearFilter to get rid of the error message.

like image 114
gaitat Avatar answered Sep 24 '22 02:09

gaitat