OGRE
2.2.4
Object-Oriented Graphics Rendering Engine
|
Contains information needed by the UI (2D) for OpenGL ES 2.0. More...
#include <OgreHlmsUnlitMobileDatablock.h>
Classes | |
struct | UvAtlasParams |
Public Member Functions | |
HlmsUnlitMobileDatablock (IdString name, Hlms *creator, const HlmsMacroblock *macroblock, const HlmsBlendblock *blendblock, const HlmsParamVec ¶ms) | |
Valid parameters in params: More... | |
virtual | ~HlmsUnlitMobileDatablock () |
void | _linkRenderable (Renderable *renderable) |
void | _unlinkRenderable (Renderable *renderable) |
virtual void | calculateHash () |
Calculates the hashes needed for sorting by the RenderQueue (i.e. mTextureHash) More... | |
HlmsDatablock * | clone (String name) const |
Creates a copy of this datablock with the same settings, but a different name. More... | |
CompareFunction | getAlphaTest (void) const |
bool | getAlphaTestShadowCasterOnly (void) const |
float | getAlphaTestThreshold (void) const |
const HlmsBlendblock * | getBlendblock (bool casterBlock=false) const |
ColourValue | getColour (void) const |
Gets the current colour. The returned value is meaningless if mHasColour is false. More... | |
Hlms * | getCreator (void) const |
virtual ColourValue | getDiffuseColour (void) const |
Returns the closest match for a diffuse colour, if applicable by the actual implementation. More... | |
virtual TextureGpu * | getDiffuseTexture (void) const |
Returns the closest match for a diffuse texture, if applicable by the actual implementation. More... | |
virtual ColourValue | getEmissiveColour (void) const |
Returns the closest match for a emissive colour, if applicable by the actual implementation. More... | |
virtual TextureGpu * | getEmissiveTexture (void) const |
Returns the closest match for a emissive texture, if applicable by the actual implementation. More... | |
void | getFilenameAndResourceGroup (String const **outFilename, String const **outResourceGroup) const |
const vector< Renderable * >::type & | getLinkedRenderables (void) const |
const HlmsMacroblock * | getMacroblock (bool casterBlock=false) const |
IdString | getName (void) const |
const String * | getNameStr (void) const |
uint8 | getNumTextureUnitsInUse (void) const |
Returns the number of texture units that are actually used. More... | |
uint8 | getNumUvSets (void) const |
Calculates the amount of UV sets used by the datablock. More... | |
const HlmsSamplerblock * | getSamplerblock (uint8 texUnit) const |
TexturePtr | getTexture (uint8 texUnit) const |
bool | hasColour (void) const |
If this returns false, the values of mR, mG, mB & mA will be ignored. More... | |
virtual bool | hasCustomShadowMacroblock (void) const |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info More... | |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, void *ptr) |
placement operator new More... | |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info More... | |
void * | operator new[] (size_t sz) |
virtual void | saveTextures (const String &folderPath, set< String >::type &savedTextures, bool saveOitd, bool saveOriginal, HlmsTextureExportListener *listener) |
virtual void | setAlphaTest (CompareFunction compareFunction, bool shadowCasterOnly=false) |
Sets the alpha test to the given compare function. More... | |
virtual void | setAlphaTestThreshold (float threshold) |
Alpha test's threshold. More... | |
void | setBlendblock (const HlmsBlendblock &blendblock, bool casterBlock=false) |
Sets a new blendblock that matches the same parameter as the input. More... | |
void | setBlendblock (const HlmsBlendblock *blendblock, bool casterBlock=false) |
Sets the blendblock from the given pointer that was already retrieved from the HlmsManager. More... | |
void | setColour (const ColourValue &diffuse) |
Sets a new colour value. Asserts if mHasColour is false. More... | |
void | setMacroblock (const HlmsMacroblock ¯oblock, bool casterBlock=false) |
Sets a new macroblock that matches the same parameter as the input. More... | |
void | setMacroblock (const HlmsMacroblock *macroblock, bool casterBlock=false) |
Sets the macroblock from the given pointer that was already retrieved from the HlmsManager. More... | |
void | setSamplerblock (uint8 texUnit, const HlmsSamplerblock ¶ms) |
Sets a new sampler block to be associated with the texture (i.e. More... | |
void | setTexture (uint8 texUnit, TexturePtr &newTexture, const UvAtlasParams &atlasParams) |
Sets a new texture for rendering. More... | |
void | setTextureUvSource (uint8 texUnit, uint8 uvSet) |
Sets the set of UVs that will be used to sample from the texture unit. More... | |
void | setUseColour (bool useColour) |
Controls whether the value in. More... | |
Static Public Member Functions | |
static const char * | getCmpString (CompareFunction compareFunction) |
static UvAtlasParams | textureLocationToAtlasParams (const HlmsTextureManager::TextureLocation &texLocation) |
Public Attributes | |
bool | mAllowTextureResidencyChange |
When false, we won't try to have Textures become resident. More... | |
uint16 | mMacroblockHash [2] |
float | mShadowConstantBias |
uint32 | mTextureHash |
uint8 | mType |
Friends | |
class | HlmsUnlitMobile |
Contains information needed by the UI (2D) for OpenGL ES 2.0.
Ogre::HlmsUnlitMobileDatablock::HlmsUnlitMobileDatablock | ( | IdString | name, |
Hlms * | creator, | ||
const HlmsMacroblock * | macroblock, | ||
const HlmsBlendblock * | blendblock, | ||
const HlmsParamVec & | params | ||
) |
Valid parameters in params:
params | diffuse [r g b [a]] If absent, the values of mR, mG, mB & mA will be ignored by the pixel shader. When present, the rgba values can be specified. Default: Absent Default (when present): diffuse 1 1 1 1 |
diffuse_map [texture name] [#uv] Name of the diffuse texture for the base image (optional, otherwise a dummy is set) The #uv parameter is optional, and specifies the texcoord set that will be used. Valid range is [0; 8) If the Renderable doesn't have enough UV texcoords, HLMS will throw an exception.
Note: The UV set is evaluated when creating the Renderable cache.
diffuse_map1 [texture name] [blendmode] [#uv] Name of the diffuse texture that will be layered on top of the base image. The #uv parameter is optional. Valid range is [0; 8) The blendmode parameter is optional. Valid values are: NormalNonPremul, NormalPremul, Add, Subtract, Multiply, Multiply2x, Screen, Overlay, Lighten, Darken, GrainExtract, GrainMerge, Difference which are very similar to Photoshop/GIMP's blend modes. See Samples/Media/Hlms/GuiMobile/GLSL/BlendModes_piece_ps.glsl for the exact math. Default blendmode: NormalPremul Default uv: 0 Example: diffuse_map1 myTexture.png Add 3
diffuse_map2 through diffuse_map16 Same as diffuse_map1 but for subsequent layers to be applied on top of the previous images. You can't leave gaps (i.e. specify diffuse_map0 & diffuse_map2 but not diffuse_map1). Note that not all mobile HW supports 16 textures at the same time, thus we will just cut/ignore the extra textures that won't fit (we log a warning though).
animate <#uv> [<#uv> <#uv> ... <#uv>] Enables texture animation through a 4x4 matrix for the specified UV sets. Default: All UV set animation/manipulation disabled. Example: animate 0 1 2 3 4 5 6 7
alpha_test [compare_func] [threshold] When present, mAlphaTestThreshold is used. compare_func is optional. Valid values are: less, less_equal, equal, greater, greater_equal, not_equal Threshold is optional, and a value in the range (0; 1) Default: alpha_test less 0.5 Example: alpha_test equal 0.1
|
virtual |
|
inherited |
|
inherited |
|
virtual |
Calculates the hashes needed for sorting by the RenderQueue (i.e. mTextureHash)
Reimplemented from Ogre::HlmsDatablock.
|
inherited |
Creates a copy of this datablock with the same settings, but a different name.
name | Name of the cloned datablock. |
|
inherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
staticinherited |
|
inline |
Gets the current colour. The returned value is meaningless if mHasColour is false.
|
inlineinherited |
|
virtualinherited |
Returns the closest match for a diffuse colour, if applicable by the actual implementation.
Note that Unlit implementation returns 0 as diffuse, since it's considered emissive instead due to being bright even in the absence lights.
|
virtualinherited |
Returns the closest match for a diffuse texture, if applicable by the actual implementation.
|
virtualinherited |
Returns the closest match for a emissive colour, if applicable by the actual implementation.
|
virtualinherited |
Returns the closest match for a emissive texture, if applicable by the actual implementation.
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inline |
Returns the number of texture units that are actually used.
uint8 Ogre::HlmsUnlitMobileDatablock::getNumUvSets | ( | void | ) | const |
Calculates the amount of UV sets used by the datablock.
const HlmsSamplerblock* Ogre::HlmsUnlitMobileDatablock::getSamplerblock | ( | uint8 | texUnit | ) | const |
TexturePtr Ogre::HlmsUnlitMobileDatablock::getTexture | ( | uint8 | texUnit | ) | const |
|
inline |
If this returns false, the values of mR, mG, mB & mA will be ignored.
|
virtualinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
operator new, with debug line info
|
inlineinherited |
|
inlineinherited |
placement operator new
|
inlineinherited |
array operator new, with debug line info
|
inlineinherited |
|
virtualinherited |
folderPath | Folder where to dump the textures. |
savedTextures | [in/out] Set of texture names. Textures whose name is already in the set won't be saved again. Textures that were saved will be inserted into the set. |
saveOitd | When true, we will download the texture from GPU and save it in OITD format. OITD is faster to load as it's stored in Ogre's native format it understands, but it cannot be opened by traditional image editors; also OITD is not backwards compatible with older versions of Ogre. |
saveOriginal | When true, we will attempt to read the raw filestream of the original texture and save it (i.e. copy the original png/dds/etc file). |
Reimplemented in Ogre::OGRE_HLMS_TEXTURE_BASE_CLASS.
|
virtualinherited |
Sets the alpha test to the given compare function.
CMPF_ALWAYS_PASS means disabled.
compareFunction | Compare function to use. Default is CMPF_ALWAYS_PASS, which means disabled. Note: CMPF_ALWAYS_FAIL is not supported. Set a negative threshold to workaround this issue. |
|
virtualinherited |
Alpha test's threshold.
threshold | Value typically in the range [0; 1) |
Reimplemented in Ogre::HlmsPbsMobileDatablock.
|
inherited |
Sets a new blendblock that matches the same parameter as the input.
Decreases the reference count of the previous mBlendblock. Runs an O(N) search to get the right block. Calling this function triggers a HlmsDatablock::flushRenderables
blendblock | HlmsManager::getBlendblock |
casterBlock | True to directly set the blendblock to be used during the shadow mapping's caster pass. Note that when false, it will reset the caster block to the same as the regular one. |
|
inherited |
Sets the blendblock from the given pointer that was already retrieved from the HlmsManager.
Unlike the other overload, this operation is O(1). Calling this function triggers a HlmsDatablock::flushRenderables
blendblock | A valid block. The reference count is increased inside this function. |
casterBlock | True to directly set the blendblock to be used during the shadow mapping's caster pass. Note that when false, it will reset the caster block to the same as the regular one. |
void Ogre::HlmsUnlitMobileDatablock::setColour | ( | const ColourValue & | diffuse | ) |
Sets a new colour value. Asserts if mHasColour is false.
|
inherited |
Sets a new macroblock that matches the same parameter as the input.
Decreases the reference count of the previously set one. Runs an O(N) search to get the right block. Calling this function triggers a HlmsDatablock::flushRenderables
macroblock | HlmsManager::getMacroblock |
casterBlock | True to directly set the macroblock to be used during the shadow mapping's caster pass. Note that when false, it will automatically reset the caster's block according to HlmsManager::setShadowMappingUseBackFaces setting. |
|
inherited |
Sets the macroblock from the given pointer that was already retrieved from the HlmsManager.
Unlike the other overload, this operation is O(1). Calling this function triggers a HlmsDatablock::flushRenderables
macroblock | A valid block. The reference count is increased inside this function. |
casterBlock | True to directly set the macroblock to be used during the shadow mapping's caster pass. Note that when false, it will automatically reset the caster's block according to HlmsManager::setShadowMappingUseBackFaces setting. |
void Ogre::HlmsUnlitMobileDatablock::setSamplerblock | ( | uint8 | texUnit, |
const HlmsSamplerblock & | params | ||
) |
Sets a new sampler block to be associated with the texture (i.e.
filtering mode, addressing modes, etc).
texUnit | ID of the texture unit. Must be in range [0; 16) otherwise throws. |
params | The sampler block to use as reference. |
void Ogre::HlmsUnlitMobileDatablock::setTexture | ( | uint8 | texUnit, |
TexturePtr & | newTexture, | ||
const UvAtlasParams & | atlasParams | ||
) |
Sets a new texture for rendering.
texUnit | ID of the texture unit. Must be in range [0; 16) otherwise throws. |
newTexture | Texture to change to. Can't be null, otherwise throws (use a blank texture). |
atlasParams | The atlas offsets in case this texture is an atlas or an array texture |
Sets the set of UVs that will be used to sample from the texture unit.
texUnit | ID of the texture unit. Must be in range [0; 16) otherwise throws. |
uvSet | The uv set. Must be in range [0; 8) otherwise throws. If the datablock is assigned to a mesh that has less UV sets than required, it will throw during the assignment. |
void Ogre::HlmsUnlitMobileDatablock::setUseColour | ( | bool | useColour | ) |
Controls whether the value in.
|
static |
|
friend |
|
inherited |
When false, we won't try to have Textures become resident.
|
inherited |
|
inherited |
|
inherited |
|
inherited |