New blog post: "Perfecting anti-aliasing on signed distance functions"
https://blog.pkh.me/p/44-perfecting-anti-aliasing-on-signed-distance-functions.html
New blog post: "Perfecting anti-aliasing on signed distance functions"
https://blog.pkh.me/p/44-perfecting-anti-aliasing-on-signed-distance-functions.html
My SDF-2D 3D-viewer is finally functional, so to celebrate I'm morphing my pacman/pie into a circle back and forth.
The shadertoy version is visible here: https://www.shadertoy.com/view/333XDH
(For the transform, since it's not present in this version of the code, it's basically a mix according to time between the pie and the sdf+gradient of a circle)
#FractalFriday (It's already Saturday)
Elephant valley of the Mobius Mandelbrot set.
Formula: \(z_{n+1}=f(z_n^2+c,1)\)
where \(f(z, a)\) is defined as (C-like pseudocode):
Complex f(Complex z, Real a) {
Real dist = abs(re(z)) - a;
if (re(z) > a) {
re(z) = -a + dist;
im(z) = -im(z);
} else if (re(z) < -a) {
re(z) = a - dist;
im(z) = -im(z);
}
return z;
}
Coloring is done by using three very similar colormaps, mapped to triangle inequality average values.
The final color is produced by interpolating between these three colors using the so called "atom domains".
Generated using my GLSL Shadertoy fractal generator: https://www.shadertoy.com/view/33sSRf
recreational domain coloring in #glsl
I think I'm done with it. I fixed the clipping and the colors.
I'm still not satisfied with the raymarch glitching a bit, especially on the summit edges. If someone has ideas to improve it, I shared it on shadertoy: https://www.shadertoy.com/view/333XDH
I believe that's because we're matching the exit edge of the shape when it's close, but I'm not exactly sure how to fix that. In any case, patch welcome :)
The box cut is not perfect but we're getting there!
Edit: also, fun stuff, I realized I could return transparent pixels, so the web page background takes over and it looks like the shape is floating on it. It's stupid but I love it :3
You might be familiar with SDF in 2D, but how about a 3D representation of it?
I'm not lying.
It's not possible!
but...
A round hole in a square peg
New blog post: "The current technology is not ready for proper blending"
https://blog.pkh.me/p/43-the-current-technology-is-not-ready-for-proper-blending.html
Playing with #colors to illustrate my next blog post
Look at this 8 second long loop of visualizing \(f(z)=sin(z^a)\) with a rotating along the unit circle.
Anti-aliasing with screen space pixel size vs L1-norm from numerical derivatives (fwidth) in 2D vs 3D.
Made a new #complex #function #visualizer using #Shadertoy #GLSL
It creates more lines in regions with a lower gradient/derivative, which feels like a grid with repeating steps/lines. Functions can be explored much better in my opinion.
It's funny how simple and fast a basic raytracer can be.
I remember in my first year of IT school (2007-2008) when we had to implement one on CPU, and we had to wait several minutes for one picture to be rendered.
Of course this one is still very basic, but hey it's in real time baby
Sometimes (often) I have this mathematical urge, this instinct, to just name everything with one letter, then I switch to capitalized ones when I run out of them, and then I feel frustrated for not being able to use some Unicode character instead of pi, tau, phi, ...
This is honestly starting to frighten me, especially since I'm actually taking a liking to it.
This is a sickness, please help me.
Tiny distance to sphere in #glsl
(radius of 1, no positioning, and don't be inside the sphere, but who cares about all that)
80 vertices in 2-fold dihedral symmetry has triangle strips of 4 different lengths.
We can also get 80-vertex tetrahedral symmetry with a more "traditional" arrangement of 12 pentagons and the rest hexagons.
Here is an 80-vertex sphere in tetrahedral symmetry with 24 valence-7 vertices.