Castor3D 0.12.0
Multiplatform 3D engine
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
castor3d::Pass Class Referenceabstract

#include <Pass.hpp>

Inheritance diagram for castor3d::Pass:
Inheritance graph
[legend]
Collaboration diagram for castor3d::Pass:
Collaboration graph
[legend]

Public Member Functions

C3D_API void initialise (RenderDevice const &device, QueueData const &queueData)
 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 update ()
 Updates the render pass, CPU wise. More...
 
C3D_API void registerTexture (TextureSourceInfo sourceInfo, PassTextureConfig configuration)
 Adds a texture. More...
 
C3D_API void registerTexture (TextureSourceInfo sourceInfo, PassTextureConfig configuration, AnimationUPtr animation)
 Adds an animated texture. More...
 
C3D_API void unregisterTexture (TextureSourceInfo sourceInfo)
 Removes a texture unit. More...
 
C3D_API void resetTexture (TextureSourceInfo const &srcSourceInfo, TextureSourceInfo dstSourceInfo)
 Replaces a texture source. More...
 
C3D_API void updateConfig (TextureSourceInfo const &sourceInfo, TextureConfiguration configuration)
 Updates the configuration for a texture. More...
 
C3D_API TextureUnitSPtr getTextureUnit (uint32_t index) const
 Retrieves the TextureUnit at the given index. More...
 
C3D_API void prepareTextures ()
 Reduces the textures. More...
 
virtual C3D_API void setColour (castor::RgbColour const &value)=0
 Sets the basic pass colour. More...
 
virtual C3D_API castor::RgbColour const & getColour () const =0
 
C3D_API void setOpacity (float value)
 Sets the global alpha value. More...
 
C3D_API PassFlags getPassFlags () const
 
C3D_API void setSubsurfaceScattering (SubsurfaceScatteringUPtr value)
 Sets the subsurface scattering extended informations. More...
 
virtual C3D_API void accept (PassVisitorBase &vis)
 PassVisitor acceptance function. More...
 
virtual C3D_API void fillBuffer (PassBuffer &buffer) const =0
 Fills the pass buffer with this pass data. More...
 
C3D_API void fillSssProfileBuffer (SssProfileBuffer &buffer) const
 Fills the pass buffer with this pass data. More...
 
virtual C3D_API void fillConfig (TextureConfiguration &config, PassVisitorBase &vis)
 PassVisitor acceptance function, for a specific texture configuration. More...
 
virtual C3D_API uint32_t getPassSectionID () const =0
 
virtual C3D_API uint32_t getTextureSectionID () const =0
 
virtual C3D_API bool writeText (castor::String const &tabs, castor::Path const &folder, castor::String const &subfolder, castor::StringStream &file) const =0
 
C3D_API bool needsAlphaProcessing () const
 
C3D_API bool hasAlphaBlending () const
 
C3D_API bool hasOnlyAlphaBlending () const
 
C3D_API bool hasAlphaTest () const
 
C3D_API bool hasBlendAlphaTest () const
 
C3D_API TextureUnitPtrArray getTextureUnits (TextureFlags mask=TextureFlag::eAll) const
 
C3D_API uint32_t getTextureUnitsCount (TextureFlags mask=TextureFlag::eAll) const
 
C3D_API TextureFlagsArray getTexturesMask (TextureFlags mask=TextureFlag::eAll) const
 
TextureSourceMapgetSources ()
 
TextureFlags const & getTextures () const
 
bool hasAutomaticShader () const
 
bool isTwoSided () const
 
bool hasEnvironmentMapping () const
 
float getOpacity () const
 
uint32_t getBWAccumulationOperator () const
 
float getEmissive () const
 
float getRefractionRatio () const
 
BlendMode getAlphaBlendMode () const
 
BlendMode getColourBlendMode () const
 
uint32_t getId () const
 
uint32_t getSssProfileId () const
 
VkCompareOp getAlphaFunc () const
 
float getAlphaValue () const
 
VkCompareOp getBlendAlphaFunc () const
 
castor::Point3f getTransmission () const
 
bool hasSubsurfaceScattering () const
 
