top of page

Procedural meshes

 (WORK IN PROGRESS) I showcase a variety of simple geometric forms to demonstrate the versatility and efficiency of procedural mesh generation. Additionally, I feature a procedurally generated terrain, highlighting the ability to create expansive, varied landscapes that adapt in real-time to different parameters.

Screenshot 2025-02-13 112529.png

 This was mostly a learning experience for me, what started as yet again another school assignment became a big interest to me and I took it as a challenge to learn more about this type of programming.

Scripting

In the script, I created a cube by manually defining its geometry 

using vertices, normals, and UV coordinates, where each face

represented as a quad. To showcase the versatility a generated

mesh can have from an animation view- I wanted to give the

form a simple growing and shrinking effect.

 

Originally, I had interpolated the vQuadRight (the cross-product between vQuadUp and vQuadNormal). This method proved to be inconsistent because interpolating this vector alone might not result in a dynamic change in the overall size or shape of the cube. So instead, I interpolate the vertex positions themselves.

 

The vQuadNormal serves as a key component in determining the positions of the vertices, allowing it to influence the geometry of the cube. By leveraging the vQuadNormal, I can use it as a basis for modifying the cube's size dynamically.

CubeMesh2-1024x816.png

Quad lerp - Unsuccessful:

image.png
image.png

Vector lerp - Successful:

Desktop2025.02.13-12.13.08.209.DVR-ezgif.com-cut.gif

To prove my point even more, I can make the procedural mesh creation more interesting and dynamic. I can modify how the vertices are generated by adding some variation in the Lerp interpolation function. To give some examples of Lerp manipulation: sinusoidal, Perlin Noise for Randomness, twisting and rotating or other mathematical functions to give the cube a more fun and dynamic effect. I can even change the way we Lerp using easing functions such as SmoothStep, OutBounce, EaseOutElastic, etc. And here is what all of that combined looks like:

image.png
image.png
Desktop2025.02.13-12.22.07.210.DVR-ezgif.com-crop.gif
image.png

Then I made a pyramid just for fun and gave it a fun effect too:

bottom of page