/usr/include/OGRE/OgreTechnique.h is in libogre-1.9-dev 1.9.0+dfsg1-7+b4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 | /*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __Technique_H__
#define __Technique_H__
#include "OgrePrerequisites.h"
#include "OgreIteratorWrappers.h"
#include "OgreBlendMode.h"
#include "OgreCommon.h"
#include "OgrePass.h"
#include "OgreIteratorWrappers.h"
#include "OgreRenderSystemCapabilities.h"
#include "OgreUserObjectBindings.h"
namespace Ogre {
/** \addtogroup Core
* @{
*/
/** \addtogroup Materials
* @{
*/
/** Class representing an approach to rendering this particular Material.
@remarks
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).
*/
class _OgreExport Technique : public TechniqueAlloc
{
protected:
/// Illumination pass state type
enum IlluminationPassesState
{
IPS_COMPILE_DISABLED = -1,
IPS_NOT_COMPILED = 0,
IPS_COMPILED = 1
};
typedef vector<Pass*>::type Passes;
/// List of primary passes
Passes mPasses;
/// List of derived passes, categorised into IlluminationStage (ordered)
IlluminationPassList mIlluminationPasses;
// Raw pointer since we don't want child to stop parent's destruction
Material* mParent;
bool mIsSupported;
IlluminationPassesState mIlluminationPassesCompilationPhase;
/// LOD level
unsigned short mLodIndex;
/** Scheme index, derived from scheme name but the names are held on
MaterialManager, for speed an index is used here.
*/
unsigned short mSchemeIndex;
/// Optional name for the technique
String mName;
/// Internal method for clearing illumination pass list
void clearIlluminationPasses(void);
/// Internal method - check for manually assigned illumination passes
bool checkManuallyOrganisedIlluminationPasses();
/** When casting shadow, if not using default Ogre shadow casting material, or
* nor using fixed function casting, mShadowCasterMaterial let you customize per material
* shadow caster behavior
*/
MaterialPtr mShadowCasterMaterial;
/** When casting shadow, if not using default Ogre shadow casting material, or
* nor using fixed function casting, mShadowCasterMaterial let you customize per material
* shadow caster behavior.There only material name is stored so that it can be loaded once all file parsed in a resource group.
*/
String mShadowCasterMaterialName;
/** When receiving shadow, if not using default Ogre shadow receiving material, or
* nor using fixed function texture projection receiving, mShadowReceiverMaterial let you customize per material
* shadow caster behavior
*/
MaterialPtr mShadowReceiverMaterial;
/** When receiving shadow, if not using default Ogre shadow receiving material, or
* nor using fixed function texture projection receiving, mShadowReceiverMaterial let you customize per material
* shadow caster behavior. There only material name is stored so that it can be loaded once all file parsed in a resource group.
*/
String mShadowReceiverMaterialName;
// User objects binding.
UserObjectBindings mUserObjectBindings;
public:
/** Directive used to manually control technique support based on the
inclusion or exclusion of some factor.
*/
enum IncludeOrExclude
{
/// Inclusive - only support if present
INCLUDE = 0,
/// Exclusive - do not support if present
EXCLUDE = 1
};
/// Rule controlling whether technique is deemed supported based on GPU vendor
struct GPUVendorRule
{
GPUVendor vendor;
IncludeOrExclude includeOrExclude;
GPUVendorRule()
: vendor(GPU_UNKNOWN), includeOrExclude(EXCLUDE) {}
GPUVendorRule(GPUVendor v, IncludeOrExclude ie)
: vendor(v), includeOrExclude(ie) {}
};
/// Rule controlling whether technique is deemed supported based on GPU device name
struct GPUDeviceNameRule
{
String devicePattern;
IncludeOrExclude includeOrExclude;
bool caseSensitive;
GPUDeviceNameRule()
: includeOrExclude(EXCLUDE), caseSensitive(false) {}
GPUDeviceNameRule(const String& pattern, IncludeOrExclude ie, bool caseSen)
: devicePattern(pattern), includeOrExclude(ie), caseSensitive(caseSen) {}
};
typedef vector<GPUVendorRule>::type GPUVendorRuleList;
typedef vector<GPUDeviceNameRule>::type GPUDeviceNameRuleList;
protected:
GPUVendorRuleList mGPUVendorRules;
GPUDeviceNameRuleList mGPUDeviceNameRules;
public:
/// Constructor
Technique(Material* parent);
/// Copy constructor
Technique(Material* parent, const Technique& oth);
~Technique();
/** Indicates if this technique is supported by the current graphics card.
@remarks
This will only be correct after the Technique has been compiled, which is
usually done from Material::compile.
*/
bool isSupported(void) const;
/** Internal compilation method; see Material::compile.
@return Any information explaining problems with the compile.
*/
String _compile(bool autoManageTextureUnits);
/// Internal method for checking GPU vendor / device rules
bool checkGPURules(StringUtil::StrStreamType& errors);
/// Internal method for checking hardware support
bool checkHardwareSupport(bool autoManageTextureUnits, StringUtil::StrStreamType& compileErrors);
/** Internal method for splitting the passes into illumination passes. */
void _compileIlluminationPasses(void);
size_t calculateSize(void) const;
/** Creates a new Pass for this Technique.
@remarks
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.
*/
Pass* createPass(void);
/** Retrieves the Pass with the given index. */
Pass* getPass(unsigned short index);
/** Retrieves the Pass matching name.
Returns 0 if name match is not found.
*/
Pass* getPass(const String& name);
/** Retrieves the number of passes. */
unsigned short getNumPasses(void) const;
/** Removes the Pass with the given index. */
void removePass(unsigned short index);
/** Removes all Passes from this Technique. */
void removeAllPasses(void);
/** Move a pass from source index to destination index.
If successful then returns true.
*/
bool movePass(const unsigned short sourceIndex, const unsigned short destinationIndex);
typedef VectorIterator<Passes> PassIterator;
/** Gets an iterator over the passes in this Technique. */
const PassIterator getPassIterator(void);
typedef VectorIterator<IlluminationPassList> IlluminationPassIterator;
/** Gets an iterator over the illumination-stage categorised passes. */
const IlluminationPassIterator getIlluminationPassIterator(void);
/// Gets the parent Material
Material* getParent(void) const { return mParent; }
/** Overloaded operator to copy on Technique to another. */
Technique& operator=(const Technique& rhs);
/// Gets the resource group of the ultimate parent Material
const String& getResourceGroup(void) const;
/** Returns true if this Technique involves transparency.
@remarks
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.
*/
bool isTransparent(void) const;
/** Returns true if this Technique has transparent sorting enabled.
@remarks
This basically boils down to whether the first pass
has transparent sorting enabled or not
*/
bool isTransparentSortingEnabled(void) const;
/** Returns true if this Technique has transparent sorting forced.
@remarks
This basically boils down to whether the first pass
has transparent sorting forced or not
*/
bool isTransparentSortingForced(void) const;
/** Internal prepare method, derived from call to Material::prepare. */
void _prepare(void);
/** Internal unprepare method, derived from call to Material::unprepare. */
void _unprepare(void);
/** Internal load method, derived from call to Material::load. */
void _load(void);
/** Internal unload method, derived from call to Material::unload. */
void _unload(void);
/// Is this loaded?
bool isLoaded(void) const;
/** Tells the technique that it needs recompilation. */
void _notifyNeedsRecompile(void);
/** return this material specific shadow casting specific material
*/
Ogre::MaterialPtr getShadowCasterMaterial() const;
/** set this material specific shadow casting specific material
*/
void setShadowCasterMaterial(Ogre::MaterialPtr val);
/** set this material specific shadow casting specific material
*/
void setShadowCasterMaterial(const Ogre::String &name);
/** return this material specific shadow receiving specific material
*/
Ogre::MaterialPtr getShadowReceiverMaterial() const;
/** set this material specific shadow receiving specific material
*/
void setShadowReceiverMaterial(Ogre::MaterialPtr val);
/** set this material specific shadow receiving specific material
*/
void setShadowReceiverMaterial(const Ogre::String &name);
// -------------------------------------------------------------------------------
// 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
/** 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 Pass::setPointSize
*/
void setPointSize(Real ps);
/** 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 Pass::setAmbient
*/
void setAmbient(Real red, Real green, Real 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 Pass::setAmbient
*/
void setAmbient(const ColourValue& ambient);
/** 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 Pass::setDiffuse
*/
void setDiffuse(Real red, Real green, Real blue, Real 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 Pass::setDiffuse
*/
void setDiffuse(const ColourValue& diffuse);
/** 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 Pass::setSpecular
*/
void setSpecular(Real red, Real green, Real blue, Real 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 Pass::setSpecular
*/
void setSpecular(const ColourValue& specular);
/** 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 Pass::setShininess
*/
void setShininess(Real val);
/** 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 Pass::setSelfIllumination
*/
void setSelfIllumination(Real red, Real green, Real 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 Pass::setSelfIllumination
*/
void setSelfIllumination(const ColourValue& selfIllum);
/** 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 Pass::setDepthCheckEnabled
*/
void setDepthCheckEnabled(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 Pass::setDepthWriteEnabled
*/
void setDepthWriteEnabled(bool enabled);
/** 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 Pass::setDepthFunction
*/
void setDepthFunction( CompareFunction func );
/** 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 Pass::setColourWriteEnabled
*/
void setColourWriteEnabled(bool enabled);
/** 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 Pass::setCullingMode
*/
void setCullingMode( CullingMode 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 Pass::setManualCullingMode
*/
void setManualCullingMode( ManualCullingMode mode );
/** 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 Pass::setLightingEnabled
*/
void setLightingEnabled(bool enabled);
/** 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 Pass::setShadingMode
*/
void setShadingMode( ShadeOptions mode );
/** 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 Pass::setFog
*/
void setFog(
bool overrideScene,
FogMode mode = FOG_NONE,
const ColourValue& colour = ColourValue::White,
Real expDensity = 0.001, Real linearStart = 0.0, Real linearEnd = 1.0 );
/** 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 Pass::setDepthBias
*/
void setDepthBias(float constantBias, float slopeScaleBias);
/** 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 TextureUnitState::setTextureFiltering
*/
void setTextureFiltering(TextureFilterOptions filterType);
/** 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 TextureUnitState::setTextureAnisotropy
*/
void setTextureAnisotropy(unsigned int maxAniso);
/** 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 Pass::setSceneBlending
*/
void setSceneBlending( const SceneBlendType sbt );
/** 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 Pass::setSeparateSceneBlending
*/
void setSeparateSceneBlending( const SceneBlendType sbt, const SceneBlendType sbta );
/** 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 Pass::setSceneBlending
*/
void setSceneBlending( const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor);
/** 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 Pass::setSeparateSceneBlending
*/
void setSeparateSceneBlending( const SceneBlendFactor sourceFactor, const SceneBlendFactor destFactor, const SceneBlendFactor sourceFactorAlpha, const SceneBlendFactor destFactorAlpha);
/** Assigns a level-of-detail (LOD) index to this Technique.
@remarks
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.
@par
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.
@par
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.
*/
void setLodIndex(unsigned short index);
/** Gets the level-of-detail index assigned to this Technique. */
unsigned short getLodIndex(void) const { return mLodIndex; }
/** Set the 'scheme name' for this technique.
@remarks
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.
@par
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.
*/
void setSchemeName(const String& schemeName);
/** Returns the scheme to which this technique is assigned.
@see Technique::setSchemeName
*/
const String& getSchemeName(void) const;
/// Internal method for getting the scheme index
unsigned short _getSchemeIndex(void) const;
/** Is depth writing going to occur on this technique? */
bool isDepthWriteEnabled(void) const;
/** Is depth checking going to occur on this technique? */
bool isDepthCheckEnabled(void) const;
/** Exists colour writing disabled pass on this technique? */
bool hasColourWriteDisabled(void) const;
/** Set the name of the technique.
@remarks
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.
*/
void setName(const String& name);
/// Gets the name of the technique
const String& getName(void) const { return mName; }
/** Applies texture names to Texture Unit State with matching texture name aliases.
All passes, and Texture Unit States within the technique are checked.
If matching texture aliases are found then true is returned.
@param
aliasList is a map container of texture alias, texture name pairs
@param
apply set true to apply the texture aliases else just test to see if texture alias matches are found.
@return
True if matching texture aliases were found in the Technique.
*/
bool applyTextureAliases(const AliasTextureNamePairList& aliasList, const bool apply = true) const;
/** Add a rule which manually influences the support for this technique based
on a GPU vendor.
@remarks
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.
@param vendor The GPU vendor
@param includeOrExclude Whether this is an inclusive or exclusive rule
*/
void addGPUVendorRule(GPUVendor vendor, IncludeOrExclude includeOrExclude);
/** Add a rule which manually influences the support for this technique based
on a GPU vendor.
@remarks
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.
*/
void addGPUVendorRule(const GPUVendorRule& rule);
/** Removes a matching vendor rule.
@see addGPUVendorRule
*/
void removeGPUVendorRule(GPUVendor vendor);
typedef ConstVectorIterator<GPUVendorRuleList> GPUVendorRuleIterator;
/// Get an iterator over the currently registered vendor rules.
GPUVendorRuleIterator getGPUVendorRuleIterator() const;
/** Add a rule which manually influences the support for this technique based
on a pattern that matches a GPU device name (e.g. '*8800*').
@remarks
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.
@param devicePattern The GPU vendor
@param includeOrExclude Whether this is an inclusive or exclusive rule
@param caseSensitive Whether the match is case sensitive or not
*/
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. '*8800*').
@remarks
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.
*/
void addGPUDeviceNameRule(const GPUDeviceNameRule& rule);
/** Removes a matching device name rule.
@see addGPUDeviceNameRule
*/
void removeGPUDeviceNameRule(const String& devicePattern);
typedef ConstVectorIterator<GPUDeviceNameRuleList> GPUDeviceNameRuleIterator;
/// Get an iterator over the currently registered device name rules.
GPUDeviceNameRuleIterator getGPUDeviceNameRuleIterator() const;
/** Return an instance of user objects binding associated with this class.
You can use it to associate one or more custom objects with this class instance.
@see UserObjectBindings::setUserAny.
*/
UserObjectBindings& getUserObjectBindings() { return mUserObjectBindings; }
/** Return an instance of user objects binding associated with this class.
You can use it to associate one or more custom objects with this class instance.
@see UserObjectBindings::setUserAny.
*/
const UserObjectBindings& getUserObjectBindings() const { return mUserObjectBindings; }
};
/** @} */
/** @} */
}
#endif
|