ParallaxOcclusionMode getParallaxOcclusion () const
 
bool hasParallaxOcclusion () const
 
SubsurfaceScattering const & getSubsurfaceScattering () const
 
bool isImplicit () const
 
bool hasReflections () const
 
bool hasRefraction () const
 
bool hasEdges () const
 
uint32_t getHeightTextureIndex () const
 
bool hasLighting () const
 
bool hasIBL () const
 
PassTypeID getTypeID () const
 
float getEdgeWidth () const
 
float getDepthFactor () const
 
float getNormalFactor () const
 
float getObjectFactor () const
 
castor::RgbaColour getEdgeColour () const
 
RenderPassRegisterInfogetRenderPassInfo () const
 
uint32_t getIndex () const
 
auto begin () const
 
auto begin ()
 
auto end () const
 
auto end ()
 
void setTwoSided (bool value)
 
void setEmissive (float const &value)
 
void setRefractionRatio (float value)
 
void setTransmission (castor::Point3f value)
 
void setParallaxOcclusion (ParallaxOcclusionMode value)
 
void setAlphaBlendMode (BlendMode value)
 
void setColourBlendMode (BlendMode value)
 
void setId (uint32_t value)
 
void setSssProfileId (uint32_t value)
 
void setAlphaFunc (VkCompareOp value)
 
void setAlphaValue (float value)
 
void setBlendAlphaFunc (VkCompareOp value)
 
void setBWAccumulationOperator (uint32_t value)
 
void enableReflections (bool value=true)
 
void enableRefractions (bool value=true)
 
void setImplicit (bool value=true)
 
void enableLighting (bool value)
 
void enablePicking (bool value)
 
void enableEdges (bool value)
 
void setEdgeWidth (float value)
 
void setDepthFactor (float value)
 
void setNormalFactor (float value)
 
void setObjectFactor (float value)
 
void setEdgeColour (castor::RgbaColour const &value)
 

Static Public Member Functions

static C3D_API void addParser (castor::AttributeParsers &parsers, uint32_t section, castor::String const &name, castor::ParserFunction function, castor::ParserParameterArray &&array=castor::ParserParameterArray{})
 

Public Attributes

OnPassChanged onChanged
 
OnPassChanged onSssProfileChanged
 

Static Public Attributes

static float constexpr MinEdgeWidth = 0.001f
 
static float constexpr MaxEdgeWidth = 1000.0f
 

Protected Member Functions

C3D_API Pass (Material &parent, PassTypeID typeID, PassFlags initialFlags)
 Constructor. More...
 
virtual C3D_API ~Pass ()
 Destructor. More...
 
C3D_API void doMergeImages (TextureFlag lhsFlag, uint32_t lhsMaskOffset, uint32_t lhsDstMask, TextureFlag rhsFlag, uint32_t rhsMaskOffset, uint32_t rhsDstMask, castor::String const &name, TextureUnitPtrArray &result)
 
C3D_API void doJoinDifOpa (TextureUnitPtrArray &result, castor::String const &name)
 
C3D_API void doFillData (PassBuffer::PassDataPtr &data) const
 
virtual C3D_API void doAccept (TextureConfiguration &config, PassVisitorBase &vis)=0
 
virtual C3D_API void doAccept (PassVisitorBase &vis)=0
 

Static Protected Member Functions

static C3D_API void parseError (castor::String const &error)
 
static C3D_API void addCommonParsers (uint32_t mtlSectionID, uint32_t texSectionID, uint32_t remapChannelSectionID, castor::AttributeParsers &result)
 

Protected Attributes

bool m_dirty { true }
 
bool m_sssDirty { true }
 

Constructor & Destructor Documentation

◆ Pass()

C3D_API castor3d::Pass::Pass ( Material parent,
PassTypeID  typeID,
PassFlags  initialFlags 
)
explicitprotected

Constructor.

Parameters
[in]parentThe parent material.
[in]typeIDThe pass type ID.
[in]initialFlagsThe flags inherited from pass type.

◆ ~Pass()

virtual C3D_API castor3d::Pass::~Pass ( )
protectedvirtual

Destructor.

Member Function Documentation

