My Authors
Read all threads
Having a lot of fun reproducing @OskSta 's #Townscaper in #unity3d, very instructive exercise!
⬇️ Details in the thread bellow 1/10
Townscapper is based on #MarchingCubes, the traditional algorithm for converting voxel data to polygonal mesh (see also #DualContouring) 🧊
⬇️ We will apply it on a less usual grid though 2/10
Non regular grid generation based on hexagonal tiles with randomly removed edges.
Subdividing ensures that faces are all squares
➡️required to apply marching cubes! 3/10
Marching cubes is already kind of a #DictionaryBased algorithm. Its original "atoms" (or "modules") are very simple 1-4 triangles meshlets.
⬇️ But we can change these atoms 4/10
Custom marching cube atoms are imported from #Blender3D and labeled with the cases of empty/full neighboring #voxels they fit.
⬇️ Nevertheless they cannot be used as is! 5/10
Atoms must be deformed to fit our irregular cells.
We know where to move a few key poitns points based on the grid mesh
➡️use case for cage-based mesh deformation
Many algorithms exist, some of them here: github.com/superboubek/QM… 6/10
(Yes, it's a paper from my research team 😇)
We can use Spherical Mean Value Coordinates because cage faces are planar for sure.
Running real time but could be improved using #ParallelFor jobs. 7/10
For an easy #ProceduralGeneration in #Unity3D, we need a #DataStructure to represent meshes that is more flexible than mesh.vertices[] and mesh.triangles[].
For instance how to quickly find all the faces connected to a vertex? 8/10
I reproduced a basic version of #Blender3D 's #BMesh structure in #Unity3D. A real pleasure to work with!
More about BMesh: wiki.blender.org/wiki/Source/Mo… 9/10
📚 Some other references 📚
Oskar's talk at IndiCade Europe 2019 for technical insights
@OskSta's tweets for inspiration
More about hexagons: redblobgames.com/grids/hexagons/
Can't wait to play with #WaveFunctionCollapse now! 🤩

10/10
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Élie Michel 🍪

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!