Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mattatz/unity-subdivision-surface
Loop subdivision surface algorithm implementation in Unity.
https://github.com/mattatz/unity-subdivision-surface
Last synced: 8 days ago
JSON representation
Loop subdivision surface algorithm implementation in Unity.
- Host: GitHub
- URL: https://github.com/mattatz/unity-subdivision-surface
- Owner: mattatz
- License: mit
- Created: 2018-01-12T10:27:49.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2018-01-19T05:20:12.000Z (almost 7 years ago)
- Last Synced: 2024-10-23T04:52:36.956Z (17 days ago)
- Language: C#
- Homepage:
- Size: 41.9 MB
- Stars: 147
- Watchers: 7
- Forks: 20
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-unity-open-source-on-github - unity-subdivision-surface - Loop subdivision surface algorithm implementation (Mesh)
README
unity-subdivision-surface
=====================Loop subdivision surface algorithm implementation in Unity.
![Heads](https://raw.githubusercontent.com/mattatz/unity-subdivision-surface/master/Captures/Heads.png)
From left to right, original mesh, subdivided 1 time, subdivided 2times model.
![Cubes](https://raw.githubusercontent.com/mattatz/unity-subdivision-surface/master/Captures/Cubes.png)
## Loop subdivision surface
> Loop subdivision surface is an approximating subdivision scheme developed by Charles Loop in 1987 for triangular meshes.
> [wikipedia](https://en.wikipedia.org/wiki/Loop_subdivision_surface)## SubdivMorph
![SubdivMorph](https://raw.githubusercontent.com/mattatz/unity-subdivision-surface/master/Captures/SubdivMorph.gif)
SubdivMorph demo morph vertices between original and subdivided.
## Usage
```cs
var filter = GetComponent();
// Require a mesh to weld (require to remove duplicated vertices)
var welded = SubdivisionSurface.Weld(filter.mesh, float.Epsilon, filter.mesh.bounds.size.x);var mesh = SubdivisionSurface.Subdivide(
welded, // a welded mesh
2, // subdivision count
false // a result mesh is welded or not
);
filter.sharedMesh = mesh;```
See demo scenes for details.
## Compatibility
tested on Unity 2017.0.3, windows10 (GTX 1060).
## Sources
- Free low poly head model by hexonian - https://sketchfab.com/models/988a1ffdb6244eaab9b293d296c6e868
- Carnegie Mellon Univ lecture slide - http://www.cs.cmu.edu/afs/cs/academic/class/15462-s14/www/lec_slides/Subdivision.pdf
- Michigan Tech Univ lecture slide - https://pages.mtu.edu/~shene/COURSES/cs3621/SLIDES/Subdivision.pdf
- Matt's Webcorner - Subdivision - https://graphics.stanford.edu/~mdfisher/subdivision.html