Not that I’m aware of, but this is a great use case for using an LLM - just copy the whole page form IQ’s website and ask Chat GPT or other to transform it to the appropriate format.
No, the complete list of shader compatible SDF functions according to Inigo Quilez, but transformed similar to the example function sdEllipsoid( r3 ) {... from the original article.
Thing is, IQs sdfs are more than just straight math.. it’s more like.. an expression of his art.. as soon as you get something more complex than the most basic primitives, the implementations become more interpretive, and the skill of the creator shows through..
Things like.. the order of operations, magic constants to make them work/optimal etc.
So there isn’t just some platonic fundamental taxonomy of implementations.
That’s true, but most things can be created by combining the primitives. This also easily becomes an artistic task.
I have already tried a few dines out of curiosity.
Specific changes must be made for each application. The original algorithm requires an implicit function whose partial derivatives must be given, e.g.
// Example: implicit surface genus2:
const isf = ( x, y, z ) => ( 2*y*( y*y - 3*x*x )*( 1 - z*z ) + ( x*x + y*y )*( x*x + y*y ) - ( 9*z*z - 1 )*( 1 - z*z ) );// IMPLICIT SURFACE Function
const dx = ( x, y, z ) => ( -12*x*y*( 1 - z*z ) + 4*x*( x*x + y*y ) );// PARTIAL DERIVATE to x
const dy = ( x, y, z ) => ( 6*( y*y - x*x )*( 1 - z*z ) + 4*y*( x*x + y*y ) );// PARTIAL DERIVATE to y
const dz = ( x, y, z ) => ( -4*y*( y*y - 3*x*x )*z + 36*z*z*z - 20*z );// PARTIAL DERIVATE to z
I still have open problems with the adjustment to SDFs.
For edges with external angles of 270° or more, the connection to the surface is no longer clear.
Such angles also occur during subtraction and there are no clear tangents at the sharp cutting edges.
I still have to come up with something.
I hope that these problems can be solved somehow.
I can’t yet assess whether what I’m doing here is suitable for that. So far, I’m interested in determining volume for real buoyancy. I could store the triangles that intersect the voxel in buffers for each voxel and then calculate the exact distances when a ray moves through the voxel. But these are just ideas so far. I’m busy with other things.
A small experiment on determining the normals of SDFs. I did it because I’m having errors with the normals in my project, and it’s difficult to debug. The test shows that the functions used are fine. The error I’m looking for is apparently well hidden in the overall algorithm.