Friday, July 6th 2018
Inspired by a tutorial by Catlike Coding, I created a set of vertices programmatically, in the shape of a grid. In order to display them in Unity, I instantiated a "point" prefab at each vertex.
Taking the first sketch a bit further, I dynamically created triangles across the entire grid, forming an actual Unity mesh.
In this sketch, each vertex is being displaced randomly on the Z axis. I was interested to see if the grid mesh would "hold together" with all of these points jumping around. I also implemented normals, tangents, and UV coordinates in order to properly display a set of texture maps, including normal and albedo.
I applied Perlin noise to the z-cood of each point in the grid, driven by a mix of x-coord and Time.time, which made an interesting folding animation.
I applied Mathf.Sin deformations to each vertex, in the direction corresponding to its normal. I'm still new to working directly with the Mesh object in Unity, and I couldn't visualize whether this would "buldge" more like you'd see in a 3D content creation tool like Cinema 4D, or break apart.
Unlike some implementations of noise, Unity's is solely positive, from 0-1. Although using Perlin noise here added some smoothness, the result was that the size of the sphere kept increasing.
Code for this week's Procedural Systems sketches is available on GitHub