Oriented box signed distance function from Inigo Quilez:
Segments activated by a load of conditionals on each digit's value.
Digits found by repeated divmod 10 stuff, after multiplying by 10000 (sets maximum number of digits after the point).
Leading zeros stripped with a simple loop (that stops at the point). I have code to strip trailing zeros too, but changing values are seldom affected.
Anti-aliasing of the decimal point seems to be a bit off, looks a bit too blurry. Want to add an option to move it to the baseline too.
Currently there are controls for glyph size, point size, segment length, segment thickness, foreground and background colours.
Eventual aim is to port the number rendering to the zoom video assembler I've been working on, to display zoom depth. Will need some extra fiddling, as that needs to be in log-domain and expanded to scientific notation without overflow.
Need to add motion blur to the zoom assembler first, otherwise the least significant digits will be too stroboscopic.
@mathr Hey there, the visual is also quite awesome ! Does it continue accelerating forever ? What happens at higher speeds ?!
@mh8 thanks! https://github.com/claudeha/fragm-examples/blob/55b2daac0913e100c1bbfd7fe5e738e36510fad1/00-ScientificNotation.frag#L27 is the relevant part of the code.
I suppose the motion blur will smear out the rings thicker eventually to uniform grey (possibly speckled due to limited sample count). Then it will probably go all black or all white when it overflows to infinity - single precision float only goes to 1e38 or so...
Actually, even before infinity there may be problems, when `r -= floor(r)` becomes always 0 due to limited precision, at 2^24, with gradual degradation on the way there...
I may try it later and report back!
Welcome to post.lurk.org, an instance for discussions around cultural freedom, experimental, new media art, net and computational culture, and things like that.