by thi-ng

thi-ng / raymarchcl

Experimental OpenCL voxel rendering/raymarching via Clojure REPL (from 2013)

125 Stars 5 Forks Last release: Not found 49 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

  • thi.ng/raymarchcl


Experimental OpenCL voxel rendering/raymarching via Clojure REPL.

** Usage

+BEGIN_SRC shell

git clone [email protected]:thi-ng/raymarchcl.git cd raymarchcl lein repl


*** Prepare test voxel data

+BEGIN_SRC clojure

(require '[thi.ng.raymarchcl.core :as rm]) (require '[thi.ng.raymarchcl.generators :as gen]) (require '[thi.ng.raymarchcl.io :as vio])

;; generates a 134MB binary file in project root for later reference (vio/save-volume "gyroid-512.vox" 512 (gen/make-gyroid-volume {:vres [512 512 512]}))


*** Rendering from the REPL

+BEGIN_SRC clojure

(rm/test-render :width 640 :height 360 :iter 1 :vres 512 :vname "gyroid-512.vox" :mat :orange-stripes :theta -45 :dist 2.25 :dof 1e-5 :out-path "out.jpg")


Important note: Increase the =:iter= count for better quality images!

Material presets are defined in the [[./src/thi/ng/raymarchcl/materials.clj][materials namespace]], currently only:

  • =:orange-stripes=
  • =:metal=
  • =:metal2=
  • =:ao=

Different voxel value bands are mapped to different materials within each preset.

** Gallery of selected experiments

*** Stanford Dragon



*** Stanford bunny


*** Gyroid isosurface

The next two images were rendered w/ 100 iteration to reduce DOF noise








*** NVidia Tesla on EC2

These images were rendered using Tesla instances on AWS EC2 (back in 2013)



** License

Copyright © 2013 - 2015 Karsten Schmidt

Distributed under the Apache Software License 2.0

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.