Support Forum       Library Source       SourceForge Page       G3D Web Page     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
G3D::SuperShader::Pass Class Reference

Inherits G3D::ReferenceCountedObject.

Inherited by G3D::SuperShader::ExtraLightPass, G3D::SuperShader::NonShadowedPass, and G3D::SuperShader::ShadowedPass.

Public Types

typedef shared_ptr< PassRef
 

Public Member Functions

virtual shared_ptr< OldShadergetConfiguredShader (const UniversalMaterial &material, CullFace c=CullFace::CURRENT)
 Given a material and the current settings on this pass, returns the appropriately configured shader.
 

Static Public Member Functions

static PassRef fromFiles (const std::string &vertexFilename, const std::string &pixelFilename)
 Constructs a new SuperShader pass from the specified vertex and pixel shaders.
 
static void purgeCache ()
 Clears the static cache of SuperShader::Pass to clean up memory or allow reloading.
 

Public Attributes

ShaderProgram::ArgList args
 These will be merged with the UniversalMaterial-based args when applied to the shader.
 
std::string customShaderPrefix
 This will be added after the UniversalMaterial-based customShaderPrefix when getting the configured the shader.
 

Protected Member Functions

 Pass ()
 For subclasses that don't want to load from a file.
 
 Pass (const std::string &vertexFilename, const std::string &pixelFilename)
 

Static Protected Member Functions

static shared_ptr< OldShadergetConfiguredShader (const std::string &vertexFilename, const std::string &pixelFilename, const UniversalMaterial &material, const std::string &extraDefines)
 Returns a shader (perhaps from the cache) with arguments and #defines configured for this material.
 

Protected Attributes

std::string m_pixelFilename
 
std::string m_vertexFilename
 

Static Protected Attributes

static ExtraLightPassRef extraLightInstance
 Special case cache for its own subclass.
 
static NonShadowedPassRef nonShadowedInstance
 Special case cache for its own subclass.
 
static ShadowedPassRef shadowedInstance
 Special case cache for its own subclass.
 

Member Typedef Documentation

typedef shared_ptr<Pass> G3D::SuperShader::Pass::Ref

Constructor & Destructor Documentation

G3D::SuperShader::Pass::Pass ( )
protected

For subclasses that don't want to load from a file.

G3D::SuperShader::Pass::Pass ( const std::string vertexFilename,
const std::string pixelFilename 
)
protected

Member Function Documentation

static PassRef G3D::SuperShader::Pass::fromFiles ( const std::string vertexFilename,
const std::string pixelFilename 
)
static

Constructs a new SuperShader pass from the specified vertex and pixel shaders.

static shared_ptr<OldShader> G3D::SuperShader::Pass::getConfiguredShader ( const std::string vertexFilename,
const std::string pixelFilename,
const UniversalMaterial material,
const std::string extraDefines 
)
staticprotected

Returns a shader (perhaps from the cache) with arguments and #defines configured for this material.

Parameters
extraDefinesCode to insert after the material macros; typically compile-time parameters defined by macros.
virtual shared_ptr<OldShader> G3D::SuperShader::Pass::getConfiguredShader ( const UniversalMaterial material,
CullFace  c = CullFace::CURRENT 
)
virtual

Given a material and the current settings on this pass, returns the appropriately configured shader.

Note that this shader may be shared cached between calls and is only affected by state set on the Pass before getConfiguredShader is called.

Parameters
cAffects the subsequent calls to getConfiguredShader by setting the backside argument. If CULL_CURRENT, the current state is unmodified.
extraDefinesCode to insert after the material macros; typically compile-time parameters defined by macros.

Reimplemented in G3D::SuperShader::NonShadowedPass.

static void G3D::SuperShader::Pass::purgeCache ( )
static

Clears the static cache of SuperShader::Pass to clean up memory or allow reloading.

Member Data Documentation

ShaderProgram::ArgList G3D::SuperShader::Pass::args

These will be merged with the UniversalMaterial-based args when applied to the shader.

These arguments will override the UniversalMaterial ones if there are duplicates (although it is not recommended to override UniversalMaterial properties here.)

Subclasses contain helper methods for automatically filling out these arguments, but you can always directly access the full argument list. However, be aware that those arguments will remain until you explicitly clear the list with args.clear().

std::string G3D::SuperShader::Pass::customShaderPrefix

This will be added after the UniversalMaterial-based customShaderPrefix when getting the configured the shader.

ExtraLightPassRef G3D::SuperShader::Pass::extraLightInstance
staticprotected

Special case cache for its own subclass.

std::string G3D::SuperShader::Pass::m_pixelFilename
protected
std::string G3D::SuperShader::Pass::m_vertexFilename
protected
NonShadowedPassRef G3D::SuperShader::Pass::nonShadowedInstance
staticprotected

Special case cache for its own subclass.

ShadowedPassRef G3D::SuperShader::Pass::shadowedInstance
staticprotected

Special case cache for its own subclass.


documentation generated on Thu Nov 8 2012 22:49:27 using doxygen 1.8.2