Colours are now Vectors, added rainbow pigment.
[raymarcher.git] / mandelbulb.lua
1 require "Vector"
2 local V = Vector
3
4 require "Primitives"
5 local P = Primitives
6
7 require "Operations"
8 local O = Operations
9
10 require "Textures"
11 local T = Textures
12
13 require "Render"
14
15
16 local scene = {
17    -- sdf = make_mandelbulb(T.make_count_texture(0.1)),
18    sdf = P.make_mandelbulb(V.origin, 100, 8,
19                            T.make_phong_texture(
20                               {V.new{3,-5,3}},
21                               -- T.make_solid_pigment{0,0.5,1.0},
22                               T.map_spherical(T.make_rainbow_pigment(0.1), V.origin, 1, 1),
23                               0.1, 1.0, 0.0, 30)),
24
25    camera = {location = V.new{0,-5,0},
26              point_at = V.origin,
27              right = V.x,
28              fov = 1}}
29
30 Render.eps = 0.001
31 Render.bg_col = {0,0,0}
32 Render.render(scene, 2560, 1440, "out/mandelbulb_rainbow.ppm")
33 -- Render.render(scene, 2560, 1440, "out/mandelbulb_rainbow.ppm")