-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
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
MarchingCubes: Migrate to Mesh. #22642
Conversation
|
||
this.generateGeometry = function () { | ||
this.positionArray[ i ] = 0.0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of resetting the vertices like before, I was trying to use setDrawRange()
to limit the rendered data, However, this introduces strange flickering (it seems the number of rendered triangles varies from frame to frame). Hence, I've sticked to the previous approach for now.
Yay! This code was always so hard to deal with. |
It seems the new approach is at least as fast as the previous approach. I was not able to detect a performance regression. |
Thanks! |
Is it no longer possible to "bake" the geometry to a static BufferGeometry any more? I just upgraded one of my bvh demos and saw this changed. In terms of performance it's significantly faster if you don't have a dynamic marching cubes geometry to generate a static geometry to render. I think it might be nice if the marching cubes logic were more separated from a "Mesh" instance and could serve more as a utility that something like a mesh class uses. Maybe I'll look into that at some point. |
Related issue: -
Description
MarchingCubes
is now derived fromMesh
.In order to retain the functionality which was previously based on
ImmediateRenderObject
, it is now necessary to specify the maximum expected triangle/poly count when creating an instance ofMarchingCubes
.The logic that updates the geometry buffers is now implemented in
onBeforeRender()
. If it detects too small buffers, it notifies the user with a warning.