◆ accept()

virtual C3D_API void castor3d::Pass::accept ( PassVisitorBase vis)
virtual

PassVisitor acceptance function.

Parameters
visThe ... visitor.

◆ addCommonParsers()

static C3D_API void castor3d::Pass::addCommonParsers ( uint32_t  mtlSectionID,
uint32_t  texSectionID,
uint32_t  remapChannelSectionID,
castor::AttributeParsers &  result 
)
staticprotected

◆ addParser()

static C3D_API void castor3d::Pass::addParser ( castor::AttributeParsers &  parsers,
uint32_t  section,
castor::String const &  name,
castor::ParserFunction  function,
castor::ParserParameterArray &&  array = castor::ParserParameterArray{} 
)
static

◆ begin() [1/2]

auto castor3d::Pass::begin ( )
inline

◆ begin() [2/2]

auto castor3d::Pass::begin ( ) const
inline

name Textures iteration.

◆ cleanup()

C3D_API void castor3d::Pass::cleanup ( )

Cleans up the pass and all it's dependencies.

◆ doAccept() [1/2]

virtual C3D_API void castor3d::Pass::doAccept ( PassVisitorBase vis)
protectedpure virtual

◆ doAccept() [2/2]

virtual C3D_API void castor3d::Pass::doAccept ( TextureConfiguration config,
PassVisitorBase vis 
)
protectedpure virtual

◆ doFillData()

C3D_API void castor3d::Pass::doFillData ( PassBuffer::PassDataPtr data) const
protected

◆ doJoinDifOpa()

C3D_API void castor3d::Pass::doJoinDifOpa ( TextureUnitPtrArray &  result,
castor::String const &  name 
)
protected

◆ doMergeImages()

C3D_API void castor3d::Pass::doMergeImages ( TextureFlag  lhsFlag,
uint32_t  lhsMaskOffset,
uint32_t  lhsDstMask,
TextureFlag  rhsFlag,
uint32_t  rhsMaskOffset,
uint32_t  rhsDstMask,
castor::String const &  name,
TextureUnitPtrArray &  result 
)
protected

◆ enableEdges()

void castor3d::Pass::enableEdges ( bool  value)
inline

References castor3d::eDrawEdge.

◆ enableLighting()

void castor3d::Pass::enableLighting ( bool  value)
inline

References castor3d::eLighting.

◆ enablePicking()

void castor3d::Pass::enablePicking ( bool  value)
inline

References castor3d::ePickable.

◆ enableReflections()

void castor3d::Pass::enableReflections ( bool  value = true)
inline

References castor3d::eReflection.

◆ enableRefractions()

void castor3d::Pass::enableRefractions ( bool  value = true)
inline

References castor3d::eRefraction.

◆ end() [1/2]

auto castor3d::Pass::end ( )
inline

◆ end() [2/2]

auto castor3d::Pass::end ( ) const
inline

◆ fillBuffer()

virtual C3D_API void castor3d::Pass::fillBuffer ( PassBuffer buffer) const
pure virtual

Fills the pass buffer with this pass data.

Parameters
[in,out]bufferThe pass buffer.

Implemented in castor3d::MetallicRoughnessPbrPass, castor3d::SpecularGlossinessPbrPass, and castor3d::PhongPass.

◆ fillConfig()

virtual C3D_API void castor3d::Pass::fillConfig ( TextureConfiguration config,
PassVisitorBase vis 
)
virtual

PassVisitor acceptance function, for a specific texture configuration.

Parameters
configThe texture configuration.
visThe ... visitor.

◆ fillSssProfileBuffer()

C3D_API void castor3d::Pass::fillSssProfileBuffer ( SssProfileBuffer buffer) const

Fills the pass buffer with this pass data.

Parameters
[in,out]bufferThe pass buffer.

◆ getAlphaBlendMode()

BlendMode castor3d::Pass::getAlphaBlendMode ( ) const
inline

◆ getAlphaFunc()

VkCompareOp castor3d::Pass::getAlphaFunc ( ) const
inline

◆ getAlphaValue()

float castor3d::Pass::getAlphaValue ( ) const
inline

