ShUtil::ShKernelLib Class Reference

List of all members.

Static Public Member Functions

static ShProgram outputPass (const ShProgram &p)
 Generates a passthrough program using the outputs of a given ShProgram and keeps all the names.
static ShProgram inputPass (const ShProgram &p)
 Generates a passthrough program using the outputs of a given ShProgram and keeps all the names.
static ShProgram shChangeBasis (std::string name="vec", std::string b0Name="b0", std::string b1Name="b1", std::string b2Name="b2")
 Basis Conversion program Takes 3 vectors for an orthonormal basis and converts the fourth vector.
template<int N, ShBindingType Binding, typename T>
static ShProgram shVsh (const ShMatrix< N, N, Binding, T > &mv, const ShMatrix< N, N, Binding, T > &mvp, int numTangents=0, int numLights=1)
 Generalized vertex program that computes *lots* of different outputs If numTangents = 0, then tangent, tangent 2 are not included in the inputs and any TCS outputs are invalid If numTangents = 1, then only tangent is an input, tangent2 is computed from normal and tangent.

Detailed Description

Definition at line 50 of file ShKernelLib.hpp.


Member Function Documentation

ShProgram ShUtil::ShKernelLib::inputPass const ShProgram p  )  [static]
 

Generates a passthrough program using the outputs of a given ShProgram and keeps all the names.

Useful in a cases where vsh outputs need to be duplicated before being passed to fsh

Definition at line 45 of file ShKernelLib.cpp.

References SH_BEGIN_PROGRAM, and SH_END.

ShProgram ShUtil::ShKernelLib::outputPass const ShProgram p  )  [static]
 

Generates a passthrough program using the outputs of a given ShProgram and keeps all the names.

Useful in a cases where vsh outputs need to be duplicated before being passed to fsh

Definition at line 33 of file ShKernelLib.cpp.

References SH::ShProgram::node(), SH_BEGIN_PROGRAM, and SH_END.

ShProgram ShUtil::ShKernelLib::shChangeBasis std::string  name = "vec",
std::string  b0Name = "b0",
std::string  b1Name = "b1",
std::string  b2Name = "b2"
[static]
 

Basis Conversion program Takes 3 vectors for an orthonormal basis and converts the fourth vector.

Hardcoded for 3f right now IN(0,1,2) ShVector3f b0Name, b1Name, b2Name IN(3) ShVector3f name;

OUT(0) ShVector3f name;

Definition at line 57 of file ShKernelLib.cpp.

References ShUtil::changeBasis(), SH_BEGIN_PROGRAM, SH_END, and SH_NAMEDECL.

template<int N, ShBindingType Binding, typename T>
ShProgram ShUtil::ShKernelLib::shVsh const ShMatrix< N, N, Binding, T > &  mv,
const ShMatrix< N, N, Binding, T > &  mvp,
int  numTangents = 0,
int  numLights = 1
[static]
 

Generalized vertex program that computes *lots* of different outputs If numTangents = 0, then tangent, tangent 2 are not included in the inputs and any TCS outputs are invalid If numTangents = 1, then only tangent is an input, tangent2 is computed from normal and tangent.

All TCS outputs are valid If numTangent > 2, then both tangent and tangent2 are inputs.

(using new orthonormal bases {normal, tangent, tangent2} at each given point IN(0) ShTexCoord2f texcoord - texture coordinate IN(1) ShNormal3f normal - normal vector (MCS) ShVector3f tangent - primary tangent (MCS) (only included if numTangents > 0) ShVector3f tangent2 - secondary tangent (MCS) (only included if numTangents > 1) ShPoint3f lightPosi - light position (VCS), for i = 0..numLights - 1 IN(-1) ShPosition4f posm - position (MCS)

OUT(0) ShTexCoord2f texcoord - texture coordinate OUT(1) ShPoint3f posv - output point (VCS) OUT(2) ShPoint4f posm - position (MCS)

ShNormal3f normal - normal vector (VCS) ShVector3f tangent - primary tangent (VCS) (only valid if numTangents > 0) ShVector3f tangent2 - secondary tangent (VCS) (only valid if numTangents > 0) ShVector3f viewVec - view vector (VCS) ShVector3f halfVec - half Vector (VCS) = halfVec0 ShVector3f halfVeci - half Vector (VCS), for i = 0..numLights - 1 ShVector3f lightVec - light Vector (VCS) = lightVec0 ShVector3f lightVeci - light Vecor (VCS), for i = 0..numLights - 1 ShVector3f lightPos - light position (VCS) = lightPos0 ShPoint3f lightPosi - light position (VCS), for i = 0..numLights -1

ShNormal3f normalt - normal vector (TCS) ShVector3f viewVec - view vector (TCS) ShVector3f halfVect - half Vector (TCS) = halfVect0 ShVector3f halfVecti - half Vector (TCS), for i = 0..numLights - 1 ShVector3f lightVect - light Vector (TCS) = lightVect0 ShVector3f lightVecti - light Vector (TCS), for i 0..numLights - 1

OUT(-1) ShPosition4f posh - position (HDCS)

Definition at line 47 of file ShKernelLibImpl.hpp.

References SH::cross(), SH_BEGIN_VERTEX_PROGRAM, and SH_NAMEDECL.


The documentation for this class was generated from the following files:
Generated on Wed Nov 9 15:37:37 2005 for Sh by  doxygen 1.4.5