summaryrefslogtreecommitdiff
path: root/materials/__init__.py
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-07-10 03:15:17 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-07-10 03:15:17 -0400
commit842e3a9dfecdd6411b1f27084ab6dcbe92fa32b9 (patch)
treeeacf1304096bfb1d7c6597147bd1479ba84ba2e8 /materials/__init__.py
parentaa0f12c8b6c6d4e0858d46eba5499d9682ecbe9d (diff)
downloadchroma-842e3a9dfecdd6411b1f27084ab6dcbe92fa32b9.tar.gz
chroma-842e3a9dfecdd6411b1f27084ab6dcbe92fa32b9.tar.bz2
chroma-842e3a9dfecdd6411b1f27084ab6dcbe92fa32b9.zip
added a hybrid monte carlo ray tracing rendering algorithm
Diffstat (limited to 'materials/__init__.py')
-rw-r--r--materials/__init__.py29
1 files changed, 20 insertions, 9 deletions
diff --git a/materials/__init__.py b/materials/__init__.py
index d2644ad..f8cf700 100644
--- a/materials/__init__.py
+++ b/materials/__init__.py
@@ -8,25 +8,36 @@ sys.path.append(dir + '/..')
from geometry import Material, Surface
+from pmt_optics import *
+
vacuum = Material('vacuum')
vacuum.set('refractive_index', 1)
vacuum.set('absorption_length', np.finfo(np.float32).max)
vacuum.set('scattering_length', np.finfo(np.float32).max)
lambertian_surface = Surface('lambertian_surface')
-lambertian_surface.set('absorption', 0)
-lambertian_surface.set('reflection_specular', 0)
-lambertian_surface.set('reflection_diffuse', 1)
+lambertian_surface.set('detect', 0)
+lambertian_surface.set('absorb', 0)
+lambertian_surface.set('reflect_specular', 0)
+lambertian_surface.set('reflect_diffuse', 1)
black_surface = Surface('black_surface')
-black_surface.set('absorption', 1)
-black_surface.set('reflection_specular', 0)
-black_surface.set('reflection_diffuse', 0)
+black_surface.set('detect', 0)
+black_surface.set('absorb', 1)
+black_surface.set('reflect_specular', 0)
+black_surface.set('reflect_diffuse', 0)
shiny_surface = Surface('shiny_surface')
-shiny_surface.set('absorption', 0)
-shiny_surface.set('reflection_specular', 1)
-shiny_surface.set('reflection_diffuse', 0)
+shiny_surface.set('detect', 0)
+shiny_surface.set('absorb', 0)
+shiny_surface.set('reflect_specular', 1)
+shiny_surface.set('reflect_diffuse', 0)
+
+glossy_surface = Surface('glossy_surface')
+glossy_surface.set('detect', 0)
+glossy_surface.set('absorb', 0)
+glossy_surface.set('reflect_specular', 0.5)
+glossy_surface.set('reflect_diffuse', 0.5)
db = load(open(dir + '/OPTICS.ratdb'))['OPTICS']