View allAll Photos Tagged glsl
Modification of the Fragmentarium Distance Estimator sample program. I wanted something more interesting to look at than the default 8 sphere cube. (But I find that I am still completely mystified by how the distance estimator is rendered :-)
float DE(vec3 pos) {
float i,k;
vec3 v,w;
// Setting k to 0.85 will create a partially connected lattice (but creates a rendering break, unless you remove the if (abs(pos.x) > 2.0) conditional.
k=1.0;
// Place 8 spheres at the points of a cube surrounding the origin (0,0,0) of the coordinate space
i= abs(length(abs(pos)+vec3(-1.0))-0.25) * 1.0;
// Surround the original cube array with an infinite sphere lattice (using SIN to bound the distance estimate)
if (abs(pos.x) > 2.0) {
v=vec3(sin(pos.x),sin(pos.y),sin(pos.z));
w=vec3(sin(k*pos.x),sin(k*pos.y),sin(k*pos.z));
i=2.0*(dot(v,w));
}
return i ;
}
The same pictures with and without render to texture shaders.... (shader does the colors, the realtime horizontal blur and this old tv lines effect)
Visualization of distances to three points on a right triangle, colored according to the least-height rational within each pixel's domain. Brighter values of red, green, or blue indicate lower height rational distances to points A, B, or C were found within a pixel's domain.
Implemented in GLSL to demonstrate the efficiency of using a Stern-Brocot binary search to locate rationals. Renders at high fps on the GPU.
Dark bands are where 50 iterations were exhausted without locating a rational within the pixel. These bands surround all rationals, as lower-height rationals tend to avoid each other.
If a point with rational distance to all 3 points exists (it is unknown whether any such points exist) within the height cutoff, it will appear as a white pixel at the intersection of three circles.
Made in Quartz Composer, exported in QuartzCrystal and then in Quicktime
Tests for using GLSL Shaders in TIFF output for printing