| Support Forum Library Source SourceForge Page G3D Web Page |
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< Pass > | Ref |
Public Member Functions | |
| virtual shared_ptr< OldShader > | getConfiguredShader (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< OldShader > | getConfiguredShader (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. | |
SuperShader pass that handles NonShadowedSuperShader::LIGHTS_PER_PASS non-shadow casting diffuse and specular, ambient, emissive, reflective, and refractive terms.
Used by G3D::ArticulatedModel.
|
inherited |
| 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.
|
protected |
|
staticinherited |
Constructs a new SuperShader pass from the specified vertex and pixel shaders.
|
staticprotectedinherited |
Returns a shader (perhaps from the cache) with arguments and #defines configured for this material.
| extraDefines | Code to insert after the material macros; typically compile-time parameters defined by macros. |
|
virtual |
Overrides the default because it requires emissive arguments.
Reimplemented from G3D::SuperShader::Pass.
|
static |
There is only one instance of this class, which can be obtained by this helper method.
|
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.
|
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().
|
inherited |
This will be added after the UniversalMaterial-based customShaderPrefix when getting the configured the shader.
|
staticprotectedinherited |
Special case cache for its own subclass.
|
protected |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
staticprotectedinherited |
Special case cache for its own subclass.
|
staticprotectedinherited |
Special case cache for its own subclass.
1.8.2