Didn’t see much mention of this anywhere so, I wanted to make a thread. I’ll also mention this thread is mostly for the future, probably during the 0.9.x releases.
One of the advantages we will be getting with the introduction of Convolution Surfaces is the ability to use Signed Distance Fields (SDF) to influence the shape of stuff made with it. I wanted to make a thread educating about these since I think they will clear up a lot of questions of what can be done/what is possible.
What is a SDF?
A SDF is the math that forms some geometric shape by basically saying where in space it is, and where it is not. It uses distance from the surface to indicate it’s values in different grid sections, -1 and below is inside, 1 and above is outside, and 0 the surface. Decimals from -1 to 1 are usually the sections where we actually render anything, like voxels or pixels. If you invert it, the opposite is the case, and you get a negative field that takes chunks out of others.
This important because, it’s exactly what a metaball even is (each one is just math for a sphere.) The reason metaballs fuse together is when you go to render them, you add the values of the fields so that, you get grid sections where both metaballs effect the number, and sections where only one metaball has an effect.
Why are they important for 3D?
The algorithm we have decided on for years now has been the Convolution Surfaces algorithm, specifically SCALIS (find out more in the Convolution Surfaces thread.) What Convolution Surfaces does is very sophisticated, specifically rather than summing fields it uses a mathematical operation called Convolution.
The TL;DR of how it all works is basically you take two geometric shapes called skeletal elements, whether that’s a sphere around a point (what we will do) or some other field, and you smoothly blend them across some distance, repeating this for every relation along lines or curves that form the overall shape you want (the membrane or creature’s body in our case)
This means that in the context of Convolution Surfaces, you can use stuff other than a sphere. You could for example use a triangular shape like a cone or prism, and have it blend across a distance into a sphere, making a sort of beak shape or something. You could use ellipses and make really cool shapes like muscles with less work.
SDFs have lots of other use cases you can find online as well. The engine we use, Godot, will for example use SDFs in it’s lighting system for version 4.x. Another interesting use is that you can render SDFs directly. Basically, you can skip Convolution Surfaces and go straight to making triangles which can give you very defined shapes like in CAD software. This is also really fast since you aren’t calculating the smoothing and will probably be a huge part of how the tech editors will have to work.
Relevance for microbe
For now, the system for drawing microbes will be pretty simple. I have some functions for cool effects I made over the years like using the Voronoi Diagram of the mesh to make shell/armor chunks or drawing along the mesh connections rather than along the actual membrane’s Convolution Surfaces skeleton to form an organic cage shape. In the future though we will have tons of flexibility, maybe to make more elaborate Cell Walls or something so, I wanted to get some creative ideas flowing on this front.
Hopefully this was educational, if there are any questions, I will answer.