Texture attribute "needsUpdate" is missing


I need to update a texture in the scene.
According to here, there is a flag .needsUpdate that needs to be set to trigger an update next time the texture is used

I have an example here that loads a texture.

The value of the texture needsUpdate attribute for planeMesh.material.map.needsUpdate is always undefined

Why is the needsUpdate attribute missing?


Maybe because loading of a texture is asynchronous and you try to set property of an undefinded object as the object is not loaded yet.

In your code, just remove the line planeMesh.material.map.needsUpdate = true; and fix the line with an axes helper, THREE.AxisHelper => THREE.AxesHelper (have a look at the warning messages in the console). After these changes everything works as expected, at least for me :slight_smile:

I changed the example so that the printing of the needsUpdate attribute is done only after the texture is loaded.
But the value of needsUpdate is still undefined, regardless of what it is set to (I expect it to be false or true).

There is no specific problem with this example.
The reason for my question is that in another case, the texture does not update on first interaction.
The other case is too complicated to place in a stand alone example, so I used this simple example to demonstrate the same problem where the needsUpdate value of texture is undefined