Procedural Coral Generation Tool
My main inspirations and references
This tool randomly generates and places coral on a grid! I made this for the Level Designers on my game project BloodSong, at a point when we were heavily utilizing asset packs and I wanted to add something original to the environment.
BloodSong being an underwater game, I started looking at coral. My main inspiration started out with brain coral and their interesting patterns resulting from a phenomenon called Reaction Diffusion. The engineer (read nerd) in me was fascinated by the math, and I tried to figure out various methods of replicating it in Houdini. After a lot of trial and error I realized I would need to use solvers due to the Laplacians involved in calculating it, and I felt this was not the best way to go about my tool.
After looking around a bit I found the Fast Reaction Diffusion node in Substance Designer which yields quick results with some approximations, so I used it to create my textures.
Substance Designer Base Coral Texture
For the blueprint placement tool, I used a sphere trace to reduce intersecting corals as far as possible. For this, I created a custom trace channel in the project to make sure it was only detecting corals. I also used a line trace to make the coral sit on the surface they spawn on, as well as orient themselves to the surface normal.
Blueprints for Coral Placement
I wanted some variation in my coral, so I started by creating two basic meshes, with texture tiling and random colors. I used displacement in UE5 on the high poly meshes to get the coral to protrude out (the realization that tessellation was not in the material editor anymore did not go well for me).
I soon realized something crucial: every mesh that was placed was getting rendered in a separate draw call, and this was severly limiting the designers in setdressing the environment with coral. That's when I took a bit of a deep dive into optimization in Unreal Engine, figuring out that I had to use Instanced Static Meshes. When I replaced my blueprint logic with instanced meshes, the draw calls reduced by over 60%.
But using ISMs would mean they would all use the same material which would hinder the variation, so I did some research and found that I could use Per Instance Custom Data to have different values on parameters in the same material. Hence, I was able to create the desired variation with just a single material.
Materials for the Coral: Normal and Bioluminescent
Material Instance Demonstration
Stats for nerds