◆ getBlendAlphaFunc()

VkCompareOp castor3d::Pass::getBlendAlphaFunc ( ) const
inline

◆ getBWAccumulationOperator()

uint32_t castor3d::Pass::getBWAccumulationOperator ( ) const
inline

◆ getColour()

virtual C3D_API castor::RgbColour const & castor3d::Pass::getColour ( ) const
pure virtual

◆ getColourBlendMode()

BlendMode castor3d::Pass::getColourBlendMode ( ) const
inline

◆ getDepthFactor()

float castor3d::Pass::getDepthFactor ( ) const
inline

◆ getEdgeColour()

castor::RgbaColour castor3d::Pass::getEdgeColour ( ) const
inline

◆ getEdgeWidth()

float castor3d::Pass::getEdgeWidth ( ) const
inline

◆ getEmissive()

float castor3d::Pass::getEmissive ( ) const
inline

◆ getHeightTextureIndex()

uint32_t castor3d::Pass::getHeightTextureIndex ( ) const
inline

◆ getId()

uint32_t castor3d::Pass::getId ( ) const
inline

◆ getIndex()

uint32_t castor3d::Pass::getIndex ( ) const
inline

◆ getNormalFactor()

float castor3d::Pass::getNormalFactor ( ) const
inline

◆ getObjectFactor()

float castor3d::Pass::getObjectFactor ( ) const
inline

◆ getOpacity()

float castor3d::Pass::getOpacity ( ) const
inline

◆ getParallaxOcclusion()

ParallaxOcclusionMode castor3d::Pass::getParallaxOcclusion ( ) const
inline

◆ getPassFlags()

C3D_API PassFlags castor3d::Pass::getPassFlags ( ) const
Returns
The pass flags combination.

◆ getPassSectionID()

virtual C3D_API uint32_t castor3d::Pass::getPassSectionID ( ) const
pure virtual
Returns
The scene file section ID used for the pass effective type.

Implemented in castor3d::MetallicRoughnessPbrPass, castor3d::SpecularGlossinessPbrPass, castor3d::BlinnPhongPass, and castor3d::PhongPass.

◆ getRefractionRatio()

float castor3d::Pass::getRefractionRatio ( ) const
inline

◆ getRenderPassInfo()

RenderPassRegisterInfo * castor3d::Pass::getRenderPassInfo ( ) const
inline

◆ getSources()

TextureSourceMap & castor3d::Pass::getSources ( )
inline

◆ getSssProfileId()

uint32_t castor3d::Pass::getSssProfileId ( ) const
inline

◆ getSubsurfaceScattering()

SubsurfaceScattering const & castor3d::Pass::getSubsurfaceScattering ( ) const
inline

◆ getTextures()

TextureFlags const & castor3d::Pass::getTextures ( ) const
inline

◆ getTextureSectionID()

virtual C3D_API uint32_t castor3d::Pass::getTextureSectionID ( ) const
pure virtual
Returns
The scene file section ID used for the pass' textures effective type.

Implemented in castor3d::MetallicRoughnessPbrPass, castor3d::SpecularGlossinessPbrPass, castor3d::BlinnPhongPass, and castor3d::PhongPass.

◆ getTexturesMask()

C3D_API TextureFlagsArray castor3d::Pass::getTexturesMask ( TextureFlags  mask = TextureFlag::eAll) const

◆ getTextureUnit()

C3D_API TextureUnitSPtr castor3d::Pass::getTextureUnit ( uint32_t  index) const

Retrieves the TextureUnit at the given index.

Parameters
[in]indexThe index of the TextureUnit to retrieve.
Returns
nullptr if index was out of bounds.

◆ getTextureUnits()

C3D_API TextureUnitPtrArray castor3d::Pass::getTextureUnits ( TextureFlags  mask = TextureFlag::eAll) const

◆ getTextureUnitsCount()

C3D_API uint32_t castor3d::Pass::getTextureUnitsCount ( TextureFlags  mask = TextureFlag::eAll) const

◆ getTransmission()

castor::Point3f castor3d::Pass::getTransmission ( ) const
inline

◆ getTypeID()

