Animating Canvas Billboard in THREE.js

前端 未结 2 1978
天命终不由人
天命终不由人 2021-01-04 22:47

Everyone,

I\'m trying to animate a Canvas-based texture that is mapped onto a plane, like a billboard. I\'ve made a point of including material.needsUpdate

2条回答
  •  情话喂你
    2021-01-04 23:36

    The needsUpdate flag is reset (to false) every time the texture is used (every render loop), so it needs to be set to true in the render loop (before the render call, or it'll be a frame off). So in your example, put sign.material.map.needsUpdate = true before renderer.render( scene, camera ). texture.needsUpdate = true and material.needsUpdate = true are not needed.

    Also, you only need to set the needsUpdate flag on the texture, as the material properties are not changing.

提交回复
热议问题