CalcBounds for other Primitives... ;-)
[MicroTrace.git] / EyeLightShader.cxx
index 12578d7..4f31b84 100644 (file)
@@ -1,4 +1,5 @@
 #include "EyeLightShader.hxx"
+#include "Primitive.hxx"
 
 EyeLightShader::EyeLightShader(Scene* scene,
                               const Vec3f& color)
@@ -20,5 +21,8 @@ EyeLightShader::EyeLightShader()
 Vec3f
 EyeLightShader::Shade(Ray& ray)
 {
-  return Vec3f();
+  Vec3f N = ray.hit()->GetNormal(ray);
+  float cos_phi = fabs(ray.direction().dot(N));
+  
+  return m_color * cos_phi;
 }
This page took 0.02886 seconds and 4 git commands to generate.