PassTypeID castor3d::Pass::getTypeID ( ) const
inline

◆ hasAlphaBlending()

C3D_API bool castor3d::Pass::hasAlphaBlending ( ) const

Referenced by setAlphaBlendMode().

Here is the caller graph for this function:

◆ hasAlphaTest()

C3D_API bool castor3d::Pass::hasAlphaTest ( ) const

Referenced by setAlphaFunc().

Here is the caller graph for this function:

◆ hasAutomaticShader()

bool castor3d::Pass::hasAutomaticShader ( ) const
inline

◆ hasBlendAlphaTest()

C3D_API bool castor3d::Pass::hasBlendAlphaTest ( ) const

Referenced by setBlendAlphaFunc().

Here is the caller graph for this function:

◆ hasEdges()

bool castor3d::Pass::hasEdges ( ) const
inline

References castor3d::eDrawEdge.

◆ hasEnvironmentMapping()

bool castor3d::Pass::hasEnvironmentMapping ( ) const
inline

◆ hasIBL()

bool castor3d::Pass::hasIBL ( ) const
inline

◆ hasLighting()

bool castor3d::Pass::hasLighting ( ) const
inline

References castor3d::eLighting.

◆ hasOnlyAlphaBlending()

C3D_API bool castor3d::Pass::hasOnlyAlphaBlending ( ) const

◆ hasParallaxOcclusion()

bool castor3d::Pass::hasParallaxOcclusion ( ) const
inline

References castor3d::eNone.

◆ hasReflections()

bool castor3d::Pass::hasReflections ( ) const
inline

References castor3d::eReflection.

◆ hasRefraction()

bool castor3d::Pass::hasRefraction ( ) const
inline

References castor3d::eRefraction.

◆ hasSubsurfaceScattering()

bool castor3d::Pass::hasSubsurfaceScattering ( ) const
inline

◆ initialise()

C3D_API void castor3d::Pass::initialise ( RenderDevice const &  device,
QueueData const &  queueData 
)

Initialises the pass and all it's dependencies.

Parameters
[in]deviceThe GPU device.
[in]queueDataReceives the GPU commands.

◆ isImplicit()

bool castor3d::Pass::isImplicit ( ) const
inline

◆ isTwoSided()

bool castor3d::Pass::isTwoSided ( ) const
inline

◆ needsAlphaProcessing()

C3D_API bool castor3d::Pass::needsAlphaProcessing ( ) const

name Getters.

◆ parseError()

static C3D_API void castor3d::Pass::parseError ( castor::String const &  error)
staticprotected

◆ prepareTextures()

C3D_API void castor3d::Pass::prepareTextures ( )

Reduces the textures.

◆ registerTexture() [1/2]

C3D_API void castor3d::Pass::registerTexture ( TextureSourceInfo  sourceInfo,
PassTextureConfig  configuration 
)

Adds a texture.

Parameters
[in]sourceInfoThe texture source.
[in]configurationThe texture configuration.

◆ registerTexture() [2/2]

C3D_API void castor3d::Pass::registerTexture ( TextureSourceInfo  sourceInfo,
PassTextureConfig  configuration,
AnimationUPtr  animation 
)

Adds an animated texture.

Parameters
[in]sourceInfoThe texture source.
[in]configurationThe texture configuration.
[in]animationThe texture animation.

◆ resetTexture()

C3D_API void castor3d::Pass::resetTexture ( TextureSourceInfo const &  srcSourceInfo,
TextureSourceInfo  dstSourceInfo 
)

Replaces a texture source.

Parameters
[in]srcSourceInfoThe original texture source.
[in]dstSourceInfoThe replacement texture source.

◆ setAlphaBlendMode()

void castor3d::Pass::setAlphaBlendMode ( BlendMode  value)
inline

References castor3d::eAlphaBlending, and hasAlphaBlending().

Here is the call graph for this function:

◆ setAlphaFunc()

void castor3d::Pass::setAlphaFunc ( VkCompareOp  value)
inline

References castor3d::eAlphaTest, and hasAlphaTest().

Here is the call graph for this function:

◆ setAlphaValue()

