Castor3D
..
|
Definition of a material pass. More...
Classes | |
class | BinaryParser |
Pass loader. More... | |
class | TextLoader |
Pass loader. More... | |
Public Member Functions | |
C3D_API | Pass (Engine &p_engine, MaterialSPtr p_parent=nullptr) |
Constructor. More... | |
C3D_API | ~Pass () |
Destructor. More... | |
C3D_API void | Initialise () |
Initialises the pass and all it's dependencies. More... | |
C3D_API void | Cleanup () |
Cleans up the pass and all it's dependencies. More... | |
C3D_API void | BindToNode (RenderNode &p_node) |
Binds this pass to given render node. More... | |
C3D_API void | BindToNode (SceneRenderNode &p_node) |
Binds this pass to given render node. More... | |
C3D_API void | Render () |
Applies the pass. More... | |
C3D_API void | Render2D () |
Applies the pass for 2D render. More... | |
C3D_API void | EndRender () |
Removes the pass (to avoid it from interfering with other passes) More... | |
C3D_API void | AddTextureUnit (TextureUnitSPtr p_unit) |
Adds a texture unit. More... | |
C3D_API TextureUnitSPtr | GetTextureUnit (eTEXTURE_CHANNEL p_channel) |
Retrieves the TextureUnit at wanted channel. More... | |
C3D_API bool | DestroyTextureUnit (uint32_t p_index) |
Destroys a TextureUnit at the given index. More... | |
C3D_API TextureUnitSPtr | GetTextureUnit (uint32_t p_index) const |
Retrieves the TextureUnit at the given index. More... | |
C3D_API Castor::String | GetTexturePath (uint32_t p_index) |
Retrieves the image path of the TextureUnit at the given index. More... | |
C3D_API bool | HasAlphaBlending () const |
Tells if the pass needs alpha blending. More... | |
C3D_API void | Bind () |
Binds the program and the textures. More... | |
C3D_API void | FillShaderVariables (RenderNode &p_node) |
Fills shader variables. More... | |
C3D_API void | PrepareTextures () |
Reduces the textures. More... | |
uint32_t | GetTextureFlags () const |
Retrieves the texture channels flags combination. More... | |
bool | HasAutomaticShader () const |
Tells whether the pass shader is automatically generated or not. More... | |
void | SetDiffuse (Castor::Colour const &p_clrColour) |
Sets the diffuse colour. More... | |
void | SetAmbient (Castor::Colour const &p_clrColour) |
Sets the ambient colour. More... | |
void | SetSpecular (Castor::Colour const &p_clrColour) |
Sets the specular colour. More... | |
void | SetEmissive (Castor::Colour const &p_clrColour) |
Sets the emissive colour. More... | |
void | SetShininess (float p_fShininess) |
Sets the shininess. More... | |
void | SetTwoSided (bool p_bDouble) |
Sets the two sided status. More... | |
void | SetAlpha (float p_fAlpha) |
Sets the global alpha value. More... | |
void | SetAlphaBlendMode (eBLEND_MODE p_value) |
Sets the alpha blend mode. More... | |
void | SetColourBlendMode (eBLEND_MODE p_value) |
Sets the colour blend mode. More... | |
BlendStateSPtr | GetBlendState () const |
Retrieves the blend state. More... | |
float | GetShininess () const |
Retrieves the shniness. More... | |
uint32_t | GetTextureUnitsCount () const |
Retrieves the texture units count. More... | |
bool | IsTwoSided () const |
Tells if the pass is two sided. More... | |
MaterialSPtr | GetParent () const |
Retrieves the parent material. More... | |
float | GetAlpha () const |
Retrieves the global alpha value. More... | |
eBLEND_MODE | GetAlphaBlendMode () const |
Retrieves the alpha blend mode. More... | |
eBLEND_MODE | GetColourBlendMode () const |
Retrieves the colour blend mode. More... | |
Castor::Colour const & | GetDiffuse () const |
Retrieves the diffuse colour. More... | |
Castor::Colour const & | GetAmbient () const |
Retrieves the ambient colour. More... | |
Castor::Colour const & | GetSpecular () const |
Retrieves the specular colour. More... | |
Castor::Colour const & | GetEmissive () const |
Retrieves the emissive colour. More... | |
Castor::Colour & | GetDiffuse () |
Retrieves the diffuse colour. More... | |
Castor::Colour & | GetAmbient () |
Retrieves the ambient colour. More... | |
Castor::Colour & | GetSpecular () |
Retrieves the specular colour. More... | |
Castor::Colour & | GetEmissive () |
Retrieves the emissive colour. More... | |
Protected Types | |
typedef std::pair< TextureUnitWPtr, OneIntFrameVariableWPtr > | UnitVariablePair |
Protected Member Functions | |
DECLARE_MAP (eTEXTURE_CHANNEL, UnitVariablePair, UnitVariableChannel) | |
Protected Attributes | |
Castor::Colour | m_clrDiffuse |
Diffuse material colour. More... | |
Castor::Colour | m_clrAmbient |
Ambient material colour. More... | |
Castor::Colour | m_clrSpecular |
Specular material colour. More... | |
Castor::Colour | m_clrEmissive |
Emissive material colour. More... | |
float | m_fShininess |
The shininess value. More... | |
float | m_fAlpha |
The alpha value. More... | |
bool | m_bDoubleFace |
Tells if the pass is two sided. More... | |
TextureUnitPtrArray | m_arrayTextureUnits |
Texture units. More... | |
MaterialWPtr | m_parent |
The parent material. More... | |
UnitVariableChannelMap | m_mapUnits |
The current shader variables and associated texture units, ordered by channel. More... | |
BlendStateSPtr | m_pBlendState |
Blend states. More... | |
uint32_t | m_textureFlags |
Bitwise ORed eTEXTURE_CHANNEL. More... | |
bool | m_bAutomaticShader |
Tells the pass shader is an automatically generated one. More... | |
eBLEND_MODE | m_alphaBlendMode |
The alpha blend mode. More... | |
eBLEND_MODE | m_colourBlendMode |
The colour blend mode. More... | |
bool | m_texturesReduced |
Tells if the pass' textures are reduced. More... | |
Friends | |
class | Material |
Definition of a material pass.
|
protected |
C3D_API Castor3D::Pass::Pass | ( | Engine & | p_engine, |
MaterialSPtr | p_parent = nullptr |
||
) |
Constructor.
[in] | p_engine | The core engine |
[in] | p_parent | The parent material |
C3D_API Castor3D::Pass::~Pass | ( | ) |
Destructor.
C3D_API void Castor3D::Pass::AddTextureUnit | ( | TextureUnitSPtr | p_unit | ) |
Adds a texture unit.
[in] | p_unit | The texture unit. |
C3D_API void Castor3D::Pass::Bind | ( | ) |
Binds the program and the textures.
C3D_API void Castor3D::Pass::BindToNode | ( | RenderNode & | p_node | ) |
Binds this pass to given render node.
[in] | p_node | The render node. |
C3D_API void Castor3D::Pass::BindToNode | ( | SceneRenderNode & | p_node | ) |
Binds this pass to given render node.
[in] | p_node | The render node. |
C3D_API void Castor3D::Pass::Cleanup | ( | ) |
Cleans up the pass and all it's dependencies.
|
protected |
C3D_API bool Castor3D::Pass::DestroyTextureUnit | ( | uint32_t | p_index | ) |
Destroys a TextureUnit at the given index.
[in] | p_index | the index of the TextureUnit to destroy |
false
if the index was out of bounds C3D_API void Castor3D::Pass::EndRender | ( | ) |
Removes the pass (to avoid it from interfering with other passes)
C3D_API void Castor3D::Pass::FillShaderVariables | ( | RenderNode & | p_node | ) |
Fills shader variables.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
C3D_API Castor::String Castor3D::Pass::GetTexturePath | ( | uint32_t | p_index | ) |
Retrieves the image path of the TextureUnit at the given index.
[in] | p_index | The index of the TextureUnit we want the image path |
C3D_API TextureUnitSPtr Castor3D::Pass::GetTextureUnit | ( | eTEXTURE_CHANNEL | p_channel | ) |
Retrieves the TextureUnit at wanted channel.
[in] | p_channel | The channel |
nullptr
if no TextureUnit at wanted channel C3D_API TextureUnitSPtr Castor3D::Pass::GetTextureUnit | ( | uint32_t | p_index | ) | const |
Retrieves the TextureUnit at the given index.
[in] | p_index | The index of the TextureUnit to retrieve |
|
inline |
C3D_API bool Castor3D::Pass::HasAlphaBlending | ( | ) | const |
Tells if the pass needs alpha blending.
true
if at least one texture unit has an alpha channel
|
inline |
Tells whether the pass shader is automatically generated or not.
References m_bAutomaticShader.
C3D_API void Castor3D::Pass::Initialise | ( | ) |
Initialises the pass and all it's dependencies.
|
inline |
Tells if the pass is two sided.
References m_bDoubleFace.
C3D_API void Castor3D::Pass::PrepareTextures | ( | ) |
Reduces the textures.
C3D_API void Castor3D::Pass::Render | ( | ) |
Applies the pass.
C3D_API void Castor3D::Pass::Render2D | ( | ) |
Applies the pass for 2D render.
|
inline |
Sets the global alpha value.
[in] | p_fAlpha | The new value |
References m_clrAmbient, m_clrDiffuse, m_clrEmissive, m_clrSpecular, and m_fAlpha.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
|
protected |
The alpha blend mode.
Referenced by GetAlphaBlendMode(), and SetAlphaBlendMode().
|
protected |
Texture units.
Referenced by GetTextureUnitsCount().
|
protected |
Tells the pass shader is an automatically generated one.
Referenced by HasAutomaticShader().
|
protected |
Tells if the pass is two sided.
Referenced by IsTwoSided(), and SetTwoSided().
|
protected |
Ambient material colour.
Referenced by GetAmbient(), SetAlpha(), and SetAmbient().
|
protected |
Diffuse material colour.
Referenced by GetDiffuse(), SetAlpha(), and SetDiffuse().
|
protected |
Emissive material colour.
Referenced by GetEmissive(), SetAlpha(), and SetEmissive().
|
protected |
Specular material colour.
Referenced by GetSpecular(), SetAlpha(), and SetSpecular().
|
protected |
The colour blend mode.
Referenced by GetColourBlendMode(), and SetColourBlendMode().
|
protected |
The alpha value.
Referenced by GetAlpha(), and SetAlpha().
|
protected |
The shininess value.
Referenced by GetShininess(), and SetShininess().
|
protected |
The current shader variables and associated texture units, ordered by channel.
|
protected |
The parent material.
Referenced by GetParent().
|
protected |
Blend states.
Referenced by GetBlendState().
|
protected |
Bitwise ORed eTEXTURE_CHANNEL.
Referenced by GetTextureFlags().
|
protected |
Tells if the pass' textures are reduced.