-
-
Notifications
You must be signed in to change notification settings - Fork 36.1k
Sharp edges and faster updates on subdivision modifier. #14958
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
Conversation
…n preparation for propagating sharpness.
# Conflicts: # examples/js/modifiers/SubdivisionModifier.js
Unfortunately, we still want to support some old browsers (ie, Safari/iOS9 does not even support |
It appears to be considerably slower on my machine. /ping @zz85 |
Unfortunate indeed. OK. If it's decided that this should be merged, I'll change it back to prototypes. |
Right. I guess this change only makes sense if the base geometry is going to change. Then this PR is faster because it doesn't go through all the smooth steps, and only recalculates the vertices that are affected by the change. Here's a version with the example from this PR with the changing base mesh but the original subdivision modifier: subdiv-updateCompare. On my machine the cube at 4 subdivisions is twice as fast on this PR. The torus knot at 2 subdivisions is only 20% faster. |
In this case, it's better to keep the current version of |
This PR adds sharp edges to the subdivision modifier example. It also keeps track of the influence of each base vertex on the subdivided mesh vertices. This tracking makes the initial subdivision slower, but if only the shape of the base mesh changes, subsequent updates to the subdivided mesh are possible in real time for simpler meshes and/or changes to the position of only some vertices. See the updated example for a demo of this.
I made pretty heavy changes to the modifier and am of course happy to discuss anything and everything. I used classes after reading the discussion here, where it sounds like everything is moving to classes soon anyways.