1 #include "EyeLightShader.hxx"
2 #include "Primitive.hxx"
4 EyeLightShader::EyeLightShader(Scene
* scene
,
11 EyeLightShader::~EyeLightShader()
15 EyeLightShader::EyeLightShader()
22 EyeLightShader::Shade(Ray
& ray
)
24 // shade according to cos(theta)
25 Vec3f r
= ray
.direction();
26 Vec3f n
= ray
.hit()->GetNormal(ray
);
27 float cos_theta
= fabs(r
.dot(n
) / (r
.norm() * n
.norm()));
28 return m_color
* cos_theta
;
This page took 0.044643 seconds and 5 git commands to generate.