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

setScene() ignores mesh.geometry reassignment #646

Closed
ycw opened this issue Jun 3, 2024 · 5 comments · Fixed by #647
Closed

setScene() ignores mesh.geometry reassignment #646

ycw opened this issue Jun 3, 2024 · 5 comments · Fixed by #647
Labels
bug Something isn't working
Milestone

Comments

@ycw
Copy link

ycw commented Jun 3, 2024

Describe the bug

setScene() ignores mesh.geometry reassignment in the following situation:

const mesh = new Mesh(new THREE.BoxGeometry(1,1,1), new THREE.MeshStandardMaterial())
pathTracer.setScene(scene, camera)

mesh.geometry = new THREE.BoxGeometry(2,1,1) // assigns new box geometry(2x1x1)
pathTracer.setScene(scene, camera) // old box geometry(1x1x1) gets rendered

Expected behavior

I expected that pathtracer honors mesh.geometry reassignment.

Workarounds

Renews mesh uuid right after assigning new geometry.

Screenshots and Demos

https://jsfiddle.net/0kyq5g7d/1

setScene.not.detect.geometry.changes.mp4

Packages

three@0.165.0
three-gpu-pathtracer@0.0.22
@ycw ycw added the bug Something isn't working label Jun 3, 2024
@gkjohnson
Copy link
Owner

cc @dongho-shin - do you want to take a look at this?

@gkjohnson gkjohnson added this to the v0.0.23 milestone Jun 4, 2024
@dongho-shin
Copy link
Contributor

dongho-shin commented Jun 4, 2024

StaticGeometryGenerator compare mesh.uuid with cached so it(just change geometry inside of the mesh) may NO_CHANGE for now
StaticGeometryGenerator.js near line 238
image

I think cache comparison method of StaticGeometryGenerator needs to be cleaned up or refactored once.

@gkjohnson
Copy link
Owner

I took a look at the cache a bit more and found a few issues. It should be fixed in #647. It would be great if you guys could try it to make sure it fixes the issue.

Hopefully in the future we won't have to rely on a full scene static geometry generator - which is a fairly complex to run quickly - but that might be a bit further out.

@gkjohnson
Copy link
Owner

gkjohnson commented Jun 7, 2024

@ycw I've just published v0.0.23 if you'd like to update the three.js editor. Thanks again for the report and repro.

@ycw
Copy link
Author

ycw commented Jun 8, 2024

Good.

mrdoob/three.js#28587

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants