PhongShader Class Reference

#include <PhongShader.h>

Inherits Shader.

Inheritance diagram for PhongShader:

Inheritance graph
[legend]
Collaboration diagram for PhongShader:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 PhongShader (Scene *scene, RGBAColor color, float ka, float kd, float ks, float ke)
virtual RGBAColor shade (const Ray &ray) const

Private Attributes

RGBAColor mColor
 Base color.
float mKa
 Ambient coefficient.
float mKd
 Diffuse reflection coefficient.
float mKs
 Specular refelection coefficient.
float mKe
 Shininess exponent.

Detailed Description

Plastic-like surface with shadows and glossy reflections

Author:
Alex Busenius

Christian Engels

Definition at line 18 of file PhongShader.h.


Constructor & Destructor Documentation

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

Constructor

Parameters:
scene Pointer to the scene
color Base color
ka Ambient coefficient
kd Diffuse reflection coefficients
ks Specular refelection coefficients
ke Shininess exponent

Definition at line 30 of file PhongShader.h.


Member Function Documentation

virtual RGBAColor PhongShader::shade ( const Ray ray  )  const [inline, virtual]

Calculate color and shadows.

Implements Shader.

Definition at line 47 of file PhongShader.h.

References Ray::dir(), RGBAColor::dot(), Vec3f::dot(), EPSILON, Scene::getLight(), Ray::hit(), Ray::hitPoint(), Light::illuminate(), lerp(), Scene::lightsCount(), mColor, mKa, mKd, mKe, mKs, Shader::mScene, Shader::mTextures, Shader::normal(), Light::numberOfRays(), Ray::obj(), RGBAColor::rgb(), RGBAColor::scaled(), Primitive::texCoord(), and Shader::textureCount().


Member Data Documentation

RGBAColor PhongShader::mColor [private]

Base color.

Definition at line 112 of file PhongShader.h.

Referenced by shade().

float PhongShader::mKa [private]

Ambient coefficient.

Definition at line 115 of file PhongShader.h.

Referenced by shade().

float PhongShader::mKd [private]

Diffuse reflection coefficient.

Definition at line 118 of file PhongShader.h.

Referenced by shade().

float PhongShader::mKs [private]

Specular refelection coefficient.

Definition at line 121 of file PhongShader.h.

Referenced by shade().

float PhongShader::mKe [private]

Shininess exponent.

Definition at line 124 of file PhongShader.h.

Referenced by shade().


The documentation for this class was generated from the following file:
Generated on Fri Feb 1 00:02:22 2008 for Grayfall by  doxygen 1.5.1