Search code examples
three.jsshaderbounding-box

Computing Bounding Box After Moving Vertices in Shader


In ThreeJS, how can I update the bounding box/sphere after changing vertex positions in a shader?

Edit: I should've clarified I'm using a particle buffer geometry and changing the vertex positions in the shader. I'm not calling geometry.attributes.position.needsUpdate = true;


Solution

  • If you are updating vertices in the shader, it is typical to do this, instead:

    object.frustumCulled = false;
    

    three.js r.98