#include <PhongShader.h>
Definition at line 16 of file PhongShader.h.
Public Member Functions | |
PhongShader (Scene *scene, ColorRGBA color, float ka, float kd, float ks, float ke) | |
Initializes the shader. | |
virtual ColorRGBA | Shade (Ray &ray) |
Returns the color of the surface-point that is associated with this shader according to the phongshader calculations. | |
Data Fields | |
ColorRGBA | color |
The base color. | |
float | ka |
The ambient coefficient. | |
float | kd |
The diffuse reflection coeffient. | |
float | ks |
The specular reflection coeffient. | |
float | ke |
The shininess exponent. |
Returns the color of the surface-point that is associated with this shader according to the phongshader calculations.
ray | The ray that hit the surface. |
Implements Shader.
Definition at line 65 of file PhongShader.h.
References ColorRGBA::blue(), Primitive::castShadows(), Scene::castShadows, color, Ray::dir, Dot(), Primitive::GetNormal(), Texture::GetTexel(), Shader::getTexture(), Shader::getTextureCount(), Primitive::GetUV(), ColorRGBA::green(), Ray::hit, Scene::Intersect(), ka, kd, ke, ks, Scene::mLights, Ray::org, ColorRGBA::red(), Shader::scene, and Ray::t.
float PhongShader::ka |
The ambient coefficient.
float ka
Definition at line 30 of file PhongShader.h.
Referenced by Shade().
float PhongShader::kd |
The diffuse reflection coeffient.
float kd
Definition at line 36 of file PhongShader.h.
Referenced by Shade().
float PhongShader::ks |
The specular reflection coeffient.
float ks
Definition at line 42 of file PhongShader.h.
Referenced by Shade().
float PhongShader::ke |
The shininess exponent.
float ke
Definition at line 48 of file PhongShader.h.
Referenced by Shade().