Shifted mandelbulb sdf out to primitives.
[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                               0.1, 1.0, 0.0, 30)),
23
24    camera = {location = V.new{0,-5,0},
25              point_at = V.origin,
26              right = V.x,
27              fov = 1}}
28
29 Render.eps = 0.001
30 Render.bg_col = {0,0,0}
31 Render.render(scene, 2560, 1440, "out/mandelbulb.ppm")