OGRE-Next
2.3
Object-Oriented Graphics Rendering Engine
|
Contains information needed by PBS (Physically Based Shading) for OpenGL 3+ & D3D11+. More...
#include <OgreHlmsUnlitDatablock.h>
Public Member Functions | |
HlmsUnlitDatablock (IdString name, HlmsUnlit *creator, const HlmsMacroblock *macroblock, const HlmsBlendblock *blendblock, const HlmsParamVec ¶ms) | |
Valid parameters in params: More... | |
virtual | ~HlmsUnlitDatablock () |
virtual void | calculateHash () |
const Matrix4 & | getAnimationMatrix (uint8 textureUnit) const |
UnlitBlendModes | getBlendMode (uint8 texType) const |
ColourValue | getColour () const |
Gets the current colour. The returned value is meaningless if mHasColour is false. More... | |
virtual ColourValue | getDiffuseColour () const |
virtual ColourValue | getEmissiveColour () const |
virtual TextureGpu * | getEmissiveTexture () const |
bool | getEnableAnimationMatrix (uint8 textureUnit) const |
bool | getEnablePlanarReflection (uint8 textureUnit) const |
uint8 | getTextureUvSource (uint8 sourceType) const |
bool | hasColour () const |
If this returns false, the values of mR, mG, mB & mA will be ignored. More... | |
void | setAnimationMatrix (uint8 textureUnit, const Matrix4 &matrix) |
void | setBlendMode (uint8 texType, UnlitBlendModes blendMode) |
Sets the blending mode (how the texture unit gets layered on top of the previous texture units). More... | |
void | setColour (const ColourValue &diffuse) |
Sets a new colour value. Asserts if mHasColour is false. More... | |
void | setEnableAnimationMatrix (uint8 textureUnit, bool bEnable) |
Enables the animation of the given texture unit. More... | |
void | setEnablePlanarReflection (uint8 textureUnit, bool bEnable) |
Set to true if the texture at the given texture unit is a planar reflection texture. More... | |
void | setTexture (uint8 texUnit, const String &name, const HlmsSamplerblock *refParams=0) |
void | setTextureSwizzle (uint8 texType, uint8 r, uint8 g, uint8 b, uint8 a) |
Sets the final swizzle when sampling the given texture. More... | |
void | setTextureUvSource (uint8 sourceType, uint8 uvSet) |
Sets which UV set to use for the given texture. More... | |
void | setUseColour (bool useColour) |
Controls whether the value in. More... | |
Public Attributes | |
Matrix4 | mTextureMatrices [NUM_UNLIT_TEXTURE_TYPES] |
Static Public Attributes | |
static const uint8 | A_MASK |
static const uint8 | B_MASK |
static const uint8 | G_MASK |
static const size_t | MaterialSizeInGpu |
static const size_t | MaterialSizeInGpuAligned |
static const uint8 | R_MASK |
Friends | |
class | HlmsUnlit |
Contains information needed by PBS (Physically Based Shading) for OpenGL 3+ & D3D11+.
Ogre::HlmsUnlitDatablock::HlmsUnlitDatablock | ( | IdString | name, |
HlmsUnlit * | 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 <#tex_unit> [<#tex_unit> <#tex_unit> ... <#tex_unit>] Enables texture animation through a 4x4 matrix for the specified textures. Default: All texture animation/manipulation disabled. Example: animate 0 1 2 3 4 14 15
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 |
|
virtual |
UnlitBlendModes Ogre::HlmsUnlitDatablock::getBlendMode | ( | uint8 | texType | ) | const |
|
inline |
Gets the current colour. The returned value is meaningless if mHasColour is false.
|
virtual |
|
virtual |
|
virtual |
bool Ogre::HlmsUnlitDatablock::getEnableAnimationMatrix | ( | uint8 | textureUnit | ) | const |
bool Ogre::HlmsUnlitDatablock::getEnablePlanarReflection | ( | uint8 | textureUnit | ) | const |
|
inline |
If this returns false, the values of mR, mG, mB & mA will be ignored.
void Ogre::HlmsUnlitDatablock::setBlendMode | ( | uint8 | texType, |
UnlitBlendModes | blendMode | ||
) |
Sets the blending mode (how the texture unit gets layered on top of the previous texture units).
Calling this function triggers a HlmsDatablock::flushRenderables.
texType | The texture unit. Must be in range [1; NUM_UNLIT_TEXTURE_TYPES) The value 0 is ignored. |
blendMode | The blending mode to use. |
void Ogre::HlmsUnlitDatablock::setColour | ( | const ColourValue & | diffuse | ) |
Sets a new colour value. Asserts if mHasColour is false.
void Ogre::HlmsUnlitDatablock::setEnableAnimationMatrix | ( | uint8 | textureUnit, |
bool | bEnable | ||
) |
Enables the animation of the given texture unit.
Calling this function triggers a HlmsDatablock::flushRenderables.
textureUnit | Texture unit. Must be in range [0; NUM_UNLIT_TEXTURE_TYPES) |
bEnable | Whether to enable or disable. Default is disabled. |
void Ogre::HlmsUnlitDatablock::setEnablePlanarReflection | ( | uint8 | textureUnit, |
bool | bEnable | ||
) |
Set to true if the texture at the given texture unit is a planar reflection texture.
UVs will be ignored for that texture unit. Calling this function triggers a HlmsDatablock::flushRenderables.
textureUnit | Texture unit. Must be in range [0; NUM_UNLIT_TEXTURE_TYPES) |
bEnable | Whether to enable or disable. Default is disabled. |
void Ogre::HlmsUnlitDatablock::setTexture | ( | uint8 | texUnit, |
const String & | name, | ||
const HlmsSamplerblock * | refParams = 0 |
||
) |
void Ogre::HlmsUnlitDatablock::setTextureSwizzle | ( | uint8 | texType, |
uint8 | r, | ||
uint8 | g, | ||
uint8 | b, | ||
uint8 | a | ||
) |
Sets the final swizzle when sampling the given texture.
e.g. calling setTextureSwizzle( 0, R_MASK, G_MASK, R_MASK, G_MASK ); will generated the following pixel shader: vec4 texColour = texture( tex, uv ).xyxy;
Calling this function triggers a HlmsDatablock::flushRenderables.
texType | Texture unit. Must be in range [0; NUM_UNLIT_TEXTURE_TYPES) |
r | Where to source the red channel from. Must be R_MASK, G_MASK, B_MASK or A_MASK. Default: R_MASK |
g | Where to source the green channel from. Default: G_MASK |
b | Where to source the blue channel from. Default: B_MASK |
a | Where to source the alpha channel from. Default: A_MASK |
Sets which UV set to use for the given texture.
Calling this function triggers a HlmsDatablock::flushRenderables.
sourceType | Source texture to modify. Must be in range [0; NUM_UNLIT_TEXTURE_TYPES) |
uvSet | UV coordinate set. Value must be between in range [0; 8) |
void Ogre::HlmsUnlitDatablock::setUseColour | ( | bool | useColour | ) |
Controls whether the value in.
|
friend |
|
static |
|
static |
|
static |
|
static |
|
static |
Matrix4 Ogre::HlmsUnlitDatablock::mTextureMatrices[NUM_UNLIT_TEXTURE_TYPES] |
|
static |