PhongShader Class Reference

#include <PhongShader.h>

Inheritance diagram for PhongShader:

Shader

Detailed Description

Inherits from Shader. This class implements the well-known Phong shader.

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.

Constructor & Destructor Documentation

PhongShader::PhongShader ( Scene scene,
ColorRGBA  color,
float  ka,
float  kd,
float  ks,
float  ke 
) [inline]

Initializes the shader.

Definition at line 54 of file PhongShader.h.


Member Function Documentation

ColorRGBA PhongShader::Shade ( Ray ray  )  [inline, virtual]

Returns the color of the surface-point that is associated with this shader according to the phongshader calculations.

Parameters:
ray The ray that hit the surface.
Returns:
The color of the specifiv surface point.

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.


Field Documentation

ColorRGBA PhongShader::color

The base color.

ColorRGBA color

Definition at line 24 of file PhongShader.h.

Referenced by Shade().

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().


The documentation for this class was generated from the following file:
Generated on Thu Jan 31 21:48:56 2008 for RayTracer by  doxygen 1.5.4