void castor3d::Pass::setAlphaValue ( float  value)
inline

◆ setBlendAlphaFunc()

void castor3d::Pass::setBlendAlphaFunc ( VkCompareOp  value)
inline

References castor3d::eBlendAlphaTest, and hasBlendAlphaTest().

Here is the call graph for this function:

◆ setBWAccumulationOperator()

void castor3d::Pass::setBWAccumulationOperator ( uint32_t  value)
inline

◆ setColour()

virtual C3D_API void castor3d::Pass::setColour ( castor::RgbColour const &  value)
pure virtual

Sets the basic pass colour.

Parameters
[in]valueThe new value.

Implemented in castor3d::MetallicRoughnessPbrPass, castor3d::SpecularGlossinessPbrPass, and castor3d::PhongPass.

◆ setColourBlendMode()

void castor3d::Pass::setColourBlendMode ( BlendMode  value)
inline

◆ setDepthFactor()

void castor3d::Pass::setDepthFactor ( float  value)
inline

◆ setEdgeColour()

void castor3d::Pass::setEdgeColour ( castor::RgbaColour const &  value)
inline

◆ setEdgeWidth()

void castor3d::Pass::setEdgeWidth ( float  value)
inline

◆ setEmissive()

void castor3d::Pass::setEmissive ( float const &  value)
inline

◆ setId()

void castor3d::Pass::setId ( uint32_t  value)
inline

◆ setImplicit()

void castor3d::Pass::setImplicit ( bool  value = true)
inline

◆ setNormalFactor()

void castor3d::Pass::setNormalFactor ( float  value)
inline

◆ setObjectFactor()

void castor3d::Pass::setObjectFactor ( float  value)
inline

◆ setOpacity()

C3D_API void castor3d::Pass::setOpacity ( float  value)

Sets the global alpha value.

Parameters
[in]valueThe new value.

◆ setParallaxOcclusion()

void castor3d::Pass::setParallaxOcclusion ( ParallaxOcclusionMode  value)
inline

◆ setRefractionRatio()

void castor3d::Pass::setRefractionRatio ( float  value)
inline

◆ setSssProfileId()

void castor3d::Pass::setSssProfileId ( uint32_t  value)
inline

◆ setSubsurfaceScattering()

C3D_API void castor3d::Pass::setSubsurfaceScattering ( SubsurfaceScatteringUPtr  value)

Sets the subsurface scattering extended informations.

Parameters
[in]valueThe new value.

◆ setTransmission()

void castor3d::Pass::setTransmission ( castor::Point3f  value)
inline

◆ setTwoSided()

void castor3d::Pass::setTwoSided ( bool  value)
inline

name Mutators.

◆ unregisterTexture()

C3D_API void castor3d::Pass::unregisterTexture ( TextureSourceInfo  sourceInfo)

Removes a texture unit.

Parameters
[in]sourceInfoThe texture source.

◆ update()

C3D_API void castor3d::Pass::update ( )

Updates the render pass, CPU wise.

◆ updateConfig()

C3D_API void castor3d::Pass::updateConfig ( TextureSourceInfo const &  sourceInfo,
TextureConfiguration  configuration 
)

Updates the configuration for a texture.

Parameters
[in]sourceInfoThe texture source.
[in]configurationThe new texture configuration.

◆ writeText()

virtual C3D_API bool castor3d::Pass::writeText ( castor::String const &  tabs,
castor::Path const &  folder,
castor::String const &  subfolder,
castor::StringStream &  file 
) const
pure virtual

Member Data Documentation

◆ m_dirty

bool castor3d::Pass::m_dirty { true }
protected

◆ m_sssDirty

bool castor3d::Pass::m_sssDirty { true }
protected

◆ MaxEdgeWidth

float constexpr castor3d::Pass::MaxEdgeWidth = 1000.0f
staticconstexpr

◆ MinEdgeWidth

float constexpr castor3d::Pass::MinEdgeWidth = 0.001f
staticconstexpr

◆ onChanged

OnPassChanged castor3d::Pass::onChanged

◆ onSssProfileChanged

OnPassChanged castor3d::Pass::onSssProfileChanged

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