question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

documentation for Material.needsUpdate

See original GitHub issue

The current docs for Material.needsUpdate say

.needsUpdate : Boolean

Specifies that the material needs to be updated at the WebGL level. Set it to true if you made changes that need to be reflected in WebGL.

But AFAIK most material parameters don’t need needsUpdate set? Is it documented anywhere which material parameters might need needsUpdate set?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
greggmancommented, Jul 28, 2018

So l just thought I’d add the majority of properties for which you need to set needsUpdate are properties that are unlikely to change at runtime.

skinning, useVertexColors, morphTargets, are all things that rarely change at runtime. flatShading seems unlikely to change at runtime. The other big one is any texture input map, bumpMap, normalMap, envMap etc if they change from null to Texture or Texture to null. But that’s also a rare case.

Maybe the docs could say that rather than listing all the cases? It would be nice to know that it’s only exceptional cases where needsUpdate is needed.

2reactions
looeeecommented, Jul 24, 2018

@pailhead please keep discussion on topic. If you want to discuss something else then open a new issue and discuss it there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Material#needsUpdate – three.js docs
Abstract base class for materials. Materials describe the appearance of objects. They are defined in a (mostly) renderer-independent way, so you don't have...
Read more >
Three.js Materials
Which materials you use really depends on what you're trying to accomplish. ... needsUpdate = true to tell three.js to apply your material...
Read more >
Materials - Three.js Tutorials - sbcode.net
An introduction to the Three.js Material base class. ... All these classes below inherit methods and properties from the Material base class. LineBasicMaterial ......
Read more >
three.js webgl - The Five Planets
Mesh( geometry ); generateVertexColors( geometry ); mesh.material = chooseMaterial ( gui, mesh, ... needsUpdate = true; prevFog = scene.fog; } if ( mesh....
Read more >
How to update material of cube on runtime using WebGL?
Try keeping all of your materials of the same type. Also, you may need to set material.needsUpdate flag to true .
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found