OGRE
13.6
Object-Oriented Graphics Rendering Engine
|
Class defining a single pass of a Technique (of a Material): a single rendering call. More...
#include <OgrePass.h>
Classes | |
struct | HashFunc |
Definition of a functor for calculating the hashcode of a Pass. More... | |
Public Types | |
enum | BuiltinHashFunction { MIN_TEXTURE_CHANGE , MIN_GPU_PROGRAM_CHANGE } |
There are some default hash functions used to order passes so that render state changes are minimised, this enumerates them. More... | |
typedef ConstVectorIterator< TextureUnitStates > | ConstTextureUnitStateIterator |
typedef std::set< Pass * > | PassSet |
typedef VectorIterator< TextureUnitStates > | TextureUnitStateIterator |
typedef std::vector< TextureUnitState * > | TextureUnitStates |
Public Member Functions | |
Pass (Technique *parent, unsigned short index) | |
Default constructor. More... | |
Pass (Technique *parent, unsigned short index, const Pass &oth) | |
Copy constructor. More... | |
~Pass () | |
void | _dirtyHash (void) |
Mark the hash as dirty. More... | |
void | _load (void) |
Internal method for loading this pass. More... | |
void | _notifyIndex (unsigned short index) |
Internal method to adjust pass index. More... | |
void | _notifyNeedsRecompile (void) |
Tells the pass that it needs recompilation. More... | |
void | _prepare (void) |
Internal method for preparing to load this pass. More... | |
void | _recalculateHash (void) |
Internal method for recalculating the hash. More... | |
Pass * | _split (unsigned short numUnits) |
Splits this Pass to one which can be handled in the number of texture units specified. More... | |
void | _unload (void) |
Internal method for unloading this pass. More... | |
void | _unprepare (void) |
Internal method for undoing the load preparartion for this pass. More... | |
void | _updateAutoParams (const AutoParamDataSource *source, uint16 variabilityMask) const |
Update automatic parameters. More... | |
size_t | calculateSize (void) const |
CullingMode | getCullingMode (void) const |
Returns the culling mode for geometry rendered with this pass. More... | |
uint32 | getHash (void) const |
Gets the 'hash' of this pass, ie a precomputed number to use for sorting. More... | |
IlluminationStage | getIlluminationStage () const |
Get the manually assigned illumination stage, if any. More... | |
unsigned short | getIndex (void) const |
Gets the index of this Pass in the parent Technique. More... | |
bool | getLightClipPlanesEnabled () const |
Gets whether or not this pass will be clipped by user clips planes bounding the area covered by the light. More... | |
bool | getLightScissoringEnabled () const |
Gets whether or not this pass will be clipped by a scissor rectangle encompassing the lights that are being used in it. More... | |
float | getLineWidth () const |
ManualCullingMode | getManualCullingMode (void) const |
Retrieves the manual culling mode for this pass. More... | |
const String & | getName (void) const |
Get the name of the pass. More... | |
bool | getNormaliseNormals (void) const |
Returns true if this pass has auto-normalisation of normals set. More... | |
Technique * | getParent (void) const |
Gets the parent Technique. More... | |
size_t | getPassIterationCount (void) const |
Gets the pass iteration count value. More... | |
PolygonMode | getPolygonMode (void) const |
Returns the type of light shading to be used. More... | |
bool | getPolygonModeOverrideable (void) const |
Gets whether this renderable's chosen detail level can be overridden (downgraded) by the camera setting. More... | |
const String & | getResourceGroup (void) const |
Gets the resource group of the ultimate parent Material. More... | |
ShadeOptions | getShadingMode (void) const |
Returns the type of light shading to be used. More... | |
bool | getTransparentSortingEnabled (void) const |
Returns whether or not transparent sorting is enabled. More... | |
bool | getTransparentSortingForced (void) const |
Returns whether or not transparent sorting is forced. More... | |
UserObjectBindings & | getUserObjectBindings () |
Class that provides convenient interface to establish a linkage between custom user application objects and Ogre core classes. More... | |
const UserObjectBindings & | getUserObjectBindings () const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
bool | isAmbientOnly (void) const |
Returns whether this pass is ambient only. More... | |
bool | isLoaded (void) const |
Is this loaded? More... | |
bool | isTransparent (void) const |
Returns true if this pass has some element of transparency. More... | |
OGRE_MUTEX (mGpuProgramChangeMutex) | |
OGRE_MUTEX (mTexUnitChangeMutex) | |
OGRE_STATIC_MUTEX (msDirtyHashListMutex) | |
OGRE_STATIC_MUTEX (msPassGraveyardMutex) | |
Pass & | operator= (const Pass &oth) |
Operator = overload. More... | |
void | queueForDeletion (void) |
Queue this pass for deletion when appropriate. More... | |
void | setCullingMode (CullingMode mode) |
Sets the culling mode for this pass based on the 'vertex winding'. More... | |
void | setIlluminationStage (IlluminationStage is) |
Manually set which illumination stage this pass is a member of. More... | |
void | setLightClipPlanesEnabled (bool enabled) |
Sets whether or not this pass will be clipped by user clips planes bounding the area covered by the light. More... | |
void | setLightScissoringEnabled (bool enabled) |
Sets whether or not this pass will be clipped by a scissor rectangle encompassing the lights that are being used in it. More... | |
void | setLineWidth (float width) |
set the line width for this pass More... | |
void | setManualCullingMode (ManualCullingMode mode) |
Sets the manual culling mode, performed by CPU rather than hardware. More... | |
void | setName (const String &name) |
Set the name of the pass. More... | |
void | setNormaliseNormals (bool normalise) |
If set to true, this forces normals to be normalised dynamically by the hardware for this pass. More... | |
void | setPassIterationCount (const size_t count) |
set the number of iterations that this pass should perform when doing fast multi pass operation. More... | |
void | setPolygonMode (PolygonMode mode) |
Sets the type of polygon rendering required. More... | |
void | setPolygonModeOverrideable (bool override) |
Sets whether the PolygonMode set on this pass can be downgraded by the camera. More... | |
void | setShadingMode (ShadeOptions mode) |
Sets the type of light shading required. More... | |
void | setTransparentSortingEnabled (bool enabled) |
Sets whether or not transparent sorting is enabled. More... | |
void | setTransparentSortingForced (bool enabled) |
Sets whether or not transparent sorting is forced. More... | |
Surface properties | |
void | setAmbient (float red, float green, float blue) |
Sets the ambient colour reflectance properties of this pass. More... | |
void | setAmbient (const ColourValue &ambient) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setDiffuse (float red, float green, float blue, float alpha) |
Sets the diffuse colour reflectance properties of this pass. More... | |
void | setDiffuse (const ColourValue &diffuse) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setSpecular (float red, float green, float blue, float alpha) |
Sets the specular colour reflectance properties of this pass. More... | |
void | setSpecular (const ColourValue &specular) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setShininess (float val) |
Sets the shininess of the pass, affecting the size of specular highlights. More... | |
void | setSelfIllumination (float red, float green, float blue) |
Sets the amount of self-illumination an object has. More... | |
void | setSelfIllumination (const ColourValue &selfIllum) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setEmissive (float red, float green, float blue) |
Sets the amount of self-illumination an object has. More... | |
void | setEmissive (const ColourValue &emissive) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setVertexColourTracking (TrackVertexColourType tracking) |
Sets which material properties follow the vertex colour. More... | |
const ColourValue & | getAmbient (void) const |
Gets the ambient colour reflectance of the pass. More... | |
const ColourValue & | getDiffuse (void) const |
Gets the diffuse colour reflectance of the pass. More... | |
const ColourValue & | getSpecular (void) const |
Gets the specular colour reflectance of the pass. More... | |
const ColourValue & | getSelfIllumination (void) const |
Gets the self illumination colour of the pass. More... | |
const ColourValue & | getEmissive (void) const |
Gets the self illumination colour of the pass. More... | |
float | getShininess (void) const |
Gets the 'shininess' property of the pass (affects specular highlights). More... | |
TrackVertexColourType | getVertexColourTracking (void) const |
Gets which material properties follow the vertex colour. More... | |
void | setLightingEnabled (bool enabled) |
Sets whether or not dynamic lighting is enabled. More... | |
bool | getLightingEnabled (void) const |
Returns whether or not dynamic lighting is enabled. More... | |
Point Sprites | |
float | getPointSize (void) const |
Gets the point size of the pass. More... | |
void | setPointSize (float ps) |
Sets the point size of this pass. More... | |
void | setPointSpritesEnabled (bool enabled) |
Sets whether points will be rendered as textured quads or plain dots. More... | |
bool | getPointSpritesEnabled (void) const |
Returns whether point sprites are enabled when rendering a point list. More... | |
void | setPointAttenuation (bool enabled, float constant=0.0f, float linear=1.0f, float quadratic=0.0f) |
Sets how points are attenuated with distance. More... | |
bool | isPointAttenuationEnabled (void) const |
Returns whether points are attenuated with distance. More... | |
float | getPointAttenuationConstant (void) const |
Returns the constant coefficient of point attenuation. More... | |
float | getPointAttenuationLinear (void) const |
Returns the linear coefficient of point attenuation. More... | |
float | getPointAttenuationQuadratic (void) const |
Returns the quadratic coefficient of point attenuation. More... | |
const Vector4f & | getPointAttenuation () const |
get all point attenuation params as (size, constant, linear, quadratic) More... | |
void | setPointMinSize (Real min) |
Set the minimum point size, when point attenuation is in use. More... | |
Real | getPointMinSize (void) const |
Get the minimum point size, when point attenuation is in use. More... | |
void | setPointMaxSize (Real max) |
Set the maximum point size, when point attenuation is in use. More... | |
Real | getPointMaxSize (void) const |
Get the maximum point size, when point attenuation is in use. More... | |
Texture Units | |
TextureUnitState * | createTextureUnitState (const String &textureName, unsigned short texCoordSet=0) |
Inserts a new TextureUnitState object into the Pass. More... | |
TextureUnitState * | createTextureUnitState (void) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | addTextureUnitState (TextureUnitState *state) |
Adds the passed in TextureUnitState, to the existing Pass. More... | |
TextureUnitState * | getTextureUnitState (size_t index) const |
Retrieves a const pointer to a texture unit state. More... | |
TextureUnitState * | getTextureUnitState (const String &name) const |
Retrieves the Texture Unit State matching name. More... | |
unsigned short | getTextureUnitStateIndex (const TextureUnitState *state) const |
Retrieve the index of the Texture Unit State in the pass. More... | |
TextureUnitStateIterator | getTextureUnitStateIterator (void) |
Get an iterator over the TextureUnitStates contained in this Pass. More... | |
ConstTextureUnitStateIterator | getTextureUnitStateIterator (void) const |
Get an iterator over the TextureUnitStates contained in this Pass. More... | |
const TextureUnitStates & | getTextureUnitStates () const |
Get the TextureUnitStates contained in this Pass. More... | |
void | removeTextureUnitState (unsigned short index) |
Removes the indexed texture unit state from this pass. More... | |
void | removeAllTextureUnitStates (void) |
Removes all texture unit settings. More... | |
size_t | getNumTextureUnitStates (void) const |
Returns the number of texture unit settings. More... | |
unsigned short | _getTextureUnitWithContentTypeIndex (TextureUnitState::ContentType contentType, unsigned short index) const |
Gets the 'nth' texture which references the given content type. More... | |
void | setTextureFiltering (TextureFilterOptions filterType) |
Set texture filtering for every texture unit. More... | |
void | setTextureAnisotropy (unsigned int maxAniso) |
Sets the anisotropy level to be used for all textures. More... | |
Scene Blending | |
void | setSceneBlending (const SceneBlendType sbt) |
Sets the kind of blending this pass has with the existing contents of the scene. More... | |
void | setSeparateSceneBlending (const SceneBlendType sbt, const SceneBlendType sbta) |
Sets the kind of blending this pass has with the existing contents of the scene, separately for color and alpha channels. More... | |
void | setSceneBlending (const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor) |
Allows very fine control of blending this Pass with the existing contents of the scene. More... | |
void | setSeparateSceneBlending (const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor, const SceneBlendFactor sourceFactorAlpha, const SceneBlendFactor destFactorAlpha) |
Allows very fine control of blending this Pass with the existing contents of the scene. More... | |
const ColourBlendState & | getBlendState () const |
Retrieves the complete blend state of this pass. More... | |
SceneBlendFactor | getSourceBlendFactor () const |
Retrieves the source blending factor for the material. More... | |
SceneBlendFactor | getDestBlendFactor () const |
Retrieves the destination blending factor for the material. More... | |
SceneBlendFactor | getSourceBlendFactorAlpha () const |
Retrieves the alpha source blending factor for the material. More... | |
SceneBlendFactor | getDestBlendFactorAlpha () const |
Retrieves the alpha destination blending factor for the material. More... | |
void | setSceneBlendingOperation (SceneBlendOperation op) |
Sets the specific operation used to blend source and destination pixels together. More... | |
void | setSeparateSceneBlendingOperation (SceneBlendOperation op, SceneBlendOperation alphaOp) |
Sets the specific operation used to blend source and destination pixels together. More... | |
SceneBlendOperation | getSceneBlendingOperation () const |
Returns the current blending operation. More... | |
SceneBlendOperation | getSceneBlendingOperationAlpha () const |
Returns the current alpha blending operation. More... | |
void | setColourWriteEnabled (bool enabled) |
Sets whether or not colour buffer writing is enabled for this Pass. More... | |
bool | getColourWriteEnabled (void) const |
Determines if colour buffer writing is enabled for this pass i.e. More... | |
void | setColourWriteEnabled (bool red, bool green, bool blue, bool alpha) |
Sets which colour buffer channels are enabled for writing for this Pass. More... | |
void | getColourWriteEnabled (bool &red, bool &green, bool &blue, bool &alpha) const |
Determines which colour buffer channels are enabled for writing for this pass. More... | |
Depth Testing | |
void | setDepthCheckEnabled (bool enabled) |
Sets whether or not this pass renders with depth-buffer checking on or not. More... | |
bool | getDepthCheckEnabled (void) const |
Returns whether or not this pass renders with depth-buffer checking on or not. More... | |
void | setDepthWriteEnabled (bool enabled) |
Sets whether or not this pass renders with depth-buffer writing on or not. More... | |
bool | getDepthWriteEnabled (void) const |
Returns whether or not this pass renders with depth-buffer writing on or not. More... | |
void | setDepthFunction (CompareFunction func) |
Sets the function used to compare depth values when depth checking is on. More... | |
CompareFunction | getDepthFunction (void) const |
Returns the function used to compare depth values when depth checking is on. More... | |
void | setDepthBias (float constantBias, float slopeScaleBias=0.0f) |
Sets the depth bias to be used for this material. More... | |
float | getDepthBiasConstant (void) const |
Retrieves the const depth bias value as set by setDepthBias. More... | |
float | getDepthBiasSlopeScale (void) const |
Retrieves the slope-scale depth bias value as set by setDepthBias. More... | |
void | setIterationDepthBias (float biasPerIteration) |
Sets a factor which derives an additional depth bias from the number of times a pass is iterated. More... | |
float | getIterationDepthBias () const |
Gets a factor which derives an additional depth bias from the number of times a pass is iterated. More... | |
Fogging | |
void | setFog (bool overrideScene, FogMode mode=FOG_NONE, const ColourValue &colour=ColourValue::White, float expDensity=0.001f, float linearStart=0.0f, float linearEnd=1.0f) |
Sets the fogging mode applied to this pass. More... | |
bool | getFogOverride (void) const |
Returns true if this pass is to override the scene fog settings. More... | |
FogMode | getFogMode (void) const |
Returns the fog mode for this pass. More... | |
const ColourValue & | getFogColour (void) const |
Returns the fog colour for the scene. More... | |
float | getFogStart (void) const |
Returns the fog start distance for this pass. More... | |
float | getFogEnd (void) const |
Returns the fog end distance for this pass. More... | |
float | getFogDensity (void) const |
Returns the fog density for this pass. More... | |
Alpha Rejection | |
void | setAlphaRejectSettings (CompareFunction func, unsigned char value, bool alphaToCoverageEnabled=false) |
Sets the way the pass will have use alpha to totally reject pixels from the pipeline. More... | |
void | setAlphaRejectFunction (CompareFunction func) |
Sets the alpha reject function. More... | |
void | setAlphaRejectValue (unsigned char val) |
Gets the alpha reject value. More... | |
CompareFunction | getAlphaRejectFunction (void) const |
Gets the alpha reject function. More... | |
unsigned char | getAlphaRejectValue (void) const |
Gets the alpha reject value. More... | |
void | setAlphaToCoverageEnabled (bool enabled) |
Sets whether to use alpha to coverage (A2C) when blending alpha rejected values. More... | |
bool | isAlphaToCoverageEnabled () const |
Gets whether to use alpha to coverage (A2C) when blending alpha rejected values. More... | |
Light Iteration | |
void | setMaxSimultaneousLights (unsigned short maxLights) |
Sets the maximum number of lights to be used by this pass. More... | |
unsigned short | getMaxSimultaneousLights (void) const |
Gets the maximum number of lights to be used by this pass. More... | |
void | setStartLight (unsigned short startLight) |
Sets the light index that this pass will start at in the light list. More... | |
unsigned short | getStartLight (void) const |
Gets the light index that this pass will start at in the light list. More... | |
void | setLightMask (uint32 mask) |
Sets the light mask which can be matched to specific light flags to be handled by this pass. More... | |
uint32 | getLightMask () const |
Gets the light mask controlling which lights are used for this pass. More... | |
void | setIteratePerLight (bool enabled, bool onlyForOneLightType=true, Light::LightTypes lightType=Light::LT_POINT) |
Sets whether or not this pass should iterate per light or number of lights which can affect the object being rendered. More... | |
bool | getIteratePerLight (void) const |
Does this pass run once for every light in range? More... | |
bool | getRunOnlyForOneLightType (void) const |
Does this pass run only for a single light type (if getIteratePerLight is true). More... | |
Light::LightTypes | getOnlyLightType () const |
Gets the single light type this pass runs for if getIteratePerLight and getRunOnlyForOneLightType are both true. More... | |
void | setLightCountPerIteration (unsigned short c) |
If light iteration is enabled, determine the number of lights per iteration. More... | |
unsigned short | getLightCountPerIteration (void) const |
If light iteration is enabled, determine the number of lights per iteration. More... | |
Gpu Programs | |
bool | isProgrammable (void) const |
Returns true if this pass is programmable i.e. includes either a vertex or fragment program. More... | |
bool | hasVertexProgram (void) const |
Returns true if this pass uses a programmable vertex pipeline. More... | |
bool | hasFragmentProgram (void) const |
Returns true if this pass uses a programmable fragment pipeline. More... | |
bool | hasGeometryProgram (void) const |
Returns true if this pass uses a programmable geometry pipeline. More... | |
bool | hasTessellationHullProgram (void) const |
Returns true if this pass uses a programmable tessellation control pipeline. More... | |
bool | hasTessellationDomainProgram (void) const |
Returns true if this pass uses a programmable tessellation control pipeline. More... | |
bool | hasComputeProgram (void) const |
Returns true if this pass uses a programmable compute pipeline. More... | |
const GpuProgramPtr & | getGpuProgram (GpuProgramType programType) const |
Gets the Gpu program used by this pass, only available after _load() More... | |
const GpuProgramPtr & | getVertexProgram (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const GpuProgramPtr & | getFragmentProgram (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const GpuProgramPtr & | getGeometryProgram (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const GpuProgramPtr & | getTessellationHullProgram (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const GpuProgramPtr & | getTessellationDomainProgram (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const GpuProgramPtr & | getComputeProgram (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
bool | hasGpuProgram (GpuProgramType programType) const |
void | setGpuProgram (GpuProgramType type, const GpuProgramPtr &prog, bool resetParams=true) |
Sets the details of the program to use. More... | |
void | setGpuProgram (GpuProgramType type, const String &name, bool resetParams=true) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setFragmentProgram (const String &name, bool resetParams=true) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setGeometryProgram (const String &name, bool resetParams=true) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setTessellationDomainProgram (const String &name, bool resetParams=true) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setTessellationHullProgram (const String &name, bool resetParams=true) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setVertexProgram (const String &name, bool resetParams=true) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setComputeProgram (const String &name, bool resetParams=true) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const String & | getGpuProgramName (GpuProgramType type) const |
Gets the name of the program used by this pass. More... | |
const String & | getFragmentProgramName (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const String & | getGeometryProgramName (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const String & | getTessellationDomainProgramName (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const String & | getTessellationHullProgramName (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const String & | getVertexProgramName (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const String & | getComputeProgramName (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setGpuProgramParameters (GpuProgramType type, const GpuProgramParametersSharedPtr ¶ms) |
Sets the Gpu program parameters. More... | |
void | setVertexProgramParameters (GpuProgramParametersSharedPtr params) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setFragmentProgramParameters (GpuProgramParametersSharedPtr params) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setGeometryProgramParameters (GpuProgramParametersSharedPtr params) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setTessellationHullProgramParameters (GpuProgramParametersSharedPtr params) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setTessellationDomainProgramParameters (GpuProgramParametersSharedPtr params) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
void | setComputeProgramParameters (GpuProgramParametersSharedPtr params) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
const GpuProgramParametersSharedPtr & | getGpuProgramParameters (GpuProgramType type) const |
Gets the Gpu program parameters used by this pass. More... | |
GpuProgramParametersSharedPtr | getVertexProgramParameters (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
GpuProgramParametersSharedPtr | getFragmentProgramParameters (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
GpuProgramParametersSharedPtr | getGeometryProgramParameters (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
GpuProgramParametersSharedPtr | getTessellationHullProgramParameters (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
GpuProgramParametersSharedPtr | getTessellationDomainProgramParameters (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
GpuProgramParametersSharedPtr | getComputeProgramParameters (void) const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. More... | |
Static Public Member Functions | |
static void | clearDirtyHashList (void) |
Static method to reset the list of passes which need their hash values recalculated. More... | |
static HashFunc * | getBuiltinHashFunction (BuiltinHashFunction builtin) |
Get the builtin hash function. More... | |
static const PassSet & | getDirtyHashList (void) |
Static method to retrieve all the Passes which need their hash values recalculated. More... | |
static HashFunc * | getHashFunction (void) |
Get the hash function used for all passes. More... | |
static const PassSet & | getPassGraveyard (void) |
Static method to retrieve all the Passes which are pending deletion. More... | |
static void | processPendingPassUpdates (void) |
Process all dirty and pending deletion passes. More... | |
static void | setHashFunction (BuiltinHashFunction builtin) |
Sets one of the default hash functions to be used. More... | |
static void | setHashFunction (HashFunc *hashFunc) |
Set the hash function used for all passes. More... | |
Class defining a single pass of a Technique (of a Material): a single rendering call.
If a pass does not explicitly use a vertex or fragment shader, Ogre will calculate lighting based on the Direct3D Light Model as:
If at least one shader is used, the pass is considered programmable and the lighting is up to the shader.
Rendering can be repeated with many passes for more complex effects.
Turning dynamic lighting off makes any ambient, diffuse, specular, emissive and shading properties for this pass redundant. If lighting is turned off, all objects rendered using the pass will be fully lit. When lighting is turned on, objects are lit according to their vertex normals for diffuse and specular light, and globally for ambient and emissive.
$$ passBase = C $$
where \(C = (1, 1, 1)\) or a tracked vertex attribute if TVC_DIFFUSE is set.
\[ passBase = G_a \cdot C_a + \sum^N_i ( C_d \cdot L^{(i)}_d + C_s \cdot L^{(i)}_s ) + C_e \]
where
Programmable passes are complex to define, because they require custom programs and you have to set all constant inputs to the programs (like the position of lights, any base material colours you wish to use etc), but they do give you much total flexibility over the algorithms used to render your pass, and you can create some effects which are impossible with a fixed-function pass. On the other hand, you can define a fixed-function pass in very little time, and you can use a range of fixed-function effects like environment mapping very easily, plus your pass will be more likely to be compatible with older hardware. There are pros and cons to both, just remember that if you use a programmable pass to create some great effects, allow more time for definition and testing.
typedef std::vector<TextureUnitState*> Ogre::Pass::TextureUnitStates |
typedef std::set<Pass*> Ogre::Pass::PassSet |
There are some default hash functions used to order passes so that render state changes are minimised, this enumerates them.
Ogre::Pass::Pass | ( | Technique * | parent, |
unsigned short | index | ||
) |
Default constructor.
Ogre::Pass::~Pass | ( | ) |
Ogre::Pass::OGRE_STATIC_MUTEX | ( | msDirtyHashListMutex | ) |
Ogre::Pass::OGRE_STATIC_MUTEX | ( | msPassGraveyardMutex | ) |
Ogre::Pass::OGRE_MUTEX | ( | mTexUnitChangeMutex | ) |
Ogre::Pass::OGRE_MUTEX | ( | mGpuProgramChangeMutex | ) |
size_t Ogre::Pass::calculateSize | ( | void | ) | const |
|
inline |
|
inline |
Set the name of the pass.
|
inline |
Get the name of the pass.
void Ogre::Pass::setAmbient | ( | float | red, |
float | green, | ||
float | blue | ||
) |
Sets the ambient colour reflectance properties of this pass.
This property determines how much ambient light (directionless global light) is reflected. The default is full white, meaning objects are completely globally illuminated. Reduce this if you want to see diffuse or specular light effects, or change the blend of colours to make the object have a base colour other than white.
It is also possible to make the ambient reflectance track the vertex colour as defined in the mesh instead of the colour values.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setDiffuse | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha | ||
) |
Sets the diffuse colour reflectance properties of this pass.
This property determines how much diffuse light (light from instances of the Light class in the scene) is reflected. The default is full white, meaning objects reflect the maximum white light they can from Light objects.
It is also possible to make the diffuse reflectance track the vertex colour as defined in the mesh instead of the colour values.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setSpecular | ( | float | red, |
float | green, | ||
float | blue, | ||
float | alpha | ||
) |
Sets the specular colour reflectance properties of this pass.
This property determines how much specular light (highlights from instances of the Light class in the scene) is reflected. The default is to reflect no specular light.
It is also possible to make the specular reflectance track the vertex colour as defined in the mesh instead of the colour values.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Sets the shininess of the pass, affecting the size of specular highlights.
The higher the value of the shininess parameter, the sharper the highlight i.e. the radius is smaller. Beware of using shininess values in the range of 0 to 1 since this causes the the specular colour to be applied to the whole surface that has the material applied to it. When the viewing angle to the surface changes, ugly flickering will also occur when shininess is in the range of 0 to 1. Shininess values between 1 and 128 work best in both DirectX and OpenGL renderers.
void Ogre::Pass::setSelfIllumination | ( | float | red, |
float | green, | ||
float | blue | ||
) |
Sets the amount of self-illumination an object has.
If an object is self-illuminating, it does not need external sources to light it, ambient or otherwise. It's like the object has it's own personal ambient light. This property is rarely useful since you can already specify per-pass ambient light, but is here for completeness.
It is also possible to make the emissive reflectance track the vertex colour as defined in the mesh instead of the colour values.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Sets the amount of self-illumination an object has.
If an object is self-illuminating, it does not need external sources to light it, ambient or otherwise. It's like the object has it's own personal ambient light. This property is rarely useful since you can already specify per-pass ambient light, but is here for completeness.
It is also possible to make the emissive reflectance track the vertex colour as defined in the mesh instead of the colour values.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
|
inline |
Sets which material properties follow the vertex colour.
|
inline |
Gets the ambient colour reflectance of the pass.
|
inline |
Gets the diffuse colour reflectance of the pass.
|
inline |
Gets the specular colour reflectance of the pass.
|
inline |
Gets the self illumination colour of the pass.
|
inline |
Gets the self illumination colour of the pass.
|
inline |
Gets the 'shininess' property of the pass (affects specular highlights).
|
inline |
Gets which material properties follow the vertex colour.
|
inline |
Sets whether or not dynamic lighting is enabled.
Turning dynamic lighting off makes any ambient, diffuse, specular, emissive and shading properties for this pass redundant. If lighting is turned off, all objects rendered using the pass will be fully lit. When lighting is turned on, objects are lit according to their vertex normals for diffuse and specular light, and globally for ambient and emissive.
|
inline |
Returns whether or not dynamic lighting is enabled.
|
inline |
set the line width for this pass
This property determines what width is used to render lines.
|
inline |
|
inline |
Gets the point size of the pass.
|
inline |
Sets the point size of this pass.
This setting allows you to change the size of points when rendering a point list, or a list of point sprites. The interpretation of this command depends on the Ogre::Pass::setPointAttenuation option - if it is off (the default), the point size is in screen pixels, if it is on, it expressed as normalised screen coordinates (1.0 is the height of the screen) when the point is at the origin.
|
inline |
Sets whether points will be rendered as textured quads or plain dots.
This setting specifies whether or not hardware point sprite rendering is enabled for this pass. Enabling it means that a point list is rendered as a list of quads rather than a list of dots. It is very useful to use this option if you are using a BillboardSet and only need to use point oriented billboards which are all of the same size. You can also use it for any other point list render.
|
inline |
Returns whether point sprites are enabled when rendering a point list.
void Ogre::Pass::setPointAttenuation | ( | bool | enabled, |
float | constant = 0.0f , |
||
float | linear = 1.0f , |
||
float | quadratic = 0.0f |
||
) |
Sets how points are attenuated with distance.
When performing point rendering or point sprite rendering, point size can be attenuated with distance. The equation for doing this is
$$attenuation = 1 / (constant + linear * dist + quadratic * d^2)$$
For example, to disable distance attenuation (constant screensize) you would set constant to 1, and linear and quadratic to 0. A standard perspective attenuation would be 0, 1, 0 respectively.
The resulting size is clamped to the minimum and maximum point size.
enabled | Whether point attenuation is enabled |
constant,linear,quadratic | Parameters to the attenuation function defined above |
|
inline |
Returns whether points are attenuated with distance.
|
inline |
Returns the constant coefficient of point attenuation.
|
inline |
Returns the linear coefficient of point attenuation.
|
inline |
Returns the quadratic coefficient of point attenuation.
|
inline |
get all point attenuation params as (size, constant, linear, quadratic)
void Ogre::Pass::setPointMinSize | ( | Real | min | ) |
Set the minimum point size, when point attenuation is in use.
Real Ogre::Pass::getPointMinSize | ( | void | ) | const |
Get the minimum point size, when point attenuation is in use.
void Ogre::Pass::setPointMaxSize | ( | Real | max | ) |
Set the maximum point size, when point attenuation is in use.
Real Ogre::Pass::getPointMaxSize | ( | void | ) | const |
Get the maximum point size, when point attenuation is in use.
TextureUnitState* Ogre::Pass::createTextureUnitState | ( | const String & | textureName, |
unsigned short | texCoordSet = 0 |
||
) |
Inserts a new TextureUnitState object into the Pass.
textureName | The basic name of the texture e.g. brickwall.jpg, stonefloor.png |
texCoordSet | The index of the texture coordinate set to use. |
TextureUnitState* Ogre::Pass::createTextureUnitState | ( | void | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::addTextureUnitState | ( | TextureUnitState * | state | ) |
Adds the passed in TextureUnitState, to the existing Pass.
state | The Texture Unit State to be attached to this pass. It must not be attached to another pass. |
|
inline |
Retrieves a const pointer to a texture unit state.
TextureUnitState* Ogre::Pass::getTextureUnitState | ( | const String & | name | ) | const |
Retrieves the Texture Unit State matching name.
Returns 0 if name match is not found.
unsigned short Ogre::Pass::getTextureUnitStateIndex | ( | const TextureUnitState * | state | ) | const |
TextureUnitStateIterator Ogre::Pass::getTextureUnitStateIterator | ( | void | ) |
Get an iterator over the TextureUnitStates contained in this Pass.
ConstTextureUnitStateIterator Ogre::Pass::getTextureUnitStateIterator | ( | void | ) | const |
Get an iterator over the TextureUnitStates contained in this Pass.
|
inline |
Get the TextureUnitStates contained in this Pass.
void Ogre::Pass::removeTextureUnitState | ( | unsigned short | index | ) |
Removes the indexed texture unit state from this pass.
void Ogre::Pass::removeAllTextureUnitStates | ( | void | ) |
Removes all texture unit settings.
|
inline |
Returns the number of texture unit settings.
unsigned short Ogre::Pass::_getTextureUnitWithContentTypeIndex | ( | TextureUnitState::ContentType | contentType, |
unsigned short | index | ||
) | const |
Gets the 'nth' texture which references the given content type.
void Ogre::Pass::setTextureFiltering | ( | TextureFilterOptions | filterType | ) |
Set texture filtering for every texture unit.
void Ogre::Pass::setTextureAnisotropy | ( | unsigned int | maxAniso | ) |
Sets the anisotropy level to be used for all textures.
void Ogre::Pass::setSceneBlending | ( | const SceneBlendType | sbt | ) |
Sets the kind of blending this pass has with the existing contents of the scene.
Whereas the texture blending operations seen in the TextureUnitState class are concerned with blending between texture layers, this blending is about combining the output of the Pass as a whole with the existing contents of the rendering target. This blending therefore allows object transparency and other special effects. If all passes in a technique have a scene blend, then the whole technique is considered to be transparent.
This method allows you to select one of a number of predefined blending types. If you require more control than this, use the alternative version of this method which allows you to specify source and destination blend factors.
sbt | One of the predefined SceneBlendType blending types |
void Ogre::Pass::setSeparateSceneBlending | ( | const SceneBlendType | sbt, |
const SceneBlendType | sbta | ||
) |
Sets the kind of blending this pass has with the existing contents of the scene, separately for color and alpha channels.
This method allows you to select one of a number of predefined blending types. If you require more control than this, use the alternative version of this method which allows you to specify source and destination blend factors.
sbt | One of the predefined SceneBlendType blending types for the color channel |
sbta | One of the predefined SceneBlendType blending types for the alpha channel |
void Ogre::Pass::setSceneBlending | ( | const SceneBlendFactor | sourceFactor, |
const SceneBlendFactor | destFactor | ||
) |
Allows very fine control of blending this Pass with the existing contents of the scene.
This version of the method allows complete control over the blending operation, by specifying the source and destination blending factors.
By default the operation is Ogre::SBO_ADD, which creates this equation
$$final = (passOutput * sourceFactor) + (frameBuffer * destFactor)$$
Each of the factors is specified as one of Ogre::SceneBlendFactor.
By setting a different Ogre::SceneBlendOperation you can achieve a different effect.
sourceFactor | The source factor in the above calculation, i.e. multiplied by the output of the Pass. |
destFactor | The destination factor in the above calculation, i.e. multiplied by the Frame Buffer contents. |
void Ogre::Pass::setSeparateSceneBlending | ( | const SceneBlendFactor | sourceFactor, |
const SceneBlendFactor | destFactor, | ||
const SceneBlendFactor | sourceFactorAlpha, | ||
const SceneBlendFactor | destFactorAlpha | ||
) |
Allows very fine control of blending this Pass with the existing contents of the scene.
This version of the method allows complete control over the blending operation, by specifying the source and destination blending factors.
By default the operation is Ogre::SBO_ADD, which creates this equation
$$final = (passOutput * sourceFactor) + (frameBuffer * destFactor)$$
Each of the factors is specified as one of Ogre::SceneBlendFactor.
By setting a different Ogre::SceneBlendOperation you can achieve a different effect.
sourceFactor | The source factor in the above calculation, i.e. multiplied by the output of the Pass. |
destFactor | The destination factor in the above calculation, i.e. multiplied by the Frame Buffer contents. |
sourceFactorAlpha | The alpha source factor in the above calculation, i.e. multiplied by the output of the Pass. |
destFactorAlpha | The alpha destination factor in the above calculation, i.e. multiplied by the Frame Buffer alpha. |
|
inline |
Retrieves the complete blend state of this pass.
|
inline |
Retrieves the source blending factor for the material.
References Ogre::ColourBlendState::sourceFactor.
|
inline |
Retrieves the destination blending factor for the material.
References Ogre::ColourBlendState::destFactor.
|
inline |
Retrieves the alpha source blending factor for the material.
References Ogre::ColourBlendState::sourceFactorAlpha.
|
inline |
Retrieves the alpha destination blending factor for the material.
References Ogre::ColourBlendState::destFactorAlpha.
void Ogre::Pass::setSceneBlendingOperation | ( | SceneBlendOperation | op | ) |
Sets the specific operation used to blend source and destination pixels together.
op | The blending operation mode to use for this pass |
void Ogre::Pass::setSeparateSceneBlendingOperation | ( | SceneBlendOperation | op, |
SceneBlendOperation | alphaOp | ||
) |
Sets the specific operation used to blend source and destination pixels together.
This function allows more control over blending since it allows you to select different blending modes for the color and alpha channels
op | The blending operation mode to use for this pass |
alphaOp | The blending operation mode to use for alpha channels in this pass |
|
inline |
Returns the current blending operation.
References Ogre::ColourBlendState::operation.
|
inline |
Returns the current alpha blending operation.
References Ogre::ColourBlendState::alphaOperation.
void Ogre::Pass::setColourWriteEnabled | ( | bool | enabled | ) |
Sets whether or not colour buffer writing is enabled for this Pass.
If colour writing is off no visible pixels are written to the screen during this pass. You might think this is useless, but if you render with colour writing off, and with very minimal other settings, you can use this pass to initialise the depth buffer before subsequently rendering other passes which fill in the colour data. This can give you significant performance boosts on some newer cards, especially when using complex fragment programs, because if the depth check fails then the fragment program is never run.
bool Ogre::Pass::getColourWriteEnabled | ( | void | ) | const |
Determines if colour buffer writing is enabled for this pass i.e.
when at least one colour channel is enabled for writing.
void Ogre::Pass::setColourWriteEnabled | ( | bool | red, |
bool | green, | ||
bool | blue, | ||
bool | alpha | ||
) |
Sets which colour buffer channels are enabled for writing for this Pass.
void Ogre::Pass::getColourWriteEnabled | ( | bool & | red, |
bool & | green, | ||
bool & | blue, | ||
bool & | alpha | ||
) | const |
Determines which colour buffer channels are enabled for writing for this pass.
bool Ogre::Pass::isTransparent | ( | void | ) | const |
Returns true if this pass has some element of transparency.
|
inline |
Sets whether or not this pass renders with depth-buffer checking on or not.
If depth-buffer checking is on, whenever a pixel is about to be written to the frame buffer the depth buffer is checked to see if the pixel is in front of all other pixels written at that point. If not, the pixel is not written.
If depth checking is off, pixels are written no matter what has been rendered before. Also see setDepthFunction for more advanced depth check configuration.
|
inline |
Returns whether or not this pass renders with depth-buffer checking on or not.
|
inline |
Sets whether or not this pass renders with depth-buffer writing on or not.
If depth-buffer writing is on, whenever a pixel is written to the frame buffer the depth buffer is updated with the depth value of that new pixel, thus affecting future rendering operations if future pixels are behind this one.
If depth writing is off, pixels are written without updating the depth buffer Depth writing should normally be on but can be turned off when rendering static backgrounds or when rendering a collection of transparent objects at the end of a scene so that they overlap each other correctly.
|
inline |
Returns whether or not this pass renders with depth-buffer writing on or not.
|
inline |
Sets the function used to compare depth values when depth checking is on.
If depth checking is enabled (see setDepthCheckEnabled) a comparison occurs between the depth value of the pixel to be written and the current contents of the buffer. This comparison is normally Ogre::CMPF_LESS_EQUAL.
|
inline |
Returns the function used to compare depth values when depth checking is on.
void Ogre::Pass::setDepthBias | ( | float | constantBias, |
float | slopeScaleBias = 0.0f |
||
) |
Sets the depth bias to be used for this material.
When polygons are coplanar, you can get problems with 'depth fighting' where the pixels from the two polys compete for the same screen pixel. This is particularly a problem for decals (polys attached to another surface to represent details such as bulletholes etc.).
A way to combat this problem is to use a depth bias to adjust the depth buffer value used for the decal such that it is slightly higher than the true value, ensuring that the decal appears on top. There are two aspects to the biasing, a constant bias value and a slope-relative biasing value, which varies according to the maximum depth slope relative to the camera, ie:
$$finalBias = maxSlope * slopeScaleBias + constantBias$$
Slope scale biasing is relative to the angle of the polygon to the camera, which makes for a more appropriate bias value, but this is ignored on some older hardware. Constant biasing is expressed as a factor of the minimum depth value, so a value of 1 will nudge the depth by one ’notch’ if you will.
constantBias | The constant bias value |
slopeScaleBias | The slope-relative bias value |
|
inline |
Retrieves the const depth bias value as set by setDepthBias.
|
inline |
Retrieves the slope-scale depth bias value as set by setDepthBias.
|
inline |
Sets a factor which derives an additional depth bias from the number of times a pass is iterated.
|
inline |
Gets a factor which derives an additional depth bias from the number of times a pass is iterated.
|
inline |
Sets the culling mode for this pass based on the 'vertex winding'.
A typical way for the rendering engine to cull triangles is based on the 'vertex winding' of triangles. Vertex winding refers to the direction in which the vertices are passed or indexed to in the rendering operation as viewed from the camera, and will either be clockwise or anticlockwise (that's 'counterclockwise' for you Americans out there ;) The default is Ogre::CULL_CLOCKWISE i.e. that only triangles whose vertices are passed/indexed in anticlockwise order are rendered - this is a common approach and is used in 3D studio models for example. You can alter this culling mode if you wish but it is not advised unless you know what you are doing.
You may wish to use the Ogre::CULL_NONE option for mesh data that you cull yourself where the vertex winding is uncertain or for creating 2-sided passes.
|
inline |
Returns the culling mode for geometry rendered with this pass.
See setCullingMode for more information.
void Ogre::Pass::setManualCullingMode | ( | ManualCullingMode | mode | ) |
Sets the manual culling mode, performed by CPU rather than hardware.
In some situations you want to use manual culling of triangles rather than sending the triangles to the hardware and letting it cull them. This setting only takes effect on SceneManager's that use it (since it is best used on large groups of planar world geometry rather than on movable geometry since this would be expensive), but if used can cull geometry before it is sent to the hardware.
In this case the culling is based on whether the ’back’ or ’front’ of the triangle is facing the camera - this definition is based on the face normal (a vector which sticks out of the front side of the polygon perpendicular to the face). Since Ogre expects face normals to be on anticlockwise side of the face, Ogre::MANUAL_CULL_BACK is the software equivalent of Ogre::CULL_CLOCKWISE setting, which is why they are both the default. The naming is different to reflect the way the culling is done though, since most of the time face normals are pre-calculated and they don’t have to be the way Ogre expects - you could set Ogre::CULL_NONE and completely cull in software based on your own face normals, if you have the right SceneManager which uses them.
ManualCullingMode Ogre::Pass::getManualCullingMode | ( | void | ) | const |
Retrieves the manual culling mode for this pass.
|
inline |
Sets the type of light shading required.
When dynamic lighting is turned on, the effect is to generate colour values at each vertex. Whether these values are interpolated across the face (and how) depends on this setting. The default shading method is Ogre::SO_GOURAUD.
|
inline |
Returns the type of light shading to be used.
|
inline |
Sets the type of polygon rendering required.
Sets how polygons should be rasterised, i.e. whether they should be filled in, or just drawn as lines or points. The default shading method is Ogre::PM_SOLID.
|
inline |
Returns the type of light shading to be used.
|
inline |
Sets whether the PolygonMode set on this pass can be downgraded by the camera.
override | If set to false, this pass will always be rendered at its own chosen polygon mode no matter what the camera says. The default is true. |
|
inline |
Gets whether this renderable's chosen detail level can be overridden (downgraded) by the camera setting.
void Ogre::Pass::setFog | ( | bool | overrideScene, |
FogMode | mode = FOG_NONE , |
||
const ColourValue & | colour = ColourValue::White , |
||
float | expDensity = 0.001f , |
||
float | linearStart = 0.0f , |
||
float | linearEnd = 1.0f |
||
) |
Sets the fogging mode applied to this pass.
overrideScene | If true, you authorise this pass to override the scene's fog params with it's own settings. If you specify false, so other parameters are necessary, and this is the default behaviour for passes. |
mode | Only applicable if overrideScene is true. You can disable fog which is turned on for the rest of the scene by specifying FOG_NONE. Otherwise, set a pass-specific fog mode as defined in the enum FogMode. |
colour | The colour of the fog. Either set this to the same as your viewport background colour, or to blend in with a skydome or skybox. |
expDensity | The density of the fog in FOG_EXP or FOG_EXP2 mode, as a value between 0 and 1. The default is 0.001. |
linearStart | Distance in world units at which linear fog starts to encroach. Only applicable if mode is FOG_LINEAR. |
linearEnd | Distance in world units at which linear fog becomes completely opaque. Only applicable if mode is FOG_LINEAR. |
|
inline |
Returns true if this pass is to override the scene fog settings.
|
inline |
Returns the fog mode for this pass.
|
inline |
Returns the fog colour for the scene.
|
inline |
Returns the fog start distance for this pass.
|
inline |
Returns the fog end distance for this pass.
|
inline |
Returns the fog density for this pass.
void Ogre::Pass::setAlphaRejectSettings | ( | CompareFunction | func, |
unsigned char | value, | ||
bool | alphaToCoverageEnabled = false |
||
) |
Sets the way the pass will have use alpha to totally reject pixels from the pipeline.
func | The comparison which must pass for the pixel to be written. |
value | 1 byte value against which alpha values will be tested(0-255) |
alphaToCoverageEnabled | Whether to use alpha to coverage with MSAA. This option applies in both the fixed function and the programmable pipeline. |
|
inline |
Sets the alpha reject function.
|
inline |
Gets the alpha reject value.
|
inline |
Gets the alpha reject function.
|
inline |
Gets the alpha reject value.
|
inline |
Sets whether to use alpha to coverage (A2C) when blending alpha rejected values.
Alpha to coverage performs multisampling on the edges of alpha-rejected textures to produce a smoother result. It is only supported when multisampling is already enabled on the render target, and when the hardware supports alpha to coverage (see RenderSystemCapabilities). The common use for alpha to coverage is foliage rendering and chain-link fence style textures.
|
inline |
Gets whether to use alpha to coverage (A2C) when blending alpha rejected values.
|
inline |
Sets whether or not transparent sorting is enabled.
enabled | If false depth sorting of this material will be disabled. |
|
inline |
Returns whether or not transparent sorting is enabled.
|
inline |
Sets whether or not transparent sorting is forced.
enabled | If true depth sorting of this material will be depend only on the value of getTransparentSortingEnabled(). |
|
inline |
Returns whether or not transparent sorting is forced.
|
inline |
Sets the maximum number of lights to be used by this pass.
|
inline |
Gets the maximum number of lights to be used by this pass.
|
inline |
Sets the light index that this pass will start at in the light list.
Normally the lights passed to a pass will start from the beginning of the light list for this object. This option allows you to make this pass start from a higher light index, for example if one of your earlier passes could deal with lights 0-3, and this pass dealt with lights 4+. This option also has an interaction with pass iteration, in that if you choose to iterate this pass per light too, the iteration will only begin from light 4.
|
inline |
Gets the light index that this pass will start at in the light list.
|
inline |
Sets the light mask which can be matched to specific light flags to be handled by this pass.
|
inline |
Gets the light mask controlling which lights are used for this pass.
void Ogre::Pass::setIteratePerLight | ( | bool | enabled, |
bool | onlyForOneLightType = true , |
||
Light::LightTypes | lightType = Light::LT_POINT |
||
) |
Sets whether or not this pass should iterate per light or number of lights which can affect the object being rendered.
enabled | Whether this feature is enabled |
onlyForOneLightType | If true, the pass will only be run for a single type of light, other light types will be ignored. |
lightType | The single light type which will be considered for this pass |
|
inline |
Does this pass run once for every light in range?
|
inline |
Does this pass run only for a single light type (if getIteratePerLight is true).
|
inline |
Gets the single light type this pass runs for if getIteratePerLight and getRunOnlyForOneLightType are both true.
|
inline |
If light iteration is enabled, determine the number of lights per iteration.
|
inline |
If light iteration is enabled, determine the number of lights per iteration.
const String& Ogre::Pass::getResourceGroup | ( | void | ) | const |
Gets the resource group of the ultimate parent Material.
|
inline |
Returns true if this pass is programmable i.e. includes either a vertex or fragment program.
|
inline |
Returns true if this pass uses a programmable vertex pipeline.
References Ogre::GPT_VERTEX_PROGRAM.
|
inline |
Returns true if this pass uses a programmable fragment pipeline.
References Ogre::GPT_FRAGMENT_PROGRAM.
|
inline |
Returns true if this pass uses a programmable geometry pipeline.
References Ogre::GPT_GEOMETRY_PROGRAM.
|
inline |
Returns true if this pass uses a programmable tessellation control pipeline.
References Ogre::GPT_HULL_PROGRAM.
|
inline |
Returns true if this pass uses a programmable tessellation control pipeline.
References Ogre::GPT_DOMAIN_PROGRAM.
|
inline |
Returns true if this pass uses a programmable compute pipeline.
References Ogre::GPT_COMPUTE_PROGRAM.
const GpuProgramPtr& Ogre::Pass::getGpuProgram | ( | GpuProgramType | programType | ) | const |
Gets the Gpu program used by this pass, only available after _load()
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Ogre::GPT_VERTEX_PROGRAM.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Ogre::GPT_FRAGMENT_PROGRAM.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Ogre::GPT_GEOMETRY_PROGRAM.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Ogre::GPT_HULL_PROGRAM.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Ogre::GPT_DOMAIN_PROGRAM.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Ogre::GPT_COMPUTE_PROGRAM.
bool Ogre::Pass::hasGpuProgram | ( | GpuProgramType | programType | ) | const |
void Ogre::Pass::setGpuProgram | ( | GpuProgramType | type, |
const GpuProgramPtr & | prog, | ||
bool | resetParams = true |
||
) |
Sets the details of the program to use.
prog | The program. If this parameter is NULL , any program of the type in this pass is disabled. |
type | The type of program |
resetParams | If true, this will create a fresh set of parameters from the new program being linked, so if you had previously set parameters you will have to set them again. If you set this to false, you must be absolutely sure that the parameters match perfectly, and in the case of named parameters refers to the indexes underlying them, not just the names. |
void Ogre::Pass::setGpuProgram | ( | GpuProgramType | type, |
const String & | name, | ||
bool | resetParams = true |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setFragmentProgram | ( | const String & | name, |
bool | resetParams = true |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setGeometryProgram | ( | const String & | name, |
bool | resetParams = true |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setTessellationDomainProgram | ( | const String & | name, |
bool | resetParams = true |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setTessellationHullProgram | ( | const String & | name, |
bool | resetParams = true |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setVertexProgram | ( | const String & | name, |
bool | resetParams = true |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setComputeProgram | ( | const String & | name, |
bool | resetParams = true |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
const String& Ogre::Pass::getGpuProgramName | ( | GpuProgramType | type | ) | const |
Gets the name of the program used by this pass.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Ogre::GPT_FRAGMENT_PROGRAM.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Ogre::GPT_GEOMETRY_PROGRAM.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Ogre::GPT_DOMAIN_PROGRAM.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Ogre::GPT_HULL_PROGRAM.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Ogre::GPT_VERTEX_PROGRAM.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
References Ogre::GPT_COMPUTE_PROGRAM.
void Ogre::Pass::setGpuProgramParameters | ( | GpuProgramType | type, |
const GpuProgramParametersSharedPtr & | params | ||
) |
Sets the Gpu program parameters.
void Ogre::Pass::setVertexProgramParameters | ( | GpuProgramParametersSharedPtr | params | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setFragmentProgramParameters | ( | GpuProgramParametersSharedPtr | params | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setGeometryProgramParameters | ( | GpuProgramParametersSharedPtr | params | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setTessellationHullProgramParameters | ( | GpuProgramParametersSharedPtr | params | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setTessellationDomainProgramParameters | ( | GpuProgramParametersSharedPtr | params | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void Ogre::Pass::setComputeProgramParameters | ( | GpuProgramParametersSharedPtr | params | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
const GpuProgramParametersSharedPtr& Ogre::Pass::getGpuProgramParameters | ( | GpuProgramType | type | ) | const |
Gets the Gpu program parameters used by this pass.
GpuProgramParametersSharedPtr Ogre::Pass::getVertexProgramParameters | ( | void | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
GpuProgramParametersSharedPtr Ogre::Pass::getFragmentProgramParameters | ( | void | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
GpuProgramParametersSharedPtr Ogre::Pass::getGeometryProgramParameters | ( | void | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
GpuProgramParametersSharedPtr Ogre::Pass::getTessellationHullProgramParameters | ( | void | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
GpuProgramParametersSharedPtr Ogre::Pass::getTessellationDomainProgramParameters | ( | void | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
GpuProgramParametersSharedPtr Ogre::Pass::getComputeProgramParameters | ( | void | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Pass* Ogre::Pass::_split | ( | unsigned short | numUnits | ) |
Splits this Pass to one which can be handled in the number of texture units specified.
numUnits | The target number of texture units |
void Ogre::Pass::_notifyIndex | ( | unsigned short | index | ) |
Internal method to adjust pass index.
void Ogre::Pass::_prepare | ( | void | ) |
Internal method for preparing to load this pass.
void Ogre::Pass::_unprepare | ( | void | ) |
Internal method for undoing the load preparartion for this pass.
void Ogre::Pass::_load | ( | void | ) |
Internal method for loading this pass.
void Ogre::Pass::_unload | ( | void | ) |
Internal method for unloading this pass.
bool Ogre::Pass::isLoaded | ( | void | ) | const |
Is this loaded?
|
inline |
Gets the 'hash' of this pass, ie a precomputed number to use for sorting.
void Ogre::Pass::_dirtyHash | ( | void | ) |
Mark the hash as dirty.
void Ogre::Pass::_recalculateHash | ( | void | ) |
Internal method for recalculating the hash.
void Ogre::Pass::_notifyNeedsRecompile | ( | void | ) |
Tells the pass that it needs recompilation.
void Ogre::Pass::_updateAutoParams | ( | const AutoParamDataSource * | source, |
uint16 | variabilityMask | ||
) | const |
Update automatic parameters.
source | The source of the parameters |
variabilityMask | A mask of GpuParamVariability which identifies which autos will need updating |
|
inline |
If set to true, this forces normals to be normalised dynamically by the hardware for this pass.
This option can be used to prevent lighting variations when scaling an object - normally because this scaling is hardware based, the normals get scaled too which causes lighting to become inconsistent. By default the SceneManager detects scaled objects and does this for you, but this has an overhead so you might want to turn that off through Ogre::SceneManager::setNormaliseNormalsOnScale(false) and only do it per-Pass when you need to.
|
inline |
Returns true if this pass has auto-normalisation of normals set.
|
inlinestatic |
Static method to retrieve all the Passes which need their hash values recalculated.
|
inlinestatic |
Static method to retrieve all the Passes which are pending deletion.
|
static |
Static method to reset the list of passes which need their hash values recalculated.
|
static |
Process all dirty and pending deletion passes.
void Ogre::Pass::queueForDeletion | ( | void | ) |
Queue this pass for deletion when appropriate.
bool Ogre::Pass::isAmbientOnly | ( | void | ) | const |
Returns whether this pass is ambient only.
|
inline |
set the number of iterations that this pass should perform when doing fast multi pass operation.
count | number of iterations to perform fast multi pass operations. A value greater than 1 will cause the pass to be executed count number of times without changing the render state. This is very useful for passes that use programmable shaders that have to iterate more than once but don't need a render state change. Using multi pass can dramatically speed up rendering for materials that do things like fur, blur. A value of 1 turns off multi pass operation and the pass does the normal pass operation. |
|
inline |
Gets the pass iteration count value.
|
inline |
Sets whether or not this pass will be clipped by a scissor rectangle encompassing the lights that are being used in it.
In order to cut down on fillrate when you have a number of fixed-range lights in the scene, you can enable this option to request that during rendering, only the region of the screen which is covered by the lights is rendered. This region is the screen-space rectangle covering the union of the spheres making up the light ranges. Directional lights are ignored for this.
This is only likely to be useful for multipass additive lighting algorithms, where the scene has already been 'seeded' with an ambient pass and this pass is just adding light in affected areas.
When using Ogre::SHADOWTYPE_STENCIL_ADDITIVE or Ogre::SHADOWTYPE_TEXTURE_ADDITIVE, this option is implicitly used for all per-light passes and does not need to be specified. If you are not using shadows or are using a modulative or Integrated Texture Shadows then this could be useful.
|
inline |
Gets whether or not this pass will be clipped by a scissor rectangle encompassing the lights that are being used in it.
|
inline |
Sets whether or not this pass will be clipped by user clips planes bounding the area covered by the light.
This option will only function if there is a single non-directional light being used in this pass. If there is more than one light, or only directional lights, then no clipping will occur. If there are no lights at all then the objects won’t be rendered at all.
In order to cut down on the geometry set up to render this pass when you have a single fixed-range light being rendered through it, you can enable this option to request that during triangle setup, clip planes are defined to bound the range of the light. In the case of a point light these planes form a cube, and in the case of a spotlight they form a pyramid. Directional lights are never clipped.
This option is only likely to be useful for multipass additive lighting algorithms, where the scene has already been 'seeded' with an ambient pass and this pass is just adding light in affected areas. In addition, it will only be honoured if there is exactly one non-directional light being used in this pass. Also, these clip planes override any user clip planes set on Camera.
When using Ogre::SHADOWTYPE_STENCIL_ADDITIVE or Ogre::SHADOWTYPE_TEXTURE_ADDITIVE, this option is automatically used for all per-light passes if you enable Ogre::SceneManager::setShadowUseLightClipPlanes and does not need to be specified. It is disabled by default since clip planes have a cost of their own which may not always exceed the benefits they give you. Generally the smaller your lights are the more chance you’ll see a benefit rather than a penalty from clipping.
|
inline |
Gets whether or not this pass will be clipped by user clips planes bounding the area covered by the light.
|
inline |
Manually set which illumination stage this pass is a member of.
When using an additive lighting mode (Ogre::SHADOWTYPE_STENCIL_ADDITIVE or Ogre::SHADOWTYPE_TEXTURE_ADDITIVE), the scene is rendered in 3 discrete stages, ambient (or pre-lighting), per-light (once per light, with shadowing) and decal (or post-lighting). Usually OGRE figures out how to categorise your passes automatically, but there are some effects you cannot achieve without manually controlling the illumination. For example specular effects are muted by the typical sequence because all textures are saved until the Ogre::IS_DECAL stage which mutes the specular effect. Instead, you could do texturing within the per-light stage if it's possible for your material and thus add the specular on after the decal texturing, and have no post-light rendering.
If you assign an illumination stage to a pass you have to assign it to all passes in the technique otherwise it will be ignored. Also note that whilst you can have more than one pass in each group, they cannot alternate, ie all ambient passes will be before all per-light passes, which will also be before all decal passes. Within their categories the passes will retain their ordering though.
|
inline |
Get the manually assigned illumination stage, if any.
|
static |
Sets one of the default hash functions to be used.
|
inlinestatic |
Set the hash function used for all passes.
|
inlinestatic |
Get the hash function used for all passes.
|
static |
Get the builtin hash function.
|
inline |
Class that provides convenient interface to establish a linkage between custom user application objects and Ogre core classes.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.