Support Forum       Library Source       SourceForge Page       G3D Web Page     
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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::NonShadowedPass Class Reference

SuperShader pass that handles NonShadowedSuperShader::LIGHTS_PER_PASS non-shadow casting diffuse and specular, ambient, emissive, reflective, and refractive terms. More...

Inherits G3D::SuperShader::Pass.

Public Types

enum  { LIGHTS_PER_PASS = 4 }
 Number of non-shadowed lights supported in a single pass. More...
 
typedef shared_ptr< PassRef
 

Public Member Functions

virtual shared_ptr< OldShadergetConfiguredShader (const UniversalMaterial &material, CullFace c=CullFace::CURRENT)
 Overrides the default because it requires emissive arguments.
 
void setLighting (const shared_ptr< Lighting > &lighting, const shared_ptr< AmbientOcclusion > &ambientOcclusion)
 Sets the lighting to be used by the next getConfiguredShader call.
 

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 NonShadowedPassRef instance ()
 There is only one instance of this class, which can be obtained by this helper method.
 
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

 NonShadowedPass ()
 

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

Color3 m_emissiveScale
 
float m_environmentMapScale
 
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.
 

Detailed Description

SuperShader pass that handles NonShadowedSuperShader::LIGHTS_PER_PASS non-shadow casting diffuse and specular, ambient, emissive, reflective, and refractive terms.

Used by G3D::ArticulatedModel.

Member Typedef Documentation

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

Member Enumeration Documentation

anonymous enum

Number of non-shadowed lights supported in a single pass.

(Note: Using more lights than this on one object with ArticulatedModel) will be slow because it will make multiple rendering passes.

Enumerator:
LIGHTS_PER_PASS 

Constructor & Destructor Documentation

G3D::SuperShader::NonShadowedPass::NonShadowedPass ( )
protected

Member Function Documentation

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

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 
)
staticprotectedinherited

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::NonShadowedPass::getConfiguredShader ( const UniversalMaterial material,
CullFace  c = CullFace::CURRENT 
)
virtual

Overrides the default because it requires emissive arguments.

Reimplemented from G3D::SuperShader::Pass.

static NonShadowedPassRef G3D::SuperShader::NonShadowedPass::instance ( )
static

There is only one instance of this class, which can be obtained by this helper method.

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

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

void G3D::SuperShader::NonShadowedPass::setLighting ( const shared_ptr< Lighting > &  lighting,
const shared_ptr< AmbientOcclusion > &  ambientOcclusion 
)

Sets the lighting to be used by the next getConfiguredShader call.

Uses these values immediately; does not track the specific lighting reference.

Only the first LIGHTS_PER_PASS non-shadowed lights will be used. If you need more lights, make an additional pass with ExtraLightPass.

Member Data Documentation

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

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
inherited

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

ExtraLightPassRef G3D::SuperShader::Pass::extraLightInstance
staticprotectedinherited

Special case cache for its own subclass.

Color3 G3D::SuperShader::NonShadowedPass::m_emissiveScale
protected
float G3D::SuperShader::NonShadowedPass::m_environmentMapScale
protected
std::string G3D::SuperShader::Pass::m_pixelFilename
protectedinherited
std::string G3D::SuperShader::Pass::m_vertexFilename
protectedinherited
NonShadowedPassRef G3D::SuperShader::Pass::nonShadowedInstance
staticprotectedinherited

Special case cache for its own subclass.

ShadowedPassRef G3D::SuperShader::Pass::shadowedInstance
staticprotectedinherited

Special case cache for its own subclass.


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