The Lambda Lab
/
projects
/
raymarcher.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
bb9573c
)
Added missing export of mandel pigment.
author
Tim Vaughan
<timv@ughan.xyz>
Thu, 23 Feb 2023 11:03:30 +0000
(12:03 +0100)
committer
Tim Vaughan
<timv@ughan.xyz>
Thu, 23 Feb 2023 11:03:30 +0000
(12:03 +0100)
Textures.lua
patch
|
blob
|
history
diff --git
a/Textures.lua
b/Textures.lua
index
1456f7d
..
3a4abaf
100644
(file)
--- a/
Textures.lua
+++ b/
Textures.lua
@@
-69,10
+69,7
@@
local function make_checkered_pigment(colour1, colour2)
end
end
end
end
-local function make_mandelbrot_pigment()
-
- local maxiter = 100
- local set_colour = {0,0,0}
+local function make_mandelbrot_pigment(set_colour, max_iter)
local function get_col(x,y,cx,cy,iter)
if iter == 0 then
local function get_col(x,y,cx,cy,iter)
if iter == 0 then
@@
-85,13
+82,10
@@
local function make_mandelbrot_pigment()
2*x*y + cy,
cx, cy, iter-1)
end
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)
end
return function (x,y)
- get_col(0,0,x,y,maxiter)
+ get_col(0,0,x,y,max
_
iter)
end
end
end
end
@@
-100,7
+94,8
@@
Textures = {
make_flat_texture = make_flat_texture,
make_count_texture = make_count_texture,
make_solid_pigment = make_solid_pigment,
make_flat_texture = make_flat_texture,
make_count_texture = make_count_texture,
make_solid_pigment = make_solid_pigment,
- make_checkered_pigment = make_checkered_pigment
+ make_checkered_pigment = make_checkered_pigment,
+ make_mandelbrot_pigment = make_mandelbrot_pigment
}
return Textures
}
return Textures