|
| Material (ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0) |
| Constructor - use resource manager's create method rather than this.
|
|
| ~Material () override |
|
const LodValueArray * | _getLodValues () const |
|
void | _notifyNeedsRecompile () |
| Tells the material that it needs recompilation.
|
|
bool | applyTextureAliases (const AliasTextureNamePairList &aliasList, const bool apply=true) const |
| Applies texture names to Texture Unit State with matching texture name aliases.
|
|
MaterialPtr | clone (const String &newName, bool changeGroup=false, const String &newGroup=BLANKSTRING) const |
| Creates a new copy of this material with the same settings but a new name.
|
|
void | compile (bool autoManageTextureUnits=true) |
| 'Compiles' this Material.
|
|
void | copyDetailsTo (MaterialPtr &mat) const |
| Copies the details of this material into another, preserving the target's handle and name (unlike operator=) but copying everything else.
|
|
Technique * | createTechnique () |
| Creates a new Technique for this Material.
|
|
Technique * | getBestTechnique (unsigned short lodIndex=0, const Renderable *rend=0) |
| Gets the best supported technique.
|
|
bool | getCompilationRequired () const |
| Gets the compilation status of the material.
|
|
LodValueIterator | getLodValueIterator () const |
| Gets an iterator over the list of values transformed by the LodStrategy at which each LOD comes into effect.
|
|
unsigned short | getNumLodLevels (const String &schemeName) const |
| Gets the number of levels-of-detail this material has in the given scheme, based on Technique::setLodIndex.
|
|
unsigned short | getNumLodLevels (unsigned short schemeIndex) const |
| Gets the number of levels-of-detail this material has in the given scheme, based on Technique::setLodIndex.
|
|
unsigned short | getNumSupportedTechniques () const |
| Retrieves the number of supported techniques.
|
|
unsigned short | getNumTechniques () const |
| Retrieves the number of techniques.
|
|
bool | getReceiveShadows () const |
| Returns whether or not objects using this material will receive shadows.
|
|
Technique * | getSupportedTechnique (unsigned short index) |
| Gets the indexed supported technique.
|
|
TechniqueIterator | getSupportedTechniqueIterator () |
| Gets an iterator over all the Techniques which are supported by the current card.
|
|
Technique * | getTechnique (const String &name) |
| searches for the named technique.
|
|
Technique * | getTechnique (unsigned short index) |
| Gets the indexed technique.
|
|
TechniqueIterator | getTechniqueIterator () |
| Get an iterator over the Techniques in this Material.
|
|
bool | getTransparencyCastsShadows () const |
| Returns whether or not objects using this material be classified as opaque to the shadow caster system.
|
|
const String & | getUnsupportedTechniquesExplanation () const |
| Gets a string explaining why any techniques are not supported.
|
|
LodValueIterator | getUserLodValueIterator () const |
| Gets an iterator over the user-defined list of values which are internally transfomed by the LodStrategy.
|
|
bool | isTransparent () const |
| Determines if the material has any transparency with the rest of the scene (derived from whether any Techniques say they involve transparency).
|
|
Material & | operator= (const Material &rhs) |
| Assignment operator to allow easy copying between materials.
|
|
void | removeAllTechniques () |
| Removes all the techniques in this Material.
|
|
void | removeTechnique (unsigned short index) |
| Removes the technique at the given index.
|
|
void | setAmbient (const ColourValue &ambient) |
| Sets the ambient colour reflectance properties for every Pass in every Technique.
|
|
void | setAmbient (Real red, Real green, Real blue) |
| Sets the ambient colour reflectance properties for every Pass in every Technique.
|
|
void | setBlendblock (const HlmsBlendblock &blendblock) |
| Sets the blendbock to every pass.
|
|
void | setColourWriteEnabled (bool enabled) |
| Sets whether or not colour buffer writing is enabled for each Pass.
|
|
void | setDiffuse (const ColourValue &diffuse) |
| Sets the diffuse colour reflectance properties of every Pass in every Technique.
|
|
void | setDiffuse (Real red, Real green, Real blue, Real alpha) |
| Sets the diffuse colour reflectance properties of every Pass in every Technique.
|
|
void | setFog (bool overrideScene, FogMode mode=FOG_NONE, const ColourValue &colour=ColourValue::White, Real expDensity=Real(0.001), Real linearStart=0.0, Real linearEnd=1.0) |
| Sets the fogging mode applied to each pass.
|
|
void | setLodLevels (const LodValueArray &lodValues) |
| Sets the distance at which level-of-detail (LOD) levels come into effect.
|
|
void | setMacroblock (const HlmsMacroblock ¯oblock) |
| Sets the macroblock for all passes.
|
|
void | setPointSize (Real ps) |
| Sets the point size properties for every Pass in every Technique.
|
|
void | setReceiveShadows (bool enabled) |
| Sets whether objects using this material will receive shadows.
|
|
void | setSamplerblock (const HlmsSamplerblock &samplerblock) |
| Set samplerblock for every texture unit in every Technique and Pass.
|
|
void | setSelfIllumination (const ColourValue &selfIllum) |
| Sets the amount of self-illumination of every Pass in every Technique.
|
|
void | setSelfIllumination (Real red, Real green, Real blue) |
| Sets the amount of self-illumination of every Pass in every Technique.
|
|
void | setShadingMode (ShadeOptions mode) |
| Sets the type of light shading required.
|
|
void | setShininess (Real val) |
| Sets the shininess properties of every Pass in every Technique.
|
|
void | setSpecular (const ColourValue &specular) |
| Sets the specular colour reflectance properties of every Pass in every Technique.
|
|
void | setSpecular (Real red, Real green, Real blue, Real alpha) |
| Sets the specular colour reflectance properties of every Pass in every Technique.
|
|
void | setTransparencyCastsShadows (bool enabled) |
| Sets whether objects using this material be classified as opaque to the shadow caster system.
|
|
void | touch () override |
| 'Touches' the resource to indicate it has been used.
|
|
| Resource (ResourceManager *creator, const String &name, ResourceHandle handle, const String &group, bool isManual=false, ManualResourceLoader *loader=0) |
| Standard constructor.
|
|
virtual | ~Resource () |
| Virtual destructor.
|
|
virtual void | _dirtyState () |
| Manually mark the state of this resource as having been changed.
|
|
virtual void | _fireLoadingComplete (bool wasBackgroundLoaded) |
| Firing of loading complete event.
|
|
virtual void | _firePreparingComplete (bool wasBackgroundLoaded) |
| Firing of preparing complete event.
|
|
virtual void | _fireUnloadingComplete () |
| Firing of unloading complete event.
|
|
virtual void | _notifyOrigin (const String &origin) |
| Notify this resource of it's origin.
|
|
virtual void | addListener (Listener *lis) |
| Register a listener on this resource.
|
|
virtual void | changeGroupOwnership (const String &newGroup) |
| Change the resource group ownership of a Resource.
|
|
virtual void | escalateLoading () |
| Escalates the loading of a background loaded resource.
|
|
virtual ResourceManager * | getCreator () |
| Gets the manager which created this resource.
|
|
virtual const String & | getGroup () const |
| Gets the group which this resource is a member of.
|
|
virtual ResourceHandle | getHandle () const |
|
virtual LoadingState | getLoadingState () const |
| Returns the current loading state.
|
|
virtual const String & | getName () const |
| Gets resource name.
|
|
virtual const String & | getOrigin () const |
| Get the origin of this resource, e.g.
|
|
virtual size_t | getSize () const |
| Retrieves info about the size of the resource.
|
|
virtual size_t | getStateCount () const |
| Returns the number of times this resource has changed state, which generally means the number of times it has been loaded.
|
|
virtual bool | isBackgroundLoaded () const |
| Returns whether this Resource has been earmarked for background loading.
|
|
virtual bool | isLoaded () const |
| Returns true if the Resource has been loaded, false otherwise.
|
|
virtual bool | isLoading () const |
| Returns whether the resource is currently in the process of background loading.
|
|
virtual bool | isManuallyLoaded () const |
| Is this resource manually loaded?
|
|
virtual bool | isPrepared () const |
| Returns true if the Resource has been prepared, false otherwise.
|
|
virtual bool | isReloadable () const |
| Returns true if the Resource is reloadable, false otherwise.
|
|
virtual void | load (bool backgroundThread=false) |
| Loads the resource, if it is not already.
|
|
bool | markForReload () |
|
virtual void | prepare (bool backgroundThread=false) |
| Prepares the resource for load, if it is not already.
|
|
virtual void | reload (LoadingFlags flags=LF_DEFAULT) |
| Reloads the resource, if it is already loaded.
|
|
virtual void | removeListener (Listener *lis) |
| Remove a listener on this resource.
|
|
virtual void | setBackgroundLoaded (bool bl) |
| Tells the resource whether it is background loaded or not.
|
|
virtual void | setManuallyLoaded (bool isManual) |
| Set "Is this resource manually loaded?".
|
|
virtual void | setToLoaded () |
| Change the Resource loading state to loaded.
|
|
virtual void | unload () |
| Unloads the resource; this is not permanent, the resource can be reloaded later if required.
|
|
| StringInterface () |
|
virtual | ~StringInterface () |
| Virtual destructor, see Effective C++.
|
|
virtual void | copyParametersTo (StringInterface *dest) const |
| Method for copying this object's parameters to another object.
|
|
ParamDictionary * | getParamDictionary () |
| Retrieves the parameter dictionary for this class.
|
|
const ParamDictionary * | getParamDictionary () const |
|
virtual String | getParameter (const String &name) const |
| Generic parameter retrieval method.
|
|
const ParameterList & | getParameters () const |
| Retrieves a list of parameters valid for this object.
|
|
virtual bool | setParameter (const String &name, const String &value) |
| Generic parameter setting method.
|
|
virtual void | setParameterList (const NameValuePairList ¶mList) |
| Generic multiple parameter setting method.
|
|
Class encapsulates rendering properties of an object.
- A Material can be rendered in multiple different ways depending on the hardware available. You may configure a Material to use high-complexity fragment shaders, but these won't work on every card; therefore a Technique is an approach to creating the visual effect you are looking for. You are advised to create fallback techniques with lower hardware requirements if you decide to use advanced features. In addition, you also might want lower-detail techniques for distant geometry.
- Each technique can be made up of multiple passes. Programmable passes, however, cannot be split down automatically, so if the active graphics card cannot handle the technique which contains these passes, OGRE will try to find another technique which the card can do. If, at the end of the day, the card cannot handle any of the techniques which are listed for the material, the engine will render the geometry plain white, which should alert you to the problem.
Note: Using multiple passes hasn't been tested in Ogre-Next 2.x at all and may no longer work. It definitely needs at least RenderQueue::V1_LEGACY
- Ogre comes configured with a number of default settings for a newly created material. These can be changed if you wish by retrieving the default material settings through SceneManager::getDefaultMaterialSettings. Any changes you make to the Material returned from this method will apply to any materials created from this point onward.