OGRE: Ogre::Technique Class Reference

| OGRE 14.5 Object-Oriented Graphics Rendering Engine

Loading...
Searching...
No Matches
Ogre::Technique Class Reference
Core » Materials

Class representing an approach to rendering this particular Material. More...

`#include <OgreTechnique.h>`

Inheritance diagram for Ogre::Technique:
[legend]

## Classes
struct | GPUDeviceNameRule
| Rule controlling whether technique is deemed supported based on GPU device name. More...
struct | GPUVendorRule
| Rule controlling whether technique is deemed supported based on GPU vendor. More...

## Public Types
typedef ConstVectorIterator< GPUDeviceNameRuleList > | GPUDeviceNameRuleIterator
typedef std::vector< GPUDeviceNameRule > | GPUDeviceNameRuleList
typedef ConstVectorIterator< GPUVendorRuleList > | GPUVendorRuleIterator
typedef std::vector< GPUVendorRule > | GPUVendorRuleList
typedef VectorIterator< IlluminationPassList > | IlluminationPassIterator
enum | IncludeOrExclude { INCLUDE = 0 , EXCLUDE = 1 }
| Directive used to manually control technique support based on the inclusion or exclusion of some factor. More...
typedef std::vector< Pass * > | Passes
typedef VectorIterator< Passes > | PassIterator

