Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

PainterPixelShader Class Reference

Implements the Painter visitor to draw a Model with detail and bumpmapping on the screen. More...

#include <PainterPixelShader.h>

Inheritance diagram for PainterPixelShader:

Painter List of all members.

Public Methods

 PainterPixelShader (const CGprofile &cgProfile, const CGprogram &cgProgram)
 Initialize the object with the given Cg objects.

virtual void paintMesh (const Mesh &mesh, const Vector &eye, const Vector &light) const
 Draw the Mesh using pixel shaders.

virtual void paintTriangle (const Triangle &triangle, const Vector &eye, const Vector &light) const
 Draw the Triangle using pixel shaders.


Private Attributes

const CGprofile & m_CgProfile
const CGprogram & m_CgProgram

Detailed Description

Implements the Painter visitor to draw a Model with detail and bumpmapping on the screen.

The drawing process uses the pixel shader facilities of the card in order to render the detail and bumpmap layers.


Member Function Documentation

void PainterPixelShader::paintMesh const Mesh   mesh,
const Vector   eye,
const Vector   light
const [virtual]
 

Draw the Mesh using pixel shaders.

This method uses the pixel shader facilities of the card:

  1. Bind the detail texture to the first texture unit.
  2. Bind the normalmap texture to the second texture unit.
  3. Bind the ambient and specular colors to uniform Cg parameters.
  4. Draw each Triangle fragment using the pixel shader.

Reimplemented from Painter.

void PainterPixelShader::paintTriangle const Triangle   triangle,
const Vector   eye,
const Vector   light
const [virtual]
 

Draw the Triangle using pixel shaders.

This method uses the pixel shader facilities of the card:

  1. Bring the light into texture space and bind it to the first color parameter for the vertex.
  2. Bring the half vector into texture space and bind it to the second color parameter for the vertex.
  3. Bind the texture coordinates to the first and second texture unit coordinates.

The pixel shader program uses these parameters and the global state setup in paintMesh to render the Triangle.

Reimplemented from Painter.


Member Data Documentation

const CGprofile& PainterPixelShader::m_CgProfile [private]
 

The CgProfile in which the m_CgProgram will execute.

const CGprogram& PainterPixelShader::m_CgProgram [private]
 

The CgProgram which renders the fragments.


The documentation for this class was generated from the following files:
Generated on Sat Mar 22 15:12:08 2003 for Bumpmap by doxygen1.3-rc2