fixed Box::Extend(Vec3f&)
[MicroTrace.git] / EyeLightShader.cxx
1 #include "EyeLightShader.hxx"
2 #include "Primitive.hxx"
3
4 EyeLightShader::EyeLightShader(Scene* scene,
5 const Vec3f& color)
6 : Shader(scene),
7 m_color(color)
8 {
9 }
10
11 EyeLightShader::~EyeLightShader()
12 {
13 }
14
15 EyeLightShader::EyeLightShader()
16 : Shader(0),
17 m_color(Vec3f())
18 {
19 }
20
21 Vec3f
22 EyeLightShader::Shade(Ray& ray)
23 {
24 Vec3f N = ray.hit()->GetNormal(ray);
25 float cos_phi = fabs(ray.direction().dot(N));
26
27 return m_color * cos_phi;
28 }
This page took 0.045434 seconds and 5 git commands to generate.