## Public Member Functions
| Technique (Material *parent)
| Constructor.
| Technique (Material *parent, const Technique &oth)
| Copy constructor.
| ~Technique ()
String | _compile (bool autoManageTextureUnits)
| Internal compilation method; see Material::compile.
unsigned short | _getSchemeIndex (void) const
| Internal method for getting the scheme index.
void | _load (void)
| Internal load method, derived from call to Material::load.
void | _notifyNeedsRecompile (void)
| Tells the technique that it needs recompilation.
void | _prepare (void)
| Internal prepare method, derived from call to Material::prepare.
void | _unload (void)
| Internal unload method, derived from call to Material::unload.
void | _unprepare (void)
| Internal unprepare method, derived from call to Material::unprepare.
size_t | calculateSize (void) const
bool | checkHardwareSupport (bool autoManageTextureUnits, StringStream &compileErrors)
| Internal method for checking hardware support.
unsigned short | getLodIndex (void) const
| Gets the level-of-detail index assigned to this Technique.
const String & | getName (void) const
| Gets the name of the technique.
Material * | getParent (void) const
| Gets the parent Material.
const String & | getResourceGroup (void) const
| Gets the resource group of the ultimate parent Material.
const String & | getSchemeName (void) const
| Returns the scheme to which this technique is assigned.
UserObjectBindings & | getUserObjectBindings ()
| Class that provides convenient interface to establish a linkage between custom user application objects and Ogre core classes.
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.
bool | hasColourWriteDisabled (void) const
| Exists colour writing disabled pass on this technique?
bool | isDepthCheckEnabled (void) const
| Is depth checking going to occur on this technique?
bool | isDepthWriteEnabled (void) const
| Is depth writing going to occur on this technique?
bool | isLoaded (void) const
| Is this loaded?
bool | isSupported (void) const
| Indicates if this technique is supported by the current graphics card.
bool | isTransparent (void) const
| Returns true if this Technique involves transparency.
bool | isTransparentSortingEnabled (void) const
| Returns true if this Technique has transparent sorting enabled.
bool | isTransparentSortingForced (void) const
| Returns true if this Technique has transparent sorting forced.
Technique & | operator= (const Technique &rhs)
| Overloaded operator to copy on Technique to another.
void | setLodIndex (unsigned short index)
| Assigns a level-of-detail (LOD) index to this Technique.
void | setName (const String &name)
| Set the name of the technique.
void | setSchemeName (const String &schemeName)
| Set the 'scheme name' for this technique.
Passes
Pass * | createPass (void)
| Creates a new Pass for this Technique.
Pass * | getPass (size_t index) const
| Retrieves the Pass with the given index.
Pass * | getPass (const String &name) const
| Retrieves the Pass matching name.
size_t | getNumPasses (void) const
| Retrieves the number of passes.
void | removePass (unsigned short index)
| Removes the Pass with the given index.
void | removeAllPasses (void)
| Removes all Passes from this Technique.
bool | movePass (const unsigned short sourceIndex, const unsigned short destinationIndex)
| Move a pass from source index to destination index.
const PassIterator | getPassIterator (void)
| Gets an iterator over the passes in this Technique.
const Passes & | getPasses (void) const
| Gets the passes in this Technique.
const IlluminationPassList & | getIlluminationPasses ()
| Gets the illumination-stage categorised passes.
void | _compileIlluminationPasses (void)
| Internal method for splitting the passes into illumination passes.
Shadow Materials
MaterialPtr | getShadowCasterMaterial () const
| return this material specific shadow casting specific material
void | setShadowCasterMaterial (MaterialPtr val)
| Sets the details of the material to use when rendering as a shadow caster.
void | setShadowCasterMaterial (const String &name)
| set this material specific shadow casting specific material
MaterialPtr | getShadowReceiverMaterial () const
| return this material specific shadow receiving specific material
void | setShadowReceiverMaterial (MaterialPtr val)
| set this material specific shadow receiving specific material
void | setShadowReceiverMaterial (const String &name)
| set this material specific shadow receiving specific material
Forwarded Pass Properties
The following methods are to make migration from previous versions simpler and to make code easier to write when dealing with simple materials They set the properties which have been moved to Pass for all Techniques and all Passes
void | setPointSize (Real ps)
| Sets the point size properties for every Pass in this Technique.
void | setAmbient (float red, float green, float blue)
| Sets the ambient colour reflectance properties for every Pass in every Technique.
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.
void | setDiffuse (float red, float green, float blue, float alpha)
| Sets the diffuse colour reflectance properties of every Pass in every Technique.
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.
void | setSpecular (float red, float green, float blue, float alpha)
| Sets the specular colour reflectance properties of every Pass in every Technique.
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.
void | setShininess (Real val)
| Sets the shininess properties of every Pass in every Technique.
void | setSelfIllumination (float red, float green, float blue)
| Sets the amount of self-illumination of every Pass in every Technique.
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.
void | setDepthCheckEnabled (bool enabled)
| Sets whether or not each Pass renders with depth-buffer checking on or not.
void | setDepthWriteEnabled (bool enabled)
| Sets whether or not each Pass renders with depth-buffer writing on or not.
void | setDepthFunction (CompareFunction func)
| Sets the function used to compare depth values when depth checking is on.
void | setColourWriteEnabled (bool enabled)
| Sets whether or not colour buffer writing is enabled for each Pass.
void | setColourWriteEnabled (bool red, bool green, bool blue, bool alpha)
| Sets which colour buffer channels are enabled for writing for each Pass.
void | setCullingMode (CullingMode mode)
| Sets the culling mode for each pass based on the 'vertex winding'.
void | setManualCullingMode (ManualCullingMode mode)
| Sets the manual culling mode, performed by CPU rather than hardware.
void | setLightingEnabled (bool enabled)
| Sets whether or not dynamic lighting is enabled for every Pass.
void | setShadingMode (ShadeOptions mode)
| Sets the type of light shading required.
void | setFog (bool overrideScene, FogMode mode=FOG_NONE, const ColourValue &colour=ColourValue::White, Real expDensity=0.001f, Real linearStart=0.0f, Real linearEnd=1.0f)
| Sets the fogging mode applied to each pass.
void | setDepthBias (float constantBias, float slopeScaleBias)
| Sets the depth bias to be used for each Pass.
void | setTextureFiltering (TextureFilterOptions filterType)
| Set texture filtering for every texture unit in every Pass.
void | setTextureAnisotropy (unsigned int maxAniso)
| Sets the anisotropy level to be used for all textures.
void | setSceneBlending (const SceneBlendType sbt)
| Sets the kind of blending every pass has with the existing contents of the scene.
void | setSeparateSceneBlending (const SceneBlendType sbt, const SceneBlendType sbta)
| Sets the kind of blending every pass has with the existing contents of the scene, using individual factors both color and alpha channels.
void | setSceneBlending (const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor)
| Allows very fine control of blending every Pass with the existing contents of the scene.
void | setSeparateSceneBlending (const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor, const SceneBlendFactor sourceFactorAlpha, const SceneBlendFactor destFactorAlpha)
| Allows very fine control of blending every Pass with the existing contents of the scene, using individual factors both color and alpha channels.
GPU Vendor Rules
bool | checkGPURules (StringStream &errors)
| Internal method for checking GPU vendor / device rules.
void | addGPUVendorRule (GPUVendor vendor, IncludeOrExclude includeOrExclude)
| Add a rule which manually influences the support for this technique based on a GPU vendor.
void | addGPUVendorRule (const GPUVendorRule &rule)
| Add a rule which manually influences the support for this technique based on a GPU vendor.
void | removeGPUVendorRule (GPUVendor vendor)
| Removes a matching vendor rule.
GPUVendorRuleIterator | getGPUVendorRuleIterator () const
const GPUVendorRuleList & | getGPUVendorRules () const
| Get the currently registered vendor rules.
void | addGPUDeviceNameRule (const String &devicePattern, IncludeOrExclude includeOrExclude, bool caseSensitive=false)
| Add a rule which manually influences the support for this technique based on a pattern that matches a GPU device name (e.g.
void | addGPUDeviceNameRule (const GPUDeviceNameRule &rule)
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
void | removeGPUDeviceNameRule (const String &devicePattern)
| Removes a matching device name rule.
GPUDeviceNameRuleIterator | getGPUDeviceNameRuleIterator () const
const GPUDeviceNameRuleList & | getGPUDeviceNameRules () const
| Get the currently registered device name rules.

## Detailed Description

Class representing an approach to rendering this particular Material.

Ogre will attempt to use the best technique supported by the active hardware, unless you specifically request a lower detail technique (say for distant rendering).

## Member Typedef Documentation

## ◆ Passes

typedef std::vector<Pass*> Ogre::Technique::Passes

## ◆ GPUVendorRuleList

typedef std::vector<GPUVendorRule> Ogre::Technique::GPUVendorRuleList

## ◆ GPUDeviceNameRuleList

typedef std::vector<GPUDeviceNameRule> Ogre::Technique::GPUDeviceNameRuleList

## ◆ PassIterator

typedef VectorIterator<Passes> Ogre::Technique::PassIterator

## ◆ IlluminationPassIterator

typedef VectorIterator<IlluminationPassList> Ogre::Technique::IlluminationPassIterator

## ◆ GPUVendorRuleIterator

typedef ConstVectorIterator<GPUVendorRuleList> Ogre::Technique::GPUVendorRuleIterator

## ◆ GPUDeviceNameRuleIterator

typedef ConstVectorIterator<GPUDeviceNameRuleList> Ogre::Technique::GPUDeviceNameRuleIterator

## Member Enumeration Documentation

## ◆ IncludeOrExclude

enum Ogre::Technique::IncludeOrExclude

Directive used to manually control technique support based on the inclusion or exclusion of some factor.

Enumerator
INCLUDE | Inclusive - only support if present.
EXCLUDE | Exclusive - do not support if present.

## Constructor & Destructor Documentation

## ◆ Technique() [1/2]

Ogre::Technique::Technique | ( | Material * | parent | ) |

Constructor.

Referenced by Technique(), and operator=().

## ◆ Technique() [2/2]

Ogre::Technique::Technique | ( | Material * | parent,
|  | const Technique & | oth )

Copy constructor.

References Technique().

## ◆ ~Technique()

Ogre::Technique::~Technique | ( |  | ) |

## Member Function Documentation

## ◆ isSupported()

bool Ogre::Technique::isSupported | ( | void |  | ) | const

Indicates if this technique is supported by the current graphics card.

This will only be correct after the Technique has been compiled, which is usually done from Material::compile.

## ◆ _compile()

String Ogre::Technique::_compile | ( | bool | autoManageTextureUnits | ) |

Internal compilation method; see Material::compile.

Returns
  Any information explaining problems with the compile.

## ◆ checkHardwareSupport()

bool Ogre::Technique::checkHardwareSupport | ( | bool | autoManageTextureUnits,
|  | StringStream & | compileErrors )

Internal method for checking hardware support.

## ◆ calculateSize()

size_t Ogre::Technique::calculateSize | ( | void |  | ) | const

## ◆ createPass()

Pass * Ogre::Technique::createPass | ( | void |  | ) |

Creates a new Pass for this Technique.

A Pass is a single rendering pass, i.e. a single draw of the given material. Note that if you create a pass without a fragment program, during compilation of the material the pass may be split into multiple passes if the graphics card cannot handle the number of texture units requested. For passes with fragment programs, however, the number of passes you create will never be altered, so you have to make sure that you create an alternative fallback Technique for if a card does not have enough facilities for what you're asking for.

## ◆ getPass() [1/2]

Pass * Ogre::Technique::getPass | ( | size_t | index | ) | const
| inline

Retrieves the Pass with the given index.

## ◆ getPass() [2/2]

Pass * Ogre::Technique::getPass | ( | const String & | name | ) | const

Retrieves the Pass matching name.

Returns 0 if name match is not found.

## ◆ getNumPasses()

size_t Ogre::Technique::getNumPasses | ( | void |  | ) | const
| inline

Retrieves the number of passes.

## ◆ removePass()

void Ogre::Technique::removePass | ( | unsigned short | index | ) |

Removes the Pass with the given index.

## ◆ removeAllPasses()

void Ogre::Technique::removeAllPasses | ( | void |  | ) |

Removes all Passes from this Technique.

## ◆ movePass()

bool Ogre::Technique::movePass | ( | const unsigned short | sourceIndex,
|  | const unsigned short | destinationIndex )

Move a pass from source index to destination index.

If successful then returns true.

## ◆ getPassIterator()

const PassIterator Ogre::Technique::getPassIterator | ( | void |  | ) |

Gets an iterator over the passes in this Technique.

Deprecated
  use getPasses()

## ◆ getPasses()

const Passes & Ogre::Technique::getPasses | ( | void |  | ) | const
| inline

Gets the passes in this Technique.

## ◆ getIlluminationPasses()

const IlluminationPassList & Ogre::Technique::getIlluminationPasses | ( |  | ) |

Gets the illumination-stage categorised passes.

Note
  triggers compilation if needed

## ◆ _compileIlluminationPasses()

void Ogre::Technique::_compileIlluminationPasses | ( | void |  | ) |

Internal method for splitting the passes into illumination passes.

## ◆ getParent()

Material * Ogre::Technique::getParent | ( | void |  | ) | const
| inline

Gets the parent Material.

## ◆ operator=()

Technique & Ogre::Technique::operator= | ( | const Technique & | rhs | ) |

Overloaded operator to copy on Technique to another.

References Technique().

## ◆ getResourceGroup()

const String & Ogre::Technique::getResourceGroup | ( | void |  | ) | const

Gets the resource group of the ultimate parent Material.

## ◆ isTransparent()

bool Ogre::Technique::isTransparent | ( | void |  | ) | const

Returns true if this Technique involves transparency.

This basically boils down to whether the first pass has a scene blending factor. Even if the other passes do not, the base colour, including parts of the original scene, may be used for blending, therefore we have to treat the whole Technique as transparent.

## ◆ isTransparentSortingEnabled()

bool Ogre::Technique::isTransparentSortingEnabled | ( | void |  | ) | const

Returns true if this Technique has transparent sorting enabled.

This basically boils down to whether the first pass has transparent sorting enabled or not

## ◆ isTransparentSortingForced()

bool Ogre::Technique::isTransparentSortingForced | ( | void |  | ) | const

Returns true if this Technique has transparent sorting forced.

This basically boils down to whether the first pass has transparent sorting forced or not

## ◆ _prepare()

void Ogre::Technique::_prepare | ( | void |  | ) |

Internal prepare method, derived from call to Material::prepare.

## ◆ _unprepare()

void Ogre::Technique::_unprepare | ( | void |  | ) |

Internal unprepare method, derived from call to Material::unprepare.

## ◆ _load()

void Ogre::Technique::_load | ( | void |  | ) |

Internal load method, derived from call to Material::load.

## ◆ _unload()

void Ogre::Technique::_unload | ( | void |  | ) |

Internal unload method, derived from call to Material::unload.

## ◆ isLoaded()

bool Ogre::Technique::isLoaded | ( | void |  | ) | const

Is this loaded?

## ◆ _notifyNeedsRecompile()

void Ogre::Technique::_notifyNeedsRecompile | ( | void |  | ) |

Tells the technique that it needs recompilation.

## ◆ getShadowCasterMaterial()

MaterialPtr Ogre::Technique::getShadowCasterMaterial | ( |  | ) | const

return this material specific shadow casting specific material

## ◆ setShadowCasterMaterial() [1/2]

void Ogre::Technique::setShadowCasterMaterial | ( | MaterialPtr | val | ) |

Sets the details of the material to use when rendering as a shadow caster.

Texture-based shadows require that the caster is rendered to a texture in a solid colour (the shadow colour in the case of modulative texture shadows). Whilst Ogre can arrange this for the fixed function pipeline, passes which use vertex programs might need the vertex programs still to run in order to preserve any deformation etc that it does. However, lighting calculations must be a lot simpler, with only the ambient colour being used (which the engine will ensure is bound to the shadow colour).

  Therefore, it is up to implementors of vertex programs to provide an alternative material which can be used to render the object to a shadow texture. Do all the same vertex transforms, but set the colour of the vertex to the ambient colour, as bound using the standard auto parameter binding mechanism.

## ◆ setShadowCasterMaterial() [2/2]

void Ogre::Technique::setShadowCasterMaterial | ( | const String & | name | ) |

set this material specific shadow casting specific material

## ◆ getShadowReceiverMaterial()

MaterialPtr Ogre::Technique::getShadowReceiverMaterial | ( |  | ) | const

return this material specific shadow receiving specific material

## ◆ setShadowReceiverMaterial() [1/2]

void Ogre::Technique::setShadowReceiverMaterial | ( | MaterialPtr | val | ) |

set this material specific shadow receiving specific material

## ◆ setShadowReceiverMaterial() [2/2]

void Ogre::Technique::setShadowReceiverMaterial | ( | const String & | name | ) |

set this material specific shadow receiving specific material

## ◆ setPointSize()

void Ogre::Technique::setPointSize | ( | Real | ps | ) |

Sets the point size properties for every Pass in this Technique.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setPointSize

## ◆ setAmbient() [1/2]

void Ogre::Technique::setAmbient | ( | float | red,
|  | float | green,
|  | float | blue )

Sets the ambient colour reflectance properties for every Pass in every Technique.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setAmbient

## ◆ setAmbient() [2/2]

void Ogre::Technique::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.

## ◆ setDiffuse() [1/2]

void Ogre::Technique::setDiffuse | ( | float | red,
|  | float | green,
|  | float | blue,
|  | float | alpha )

Sets the diffuse colour reflectance properties of every Pass in every Technique.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setDiffuse

## ◆ setDiffuse() [2/2]

void Ogre::Technique::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.

## ◆ setSpecular() [1/2]

void Ogre::Technique::setSpecular | ( | float | red,
|  | float | green,
|  | float | blue,
|  | float | alpha )

Sets the specular colour reflectance properties of every Pass in every Technique.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setSpecular

## ◆ setSpecular() [2/2]

void Ogre::Technique::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.

## ◆ setShininess()

void Ogre::Technique::setShininess | ( | Real | val | ) |

Sets the shininess properties of every Pass in every Technique.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setShininess

## ◆ setSelfIllumination() [1/2]

void Ogre::Technique::setSelfIllumination | ( | float | red,
|  | float | green,
|  | float | blue )

Sets the amount of self-illumination of every Pass in every Technique.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setSelfIllumination

## ◆ setSelfIllumination() [2/2]

void Ogre::Technique::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.

## ◆ setDepthCheckEnabled()

void Ogre::Technique::setDepthCheckEnabled | ( | bool | enabled | ) |

Sets whether or not each Pass renders with depth-buffer checking on or not.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setDepthCheckEnabled

## ◆ setDepthWriteEnabled()

void Ogre::Technique::setDepthWriteEnabled | ( | bool | enabled | ) |

Sets whether or not each Pass renders with depth-buffer writing on or not.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setDepthWriteEnabled

## ◆ setDepthFunction()

void Ogre::Technique::setDepthFunction | ( | CompareFunction | func | ) |

Sets the function used to compare depth values when depth checking is on.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setDepthFunction

## ◆ setColourWriteEnabled() [1/2]

void Ogre::Technique::setColourWriteEnabled | ( | bool | enabled | ) |

Sets whether or not colour buffer writing is enabled for each Pass.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setColourWriteEnabled

## ◆ setColourWriteEnabled() [2/2]

void Ogre::Technique::setColourWriteEnabled | ( | bool | red,
|  | bool | green,
|  | bool | blue,
|  | bool | alpha )

Sets which colour buffer channels are enabled for writing for each Pass.

See also
  Pass::setColourWriteEnabled

## ◆ setCullingMode()

void Ogre::Technique::setCullingMode | ( | CullingMode | mode | ) |

Sets the culling mode for each pass based on the 'vertex winding'.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setCullingMode

## ◆ setManualCullingMode()

void Ogre::Technique::setManualCullingMode | ( | ManualCullingMode | mode | ) |

Sets the manual culling mode, performed by CPU rather than hardware.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setManualCullingMode

## ◆ setLightingEnabled()

void Ogre::Technique::setLightingEnabled | ( | bool | enabled | ) |

Sets whether or not dynamic lighting is enabled for every Pass.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setLightingEnabled

## ◆ setShadingMode()

void Ogre::Technique::setShadingMode | ( | ShadeOptions | mode | ) |

Sets the type of light shading required.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setShadingMode

## ◆ setFog()

void Ogre::Technique::setFog | ( | bool | overrideScene,
|  | FogMode | mode = FOG_NONE,
|  | const ColourValue & | colour = ColourValue::White,
|  | Real | expDensity = 0.001f,
|  | Real | linearStart = 0.0f,
|  | Real | linearEnd = 1.0f )

Sets the fogging mode applied to each pass.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setFog

References Ogre::FOG_NONE, and Ogre::ColourValue::White.

## ◆ setDepthBias()

void Ogre::Technique::setDepthBias | ( | float | constantBias,
|  | float | slopeScaleBias )

Sets the depth bias to be used for each Pass.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setDepthBias

## ◆ setTextureFiltering()

void Ogre::Technique::setTextureFiltering | ( | TextureFilterOptions | filterType | ) |

Set texture filtering for every texture unit in every Pass.

Note
  This property actually exists on the TextureUnitState class For simplicity, this method allows you to set these properties for every current TeextureUnitState, If you need more precision, retrieve the
  Pass and TextureUnitState instances and set the property there.

See also
  TextureUnitState::setTextureFiltering

## ◆ setTextureAnisotropy()

void Ogre::Technique::setTextureAnisotropy | ( | unsigned int | maxAniso | ) |

Sets the anisotropy level to be used for all textures.

Note
  This property has been moved to the TextureUnitState class, which is accessible via the Technique and Pass. For simplicity, this method allows you to set these properties for every current TeextureUnitState, If you need more precision, retrieve the Technique, Pass and TextureUnitState instances and set the property there.

See also
  TextureUnitState::setTextureAnisotropy

## ◆ setSceneBlending() [1/2]

void Ogre::Technique::setSceneBlending | ( | const SceneBlendType | sbt | ) |

Sets the kind of blending every pass has with the existing contents of the scene.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setSceneBlending

## ◆ setSeparateSceneBlending() [1/2]

void Ogre::Technique::setSeparateSceneBlending | ( | const SceneBlendType | sbt,
|  | const SceneBlendType | sbta )

Sets the kind of blending every pass has with the existing contents of the scene, using individual factors both color and alpha channels.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setSeparateSceneBlending

## ◆ setSceneBlending() [2/2]

void Ogre::Technique::setSceneBlending | ( | const SceneBlendFactor | sourceFactor,
|  | const SceneBlendFactor | destFactor )

Allows very fine control of blending every Pass with the existing contents of the scene.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setSceneBlending

## ◆ setSeparateSceneBlending() [2/2]

void Ogre::Technique::setSeparateSceneBlending | ( | const SceneBlendFactor | sourceFactor,
|  | const SceneBlendFactor | destFactor,
|  | const SceneBlendFactor | sourceFactorAlpha,
|  | const SceneBlendFactor | destFactorAlpha )

Allows very fine control of blending every Pass with the existing contents of the scene, using individual factors both color and alpha channels.

Note
  This property actually exists on the Pass class. For simplicity, this method allows you to set these properties for every current Pass within this Technique. If you need more precision, retrieve the Pass instance and set the property there.

See also
  Pass::setSeparateSceneBlending

## ◆ setLodIndex()

void Ogre::Technique::setLodIndex | ( | unsigned short | index | ) |

Assigns a level-of-detail (LOD) index to this Technique.

As noted previously, as well as providing fallback support for various graphics cards, multiple Technique objects can also be used to implement material LOD, where the detail of the material diminishes with distance to save rendering power.

  By default, all Techniques have a LOD index of 0, which means they are the highest level of detail. Increasing LOD indexes are lower levels of detail. You can assign more than one Technique to the same LOD index, meaning that the best Technique that is supported at that LOD index is used.

  You should not leave gaps in the LOD sequence; Ogre will allow you to do this and will continue to function as if the LODs were sequential, but it will confuse matters.

## ◆ getLodIndex()

unsigned short Ogre::Technique::getLodIndex | ( | void |  | ) | const
| inline

Gets the level-of-detail index assigned to this Technique.

## ◆ setSchemeName()

void Ogre::Technique::setSchemeName | ( | const String & | schemeName | ) |

Set the 'scheme name' for this technique.

Material schemes are used to control top-level switching from one set of techniques to another. For example, you might use this to define 'high', 'medium' and 'low' complexity levels on materials to allow a user to pick a performance / quality ratio. Another possibility is that you have a fully HDR-enabled pipeline for top machines, rendering all objects using unclamped shaders, and a simpler pipeline for others; this can be implemented using schemes.

  Every technique belongs to a scheme - if you don't specify one, the Technique belongs to the scheme called 'Default', which is also the scheme used to render by default. The active scheme is set one of two ways - either by calling Viewport::setMaterialScheme, or by manually calling MaterialManager::setActiveScheme.

## ◆ getSchemeName()

const String & Ogre::Technique::getSchemeName | ( | void |  | ) | const

Returns the scheme to which this technique is assigned.

See also
  Technique::setSchemeName

## ◆ _getSchemeIndex()

unsigned short Ogre::Technique::_getSchemeIndex | ( | void |  | ) | const

Internal method for getting the scheme index.

## ◆ isDepthWriteEnabled()

bool Ogre::Technique::isDepthWriteEnabled | ( | void |  | ) | const

Is depth writing going to occur on this technique?

## ◆ isDepthCheckEnabled()

bool Ogre::Technique::isDepthCheckEnabled | ( | void |  | ) | const

Is depth checking going to occur on this technique?

## ◆ hasColourWriteDisabled()

bool Ogre::Technique::hasColourWriteDisabled | ( | void |  | ) | const

Exists colour writing disabled pass on this technique?

## ◆ setName()

void Ogre::Technique::setName | ( | const String & | name | ) |

Set the name of the technique.

The use of technique name is optional. Its useful in material scripts where a material could inherit from another material and only want to modify a particular technique.

## ◆ getName()

const String & Ogre::Technique::getName | ( | void |  | ) | const
| inline

Gets the name of the technique.

## ◆ checkGPURules()

bool Ogre::Technique::checkGPURules | ( | StringStream & | errors | ) |

Internal method for checking GPU vendor / device rules.

## ◆ addGPUVendorRule() [1/2]

void Ogre::Technique::addGPUVendorRule | ( | GPUVendor | vendor,
|  | IncludeOrExclude | includeOrExclude )

Add a rule which manually influences the support for this technique based on a GPU vendor.

You can use this facility to manually control whether a technique is considered supported, based on a GPU vendor. You can add inclusive or exclusive rules, and you can add as many of each as you like. If at least one inclusive rule is added, a technique is considered unsupported if it does not match any of those inclusive rules. If exclusive rules are added, the technique is considered unsupported if it matches any of those inclusive rules.

Note
  Any rule for the same vendor will be removed before adding this one.

Parameters

  vendor | The GPU vendor
  includeOrExclude | Whether this is an inclusive or exclusive rule

## ◆ addGPUVendorRule() [2/2]

void Ogre::Technique::addGPUVendorRule | ( | const GPUVendorRule & | rule | ) |

Add a rule which manually influences the support for this technique based on a GPU vendor.

You can use this facility to manually control whether a technique is considered supported, based on a GPU vendor. You can add inclusive or exclusive rules, and you can add as many of each as you like. If at least one inclusive rule is added, a technique is considered unsupported if it does not match any of those inclusive rules. If exclusive rules are added, the technique is considered unsupported if it matches any of those inclusive rules.

Note
  Any rule for the same vendor will be removed before adding this one.

## ◆ removeGPUVendorRule()

void Ogre::Technique::removeGPUVendorRule | ( | GPUVendor | vendor | ) |

Removes a matching vendor rule.

See also
  addGPUVendorRule

## ◆ getGPUVendorRuleIterator()

GPUVendorRuleIterator Ogre::Technique::getGPUVendorRuleIterator | ( |  | ) | const

Deprecated
  use getGPUVendorRules()

## ◆ getGPUVendorRules()

const GPUVendorRuleList & Ogre::Technique::getGPUVendorRules | ( |  | ) | const
| inline

Get the currently registered vendor rules.

## ◆ addGPUDeviceNameRule() [1/2]

void Ogre::Technique::addGPUDeviceNameRule | ( | const String & | devicePattern,
|  | IncludeOrExclude | includeOrExclude,
|  | bool | caseSensitive = false )

Add a rule which manually influences the support for this technique based on a pattern that matches a GPU device name (e.g.

'8800').

You can use this facility to manually control whether a technique is considered supported, based on a GPU device name pattern. You can add inclusive or exclusive rules, and you can add as many of each as you like. If at least one inclusive rule is added, a technique is considered unsupported if it does not match any of those inclusive rules. If exclusive rules are added, the technique is considered unsupported if it matches any of those inclusive rules. The pattern you supply can include wildcard characters ('*') if you only want to match part of the device name.

Note
  Any rule for the same device pattern will be removed before adding this one.

Parameters

  devicePattern | The GPU vendor
  includeOrExclude | Whether this is an inclusive or exclusive rule
  caseSensitive | Whether the match is case sensitive or not

## ◆ addGPUDeviceNameRule() [2/2]

void Ogre::Technique::addGPUDeviceNameRule | ( | const GPUDeviceNameRule & | rule | ) |

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

## ◆ removeGPUDeviceNameRule()

void Ogre::Technique::removeGPUDeviceNameRule | ( | const String & | devicePattern | ) |

Removes a matching device name rule.

See also
  addGPUDeviceNameRule

## ◆ getGPUDeviceNameRuleIterator()

GPUDeviceNameRuleIterator Ogre::Technique::getGPUDeviceNameRuleIterator | ( |  | ) | const

Deprecated
  use getGPUDeviceNameRules()

## ◆ getGPUDeviceNameRules()

const GPUDeviceNameRuleList & Ogre::Technique::getGPUDeviceNameRules | ( |  | ) | const
| inline

Get the currently registered device name rules.

## ◆ getUserObjectBindings() [1/2]

UserObjectBindings & Ogre::Technique::getUserObjectBindings | ( |  | ) |
| inline

Class that provides convenient interface to establish a linkage between custom user application objects and Ogre core classes.

## ◆ getUserObjectBindings() [2/2]

const UserObjectBindings & Ogre::Technique::getUserObjectBindings | ( |  | ) | const
| inline

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

The documentation for this class was generated from the following file:

- OgreTechnique.h