end
end
end
+
+local function make_mandelbrot_pigment()
+
+ local maxiter = 100
+ local set_colour = {0,0,0}
+
+ local function get_col(x,y,cx,cy,iter)
+ if iter == 0 then
+ return set_colour
+ elseif x^2 + y^2 > 4 then
+ local I = iter/max_iter
+ return {I,I,1-I}
+ else
+ return get_col(x^2 - y^2 + cx,
+ 2*x*y + cy,
+ cx, cy, iter-1)
+ end
+
+ local xp = x^2 - y^2 + cx
+ local yp = 2*x*y + cy
+ end
+
+ return function (x,y)
+ get_col(0,0,x,y,maxiter)
+ end
+end
Textures = {
make_phong_texture = make_phong_texture,