Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BufferGeometry position attribute doesn't update when using WebGPURenderer r173 #30518

Closed
LarryWu1 opened this issue Feb 14, 2025 · 1 comment
Milestone

Comments

@LarryWu1
Copy link

Description

Updating BufferGeometry position attribute does nothing with WebGPURenderer. WebGLRenderer updates correctly.

Reproduction steps

  1. Create WebGPURenderer
  2. Pass BufferGeometry to a mesh and add it to a scene
  3. In the render loop, update position attributes

Code

const geometry = new THREE.BufferGeometry()
...

function animate() {
  geometry.setAttribute('position', new THREE.BufferAttribute(new Float32Array([...]), 3))
  geometry.attributes.position.needsUpdate = true

  ...
  renderer.render(...)
}

Live example

https://codesandbox.io/p/sandbox/t6g6yn

Change to WebGLRenderer and the line moves as expected

Screenshots

No response

Version

r173

Device

Desktop

Browser

Chrome

OS

Windows

@LarryWu1 LarryWu1 changed the title BufferGeometry position attribute doesn't update r173 BufferGeometry position attribute doesn't update when using WebGPURenderer r173 Feb 14, 2025
@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 14, 2025

You are not supposed to overwrite an existing buffer attribute. Instead update the existing array data.

The size of the attribute is supposed to be fixed. If not, you have to call dispose() on the geometry and create a new one.

@Mugen87 Mugen87 closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2025
@Mugen87 Mugen87 added this to the r174 milestone Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants