e7fa2ac0e5d161bf5d96a4abbae65b48348cd007
1 #include "ReflectiveEyeLightShader.hxx"
2 #include "Primitive.hxx"
5 ReflectiveEyeLightShader::ReflectiveEyeLightShader(Scene
* scene
,
8 : EyeLightShader(scene
,color
),
9 m_reflectivity(reflectivity
)
13 ReflectiveEyeLightShader::~ReflectiveEyeLightShader()
17 ReflectiveEyeLightShader::ReflectiveEyeLightShader()
24 ReflectiveEyeLightShader::Shade(Ray
& ray
)
26 Vec3f eyeColor
= EyeLightShader::Shade(ray
);
29 // shoot secondary rays from intersection
30 Vec3f n
= ray
.hit()->GetNormal(ray
);
31 Ray
sec(ray
.origin() + ray
.direction() * ray
.t(), ray
.direction() + n
* 2);
32 sec
.setRecursionDepth(ray
.recursionDepth() - 1);
34 if(ray
.recursionDepth() > 0 && m_scene
->Intersect(sec
)) {
35 reflColor
= Shade(sec
);
37 return eyeColor
+ reflColor
;
This page took 0.045243 seconds and 3 git commands to generate.