Liking cljdoc? Tell your friends :D

clojure2d.extra.raymarching

(ABANDONED) Raymarching helper.

* http://www.iquilezles.org/www/index.htm
* http://mercury.sexy/hg_sdf/
raw docstring

aoclj

(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)

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)
sourceraw docstring

cameraclj

(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
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
sourceraw docstring

distance-fogclj

(distance-fog fcol factor)
sourceraw docstring

interpolate-materialclj

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

lightclj

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

make-normalclj

(make-normal f eps)
sourceraw docstring

materialclj

(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
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
sourceraw docstring

normalclj

(normal eps f p)
sourceraw docstring

op-blendclj

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

op-displaceclj

(op-displace f dispf scalein scaleout)
sourceraw docstring

op-interpolateclj

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

op-intersectclj

(op-intersect f1 f2)
sourceraw docstring

op-repeatclj

(op-repeat f c)
sourceraw docstring

op-rotateclj

(op-rotate f axis angle)
sourceraw docstring

op-scaleclj

(op-scale f s)
sourceraw docstring

op-subtractclj

(op-subtract f1 f2)
sourceraw docstring

op-transformclj

(op-transform f t)
sourceraw docstring

op-unionclj

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

primitivecljmultimethod

source

rayclj

(ray ro rd t)
sourceraw docstring

ray-marchingclj

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

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
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
sourceraw docstring

reflectclj

(reflect I N)
sourceraw docstring

soft-shadowclj

(soft-shadow k steps max-depth)
sourceraw docstring

vzeroclj

source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close