CombineShader Class Reference

#include <CombineShader.h>

Inherits Shader.

Inheritance diagram for CombineShader:

Inheritance graph
[legend]
Collaboration diagram for CombineShader:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CombineShader (Scene *scene, bool addShaders)
virtual RGBAColor shade (const Ray &ray) const
void setLightingShader (Shader *sh, float alpha)
void setTransparentShader (Shader *sh, float alpha)

Private Attributes

std::pair< Shader *, float > mLiShader
 Lighting shader.
std::pair< Shader *, float > mTrShader
 Transparent shader.
bool mAddShaders
 If shaders should be added (old behavior).

Detailed Description

Shader that combines different shaders by adding the color values with gived alpha

Author:
Alex Busenius

Christian Engels

Definition at line 15 of file CombineShader.h.


Constructor & Destructor Documentation

CombineShader::CombineShader ( Scene scene,
bool  addShaders 
) [inline]

Constructor

Parameters:
scene Scene pointer
addShaders Add both shaders instead of lerp()-ing them

Definition at line 24 of file CombineShader.h.


Member Function Documentation

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

Shades the pixel with every shader

Implements Shader.

Definition at line 35 of file CombineShader.h.

References RGBAColor::a(), Ray::hit(), lerp(), mAddShaders, mLiShader, Shader::mTextures, mTrShader, RGBAColor::rgb(), RGBAColor::scale(), RGBAColor::setA(), Primitive::texCoord(), Shader::textureCount(), and Ray::updateInfluence().

void CombineShader::setLightingShader ( Shader sh,
float  alpha 
) [inline]

Set lighting shader

Parameters:
sh Shader
alpha Alpha channel for the shader impact on total color

Definition at line 86 of file CombineShader.h.

References mLiShader.

Referenced by CombineShaderFactory::create().

void CombineShader::setTransparentShader ( Shader sh,
float  alpha 
) [inline]

Set transparent shader

Parameters:
sh Shader
alpha Alpha channel for the shader impact on total color

Definition at line 99 of file CombineShader.h.

References mTrShader.

Referenced by CombineShaderFactory::create().


Member Data Documentation

std::pair<Shader *, float> CombineShader::mLiShader [private]

Lighting shader.

Definition at line 108 of file CombineShader.h.

Referenced by setLightingShader(), and shade().

std::pair<Shader *, float> CombineShader::mTrShader [private]

Transparent shader.

Definition at line 111 of file CombineShader.h.

Referenced by setTransparentShader(), and shade().

bool CombineShader::mAddShaders [private]

If shaders should be added (old behavior).

Definition at line 114 of file CombineShader.h.

Referenced by shade().


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