Curv is a hobby project and a research project, so there is no schedule.
The "bracelet" model renders okay on my machine with 20 links, but at 100 links, it compiles into 700,000 lines of GLSL or C++, which is too much. Most of that code is in the colour function, which is stupid, because with a better code generator and an optimizing compiler, the colour function should be 1 line of code. So the compiler needs work. To work around the problem with the colour function, I have added
>> colour red
to the bottom of the "bracelet" source file. At 100 links, it still won't render to a graphics window, because there is still 13,500 lines of GLSL, which is too much, but now I can export the bracelet to a mesh in a couple of seconds.
The existing implementation of 'union' inline expands the code for every object being unioned together, so the amount of code generated for the bracelet grows with the number of links, which is no good for large unions. When combined with a stupid code generator and a weak optimizer, this results in way too much code.
The idea behind the "linear_union" operator is to generate a small, fixed amount of code regardless of the number of links in the bracelet. Instead of inline expanding the code for each link, we generate a "for" loop that iterates N times (N is the number of links). I know how to implement "linear_union" in Curv, but due to another compiler limitation, that Curv code won't compile into GLSL or C++. It would be possible to implement "linear_union" directly in C++, but I would rather fix the compiler limitations.
The linear_union proposal fixes the problem of too much code being generated, but the code is still slow, because the time complexity of the distance function is O(N), where N is the number of links in the bracelet. bracelet(100) probably works, but bracelet(1000) is probably too slow. To speed this up further, we want to reduce the time complexity to O(log N) or even O(1).
The bracelet is symmetrical enough so that it could be programming using the "repeat_radial" function, and then the distance function would be O(1). That avoids the "large union" problem by using a different coding technique. I have considered creating a "Symmetry" library that would be effectively a DSL for describing a wide range of mathematical symmetries -- this is an extension of the "repeat" operators. This would allow complex symmetrical shapes to be constructed without using large unions. A well designed Symmetry library could open up new vistas for procedural generation of geometric shapes. Maybe your "struts" model has symmetries that could be leveraged to create an efficient distance function.
One general technique for speeding up the distance function of a large union is to use the approach used by ray tracers, and build an "acceleration structure". For the bracelet, this would mean putting each link into one node of a "bounding volume hierarchy" (BVH), which is a tree structure. Then, you walk this tree structure during sphere tracing or mesh generation, and the time complexity goes down to O(log N). Another approach, applicable to GPU rendering, is "tile based rendering".
There are other open source projects using these techniques, which I can borrow ideas and code from, but they generally rely on the use of compute shaders. Curv is limited right now because it uses OpenGL, and it runs on MacOS, and OpenGL on MacOS doesn't support compute shaders, because Apple wants developers to use Metal instead. OpenGL is dying, so I plan to transition to WebGPU, which is a high level and easy to use, but also higher performance than OpenGL and runs on more platforms, including the web. WebGPU is extremely new and the standard hasn't been finalized yet. Last week, Google announced that the Dawn implementation now supports Linux (previously only Windows and MacOS), and that they now support the WGSL shader language. If I wanted to start playing with WebGPU, it looks like Dawn is finally ready to be used in Curv on an experimental basis.
So given all of these considerations, and given that I'm the only one working on this right now, my first priority is to fix the compiler limitations I have mentioned. By the time that is done, WebGPU will be stable, so then I can transition to WebGPU and start implementing these advanced, high performance rendering techniques.
Does anything that I have mentioned sound like something you would like to work on? Do you have background in C++, or writing a compiler, or GPU/graphics programming? Do you want to build a GUI for Curv, or study the mathematics of symmetry and write a Symmetry library entirely in Curv?
Doug Moen.