8eae6109f08f12e638aa7ee2875ff3617fc67659
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.040492 seconds and 3 git commands to generate.