clojure2d.extra.raymarching

ao

(ao k falloff steps)

f - distance field p - current position n - normal k - scaling factor (0.01-1.0) falloff - 0.5-0.95 steps - how many steps (2-10)

camera

(camera ro ch rot)

create camera function. * ro - ray origin * ch - camera heading * rot - camera rotation returns function which should be used to determine ray direction, based on pixel position

distance-fog

(distance-fog fcol factor)

interpolate-material

(interpolate-material m1 m2 amt f)(interpolate-material m1 m2 amt)

light

(light L scene diff-color spec-color astr)

make-normal

(make-normal f eps)

material

(material conf)

Create material information: - color - Vec3 with RGB: 0.0-1.0 - diffusion - diffusion ratio: 0.0 - 1.0 - specular - specular ratio: 0.0 - 1.0 - specularf0 - f0, intensity ratio: 0.0 - 1.0 - specularpow - strength of specular: 1.0 - 10k - reflection - reflection ratio: 0.0 - 1.0

normal

(normal eps f p)

op-blend

(op-blend f1 f2 k)(op-blend fs k)

op-displace

(op-displace f dispf scalein scaleout)

op-interpolate

(op-interpolate f1 f2 amount lerp)(op-interpolate f1 f2 amount)(op-interpolate f1 f2)

op-intersect

(op-intersect f1 f2)

op-repeat

(op-repeat f c)

op-rotate

(op-rotate f axis angle)

op-scale

(op-scale f s)

op-subtract

(op-subtract f1 f2)

op-transform

(op-transform f t)

op-union

(op-union f1 f2)(op-union fs)

primitive

multimethod

ray

(ray ro rd t)

ray-marching

(ray-marching scene background tmin tmax steps stepf precision)(ray-marching scene background tmin tmax steps)

depth field ray marching tmin - starting distance > 0.005 tmax - final distance steps - how many steps stepf - step factor (0.1-1.0) precision - how close is enough (0.0001 - 0.01) background - background material returns vector, where index: - 0 - HitData - 1 - fake AO based on steps made

reflect

(reflect I N)

soft-shadow

(soft-shadow k steps max-depth)

vzero