computer graphics

computer graphics

earth-ifier

Python, Houdini, VEX

Python, Houdini, VEX

overview

Earth-ifier is a Houdini project which allows a user to input any mesh to be retextured with an earth-like landscape.​ It implements simple tile-based wave function collapse (WFC) with triangular tiles in a UV space.

For full details, check out the project's final documentation and Github page.

details

The simple tile model of WFC fills in each tile at a time. Tiles are predrawn and given rules manually, and each tile area has its own entropy instead of each pixel. For this project, I created tiles as a single image in Photoshop first, and was able to separate them into their own tiles using a Python script in Houdini.

The project pipeline begins by taking a mesh and simply remeshing into triangles using Houdini's remesh node. An autouv node and simple VEX function then stores each face and their neighbors in clockwise order. This is helpful for the WFC algorithm later.

Using Houdini UDIMs, I was able to choose and manipulate each separate triangular tile to be used as the UV mapping for any triangular primitive (face) on the mesh. With all this set up, I then go through the wave function collapse algorithm in its own VEX function, which amounts for about 450 lines of code.