Rebel Fork Framework
Urho3D::Pass Class Reference

Material rendering pass, which defines shaders and render state. More...

#include <Urho3D/Graphics/Technique.h>

Inheritance diagram for Urho3D::Pass:
Urho3D::RefCounted Urho3D::PipelineStateTracker

Public Member Functions

 Pass (const ea::string &name)
 Construct.
 
 ~Pass () override
 Destruct.
 
void SetBlendMode (BlendMode mode)
 
void SetCullMode (CullMode mode)
 
void SetDepthTestMode (CompareMode mode)
 
void SetDepthWrite (bool enable)
 
void SetColorWrite (bool enable)
 
void SetAlphaToCoverage (bool enable)
 
void SetVertexShader (const ea::string &name)
 
void SetPixelShader (const ea::string &name)
 
void SetVertexShaderDefines (const ea::string &defines)
 
void SetPixelShaderDefines (const ea::string &defines)
 
void SetVertexShaderDefineExcludes (const ea::string &excludes)
 
void SetPixelShaderDefineExcludes (const ea::string &excludes)
 
void SetVertexTextureDefines (const StringVector &textures)
 
void SetPixelTextureDefines (const StringVector &textures)
 
void ReleaseShaders ()
 Reset shader pointers.
 
void MarkShadersLoaded (unsigned frameNumber)
 Mark shaders loaded this frame.
 
const ea::string & GetName () const
 Return pass name.
 
unsigned GetIndex () const
 Return pass index. This is used for optimal render-time pass queries that avoid map lookups.
 
BlendMode GetBlendMode () const
 
CullMode GetCullMode () const
 
CompareMode GetDepthTestMode () const
 
unsigned GetShadersLoadedFrameNumber () const
 Return last shaders loaded frame number.
 
bool GetColorWrite () const
 
bool GetDepthWrite () const
 
bool GetAlphaToCoverage () const
 
bool IsAlphaMask () const
 Return whether the pass uses cutout transparency via ALPHAMASK.
 
const ea::string & GetVertexShader () const
 
const ea::string & GetPixelShader () const
 
const ea::string & GetVertexShaderDefines () const
 
const ea::string & GetPixelShaderDefines () const
 
const ea::string & GetVertexShaderDefineExcludes () const
 
const ea::string & GetPixelShaderDefineExcludes () const
 
ea::vector< SharedPtr< ShaderVariation > > & GetVertexShaders ()
 Return vertex shaders.
 
ea::vector< SharedPtr< ShaderVariation > > & GetPixelShaders ()
 Return pixel shaders.
 
const StringVectorGetVertexTextureDefines () const
 Return names of textures to be reported as defines in vertex shader code.
 
const StringVectorGetPixelTextureDefines () const
 Return names of textures to be reported as defines in pixel shader code.
 
ea::vector< SharedPtr< ShaderVariation > > & GetVertexShaders (const StringHash &extraDefinesHash)
 Return vertex shaders with extra defines from the renderpath.
 
ea::vector< SharedPtr< ShaderVariation > > & GetPixelShaders (const StringHash &extraDefinesHash)
 Return pixel shaders with extra defines from the renderpath.
 
ea::string GetEffectiveVertexShaderDefines () const
 Return the effective vertex shader defines, accounting for excludes. Called internally by Renderer.
 
ea::string GetEffectivePixelShaderDefines () const
 Return the effective pixel shader defines, accounting for excludes. Called internally by Renderer.
 
- Public Member Functions inherited from Urho3D::RefCounted
 RefCounted ()
 Construct. Allocate the reference count structure and set an initial self weak reference.
 
virtual ~RefCounted ()
 Destruct. Mark as expired and also delete the reference count structure if no outside weak references exist.
 
 RefCounted (const RefCounted &rhs)=delete
 Prevent copy construction.
 
RefCountedoperator= (const RefCounted &rhs)=delete
 Prevent assignment.
 
int AddRef ()
 
int ReleaseRef ()
 
int Refs () const
 
int WeakRefs () const
 
RefCountRefCountPtr () const
 Return pointer to the reference count structure.
 
bool HasScriptObject () const
 Return true if script runtime object wrapping this native object exists.
 
bool IsScriptStrongRef () const
 Return true if script reference is strong.
 
- Public Member Functions inherited from Urho3D::PipelineStateTracker
virtual ~PipelineStateTracker ()
 Destruct.
 
unsigned GetPipelineStateHash () const
 Return (partial) pipeline state hash. Save to call from multiple threads as long as the object is not changing.
 
void MarkPipelineStateHashDirty ()
 Mark pipeline state hash as dirty.
 

Private Member Functions

unsigned RecalculatePipelineStateHash () const override
 Recalculate hash of pipeline state configuration.
 

Private Attributes

unsigned index_
 Pass index.
 
BlendMode blendMode_
 Blend mode.
 
CullMode cullMode_
 Culling mode.
 
CompareMode depthTestMode_
 Depth compare mode.
 
unsigned shadersLoadedFrameNumber_
 Last shaders loaded frame number.
 
bool colorWrite_
 Color write mode.
 
bool depthWrite_
 Depth write mode.
 
bool alphaToCoverage_
 Alpha-to-coverage mode.
 
bool isAlphaMask_ {}
 Whether the pass uses cutout transparency via ALPHAMASK.
 
ea::string vertexShaderName_
 Vertex shader name.
 
ea::string pixelShaderName_
 Pixel shader name.
 
ea::string vertexShaderDefines_
 Vertex shader defines.
 
ea::string pixelShaderDefines_
 Pixel shader defines.
 
ea::string vertexShaderDefineExcludes_
 Vertex shader define excludes.
 
ea::string pixelShaderDefineExcludes_
 Pixel shader define excludes.
 
ea::vector< SharedPtr< ShaderVariation > > vertexShaders_
 Vertex shaders.
 
ea::vector< SharedPtr< ShaderVariation > > pixelShaders_
 Pixel shaders.
 
ea::unordered_map< StringHash, ea::vector< SharedPtr< ShaderVariation > > > extraVertexShaders_
 Vertex shaders with extra defines from the renderpath.
 
ea::unordered_map< StringHash, ea::vector< SharedPtr< ShaderVariation > > > extraPixelShaders_
 Pixel shaders with extra defines from the renderpath.
 
StringVector vertexTextureDefines_
 
StringVector pixelTextureDefines_
 
ea::string name_
 Pass name.
 

Additional Inherited Members

- Protected Member Functions inherited from Urho3D::PipelineStateTracker
PipelineStateSubscription CreateDependency (PipelineStateTracker *dependency)
 Create dependency onto another pipeline state.
 
void AddSubscriberReference (PipelineStateTracker *subscriber)
 Add reference to subscriber pipeline state tracker.
 
void RemoveSubscriberReference (PipelineStateTracker *subscriber)
 Remove reference to subscriber pipeline state tracker.
 

Detailed Description

Material rendering pass, which defines shaders and render state.

Member Function Documentation

◆ GetAlphaToCoverage()

bool Urho3D::Pass::GetAlphaToCoverage ( ) const
inline

Return alpha-to-coverage mode.

◆ GetBlendMode()

BlendMode Urho3D::Pass::GetBlendMode ( ) const
inline

Return blend mode.

◆ GetColorWrite()

bool Urho3D::Pass::GetColorWrite ( ) const
inline

Return color write mode.

◆ GetCullMode()

CullMode Urho3D::Pass::GetCullMode ( ) const
inline

Return culling mode override. If pass is not overriding culling mode (default), the illegal mode MAX_CULLMODES is returned.

◆ GetDepthTestMode()

CompareMode Urho3D::Pass::GetDepthTestMode ( ) const
inline

Return depth compare mode.

◆ GetDepthWrite()

bool Urho3D::Pass::GetDepthWrite ( ) const
inline

Return depth write mode.

◆ GetPixelShader()

const ea::string& Urho3D::Pass::GetPixelShader ( ) const
inline

Return pixel shader name.

◆ GetPixelShaderDefineExcludes()

const ea::string& Urho3D::Pass::GetPixelShaderDefineExcludes ( ) const
inline

Return pixel shader define excludes.

◆ GetPixelShaderDefines()

const ea::string& Urho3D::Pass::GetPixelShaderDefines ( ) const
inline

Return pixel shader defines.

◆ GetVertexShader()

const ea::string& Urho3D::Pass::GetVertexShader ( ) const
inline

Return vertex shader name.

◆ GetVertexShaderDefineExcludes()

const ea::string& Urho3D::Pass::GetVertexShaderDefineExcludes ( ) const
inline

Return vertex shader define excludes.

◆ GetVertexShaderDefines()

const ea::string& Urho3D::Pass::GetVertexShaderDefines ( ) const
inline

Return vertex shader defines.

◆ SetAlphaToCoverage()

void Urho3D::Pass::SetAlphaToCoverage ( bool  enable)

Set alpha-to-coverage on/off.

◆ SetBlendMode()

void Urho3D::Pass::SetBlendMode ( BlendMode  mode)

Set blend mode.

◆ SetColorWrite()

void Urho3D::Pass::SetColorWrite ( bool  enable)

Set color write on/off.

◆ SetCullMode()

void Urho3D::Pass::SetCullMode ( CullMode  mode)

Set culling mode override. By default culling mode is read from the material instead. Set the illegal culling mode MAX_CULLMODES to disable override again.

◆ SetDepthTestMode()

void Urho3D::Pass::SetDepthTestMode ( CompareMode  mode)

Set depth compare mode.

◆ SetDepthWrite()

void Urho3D::Pass::SetDepthWrite ( bool  enable)

Set depth write on/off.

◆ SetPixelShader()

void Urho3D::Pass::SetPixelShader ( const ea::string &  name)

Set pixel shader name.

◆ SetPixelShaderDefineExcludes()

void Urho3D::Pass::SetPixelShaderDefineExcludes ( const ea::string &  excludes)

Set pixel shader define excludes. Use to mark defines that the shader code will not recognize, to prevent compiling redundant shader variations.

◆ SetPixelShaderDefines()

void Urho3D::Pass::SetPixelShaderDefines ( const ea::string &  defines)

Set pixel shader defines. Separate multiple defines with spaces.

◆ SetVertexShader()

void Urho3D::Pass::SetVertexShader ( const ea::string &  name)

Set vertex shader name.

◆ SetVertexShaderDefineExcludes()

void Urho3D::Pass::SetVertexShaderDefineExcludes ( const ea::string &  excludes)

Set vertex shader define excludes. Use to mark defines that the shader code will not recognize, to prevent compiling redundant shader variations.

◆ SetVertexShaderDefines()

void Urho3D::Pass::SetVertexShaderDefines ( const ea::string &  defines)

Set vertex shader defines. Separate multiple defines with spaces.


The documentation for this class was generated from the following files: