Skip to content

Conversation

@twastvedt
Copy link
Contributor

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.

@mrdoob
Copy link
Owner

mrdoob commented Sep 25, 2018

I used classes after reading the discussion here, where it sounds like everything is moving to classes soon anyways.

Unfortunately, we still want to support some old browsers (ie, Safari/iOS9 does not even support const and let).

@mrdoob mrdoob added this to the r98 milestone Sep 25, 2018
@WestLangley
Copy link
Collaborator

This tracking makes the initial subdivision slower

It appears to be considerably slower on my machine.

/ping @zz85

@twastvedt
Copy link
Contributor Author

Unfortunately, we still want to support some old browsers (ie, Safari/iOS9 does not even support const and let).

Unfortunate indeed. OK. If it's decided that this should be merged, I'll change it back to prototypes.

@twastvedt
Copy link
Contributor Author

It appears to be considerably slower on my machine.

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.

@mrdoob mrdoob modified the milestones: r98, r99 Oct 31, 2018
@mrdoob mrdoob modified the milestones: r99, r100 Nov 29, 2018
@mrdoob mrdoob modified the milestones: r100, r101 Dec 31, 2018
@mrdoob mrdoob modified the milestones: r101, r102 Jan 31, 2019
@mrdoob mrdoob modified the milestones: r102, r103 Feb 28, 2019
@mrdoob mrdoob modified the milestones: r103, r104 Mar 27, 2019
@mrdoob mrdoob modified the milestones: r104, r105 Apr 24, 2019
@mrdoob mrdoob modified the milestones: r105, r106 May 30, 2019
@mrdoob mrdoob modified the milestones: r106, r107 Jun 26, 2019
@Mugen87
Copy link
Collaborator

Mugen87 commented Jul 14, 2019

I guess this change only makes sense if the base geometry is going to change.

In this case, it's better to keep the current version of SubdivisionModifier and focus on a BufferGeometry migration.

@Mugen87 Mugen87 closed this Jul 14, 2019
@Mugen87 Mugen87 removed this from the r107 milestone Jul 14, 2019
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

Successfully merging this pull request may close these issues.

4 participants