Skip to content

Commit

Permalink
Add a BufferGeometry based Subdivision Modifier (#8165)
Browse files Browse the repository at this point in the history
* Add a BufferGeometry based Subdivision Modifier

This started from the original subdivision modifier, and works in the
same way except it has different output - and is much MUCH faster and
far easier on RAM. (From >1m and >3gb (queue crashing browsers) to <10
seconds and <500mb on my tests).

Expected input: Index'd Buffer Geometry or THREE.Geometry - with uv's.
Output: Unindex'd Buffer Geometry.

Also introduced is a class I call the 'TypedArrayHelper' which provides
THREE objects (Such as Face, Vec3, Vec2) as 'registers' (I was thinking
like a CPU register), and controls the typed arrays underneath. It
automatically resizes them and provides a trim() function. While
resizing arrays is slow, it's still all way faster than millions of vec3
objects on a regular Geometry.

* Various Fixes

Fixed normal generation according to
https://www.opengl.org/wiki/Calculating_a_Surface_Normal
maybe various other cleanups.

* Revert "Various Fixes"

This reverts commit 4348a5f.

* Revert "Revert "Various Fixes""

This reverts commit c972529.

* change the example to use BufferSubdivisionModifier

It's almost all working except for LatheGeometry. I'm not entirely sure
what is different about the lathegeometry , but I will investigate later
unless someone else figures it out first.

* change back to v2 and use phongmaterial

change back to v2 and use phongmaterial

* dispose of geometries

see title.

* Remove typedarray.slice's

in favor of typedarray.subarray's.

* slight cleanup to subarray

simply set the new buffers contents to the old buffers contents if
possible, otherwise use subarrays
  • Loading branch information
centerionware authored and mrdoob committed Apr 18, 2016
1 parent 69310cc commit 41db6f6
Show file tree
Hide file tree
Showing 2 changed files with 813 additions and 40 deletions.

0 comments on commit 41db6f6

Please sign in to comment.