RefractiveShader Class Reference

#include <RefractiveShader.h>

Inherits Shader.

Inheritance diagram for RefractiveShader:

Inheritance graph
[legend]
Collaboration diagram for RefractiveShader:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RefractiveShader (Scene *scene, const RGBAColor &color, float refractionIdx)
RGBAColor shade (const Ray &ray) const

Private Attributes

RGBAColor mColor
 Material color, alpha channel gives shading coefficient per 1 length unit.
float mRefractionIndex
 Refraction index of the material.
float mInvRefractionIndex
 Inverted refraction index of the material.

Detailed Description

Colored refractive transparency with Fresnel term and total internal reflection. Refraction index of surrounding world is assumed to be 1.

Author:
Alex Busenius

Definition at line 17 of file RefractiveShader.h.


Constructor & Destructor Documentation

RefractiveShader::RefractiveShader ( Scene scene,
const RGBAColor color,
float  refractionIdx 
)

Constructor. Alpha channel of material color gives shading coefficient per 1 length unit

Parameters:
scene Pointer to the scene
color Material color
refractionIdx Refraction index of material, should be in range [0.01, 10]

Definition at line 13 of file RefractiveShader.cpp.


Member Function Documentation

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

Trace through the object and refract the ray according to Fresnel's and Snell's laws

Implements Shader.

Definition at line 32 of file RefractiveShader.h.

References RGBAColor::a(), Ray::dir(), Vec3f::dot(), EPSILON, Ray::hit(), Ray::hitPoint(), Ray::influence(), Ray::init(), lerp(), MAX_RECURSION_DEEP, mColor, MIN_INFLUENCE, mInvRefractionIndex, mRefractionIndex, Shader::mScene, Shader::normal(), Ray::obj(), Scene::rayTrace(), Ray::recDeep(), RGBAColor::rgb(), Ray::t(), and Ray::updateInfluence().


Member Data Documentation

RGBAColor RefractiveShader::mColor [private]

Material color, alpha channel gives shading coefficient per 1 length unit.

Definition at line 122 of file RefractiveShader.h.

Referenced by shade().

float RefractiveShader::mRefractionIndex [private]

Refraction index of the material.

Definition at line 125 of file RefractiveShader.h.

Referenced by shade().

float RefractiveShader::mInvRefractionIndex [private]

Inverted refraction index of the material.

Definition at line 128 of file RefractiveShader.h.

Referenced by shade().


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