3 ms·
Yes, I can give you examples. On this page (which is probably the most popular reference on distance functions for raymarching): https://www.iquilezles.org/www
by joan_kode 6y ago
Yes, I can give you examples. On this page (which is probably the most popular reference on distance functions for raymarching):
https://www.iquilezles.org/www/articles/distfunctions/distfunctions.htm https://www.iquilezles.org/www/articles/distfunctions/distfu...
If you scroll down to the section "Deformations and distortions", you'll notice that iq wishes so hard there were first class functions in GLSL that he pretends they exist in all the code examples (the deformation functions all take functions as parameters).
As for macros specifically filling in the role of first class functions, this is sometimes done by creating a macro that takes a function as parameter. So for example, iq's functions above could be turned into crazy macros.