Castor3D 0.16.0
Multiplatform 3D engine
|
#include <Pass.hpp>
Public Types | |
using | UnitArray = castor::Vector< TextureUnitRPtr > |
using | PassTextureSource = castor::Pair< TextureSourceInfo, PassTextureConfig > |
using | TextureSourceArray = castor::Vector< PassTextureSource > |
using | UnitDataSources = castor::Map< TextureUnitDataRPtr, castor::Vector< TextureSourceInfo > > |
Public Member Functions | |
C3D_API | Pass (Material &parent, LightingModelID lightingModelId) |
Constructor. | |
C3D_API | Pass (Material &parent, Pass const &rhs) |
Copy constructor. | |
C3D_API | ~Pass () noexcept |
Destructor. | |
C3D_API void | initialise () |
Initialises the pass and all it's dependencies. | |
C3D_API void | cleanup () |
Cleans up the pass and all it's dependencies. | |
C3D_API void | update () |
Updates the render pass, CPU wise. | |
C3D_API TextureUnitRPtr | getTextureUnit (uint32_t index) const |
Retrieves the TextureUnit at the given index. | |
C3D_API void | registerTexture (TextureSourceInfo sourceInfo, PassTextureConfig configuration) |
Adds a texture. | |
C3D_API void | registerTexture (TextureSourceInfo sourceInfo, PassTextureConfig configuration, TextureAnimationUPtr animation) |
Adds an animated texture. | |
C3D_API void | unregisterTexture (TextureSourceInfo const &sourceInfo) noexcept |
Removes a texture unit. | |
C3D_API void | resetTexture (TextureSourceInfo const &srcSourceInfo, TextureSourceInfo dstSourceInfo) |
Replaces a texture source. | |
C3D_API void | updateConfig (TextureSourceInfo const &sourceInfo, TextureConfiguration configuration) |
Updates the configuration for a texture. | |
C3D_API void | prepareTextures () |
Reduces the textures. | |
C3D_API void | setColour (castor::HdrRgbColour const &value) |
Sets the basic pass colour. | |
C3D_API castor::HdrRgbColour const & | getColour () const |
C3D_API PassComponentCombine | getPassFlags () const noexcept |
C3D_API void | accept (ConfigurationVisitorBase &vis) |
ConfigurationVisitorBase acceptance function. | |
C3D_API void | fillBuffer (PassBuffer &buffer) const |
Fills the pass buffer with this pass data. | |
C3D_API bool | writeText (castor::String const &tabs, castor::Path const &folder, castor::String const &subfolder, castor::StringStream &file) const |
Writes the component content to text. | |
C3D_API void | fillConfig (TextureConfiguration &config, ConfigurationVisitorBase &vis) |
ConfigurationVisitorBase acceptance function, for a specific texture configuration. | |
Components handling. | |
C3D_API void | addComponent (PassComponentUPtr component) |
C3D_API bool | hasComponent (castor::String const &name) const noexcept |
C3D_API PassComponent * | getComponent (castor::String const &name) const |
C3D_API castor::Vector< PassComponentUPtr > | removeComponent (castor::String const &name) |
C3D_API shader::PassMaterialShader * | getMaterialShader (castor::String const &componentType) const |
C3D_API PassComponentID | getComponentId (castor::String const &componentType) const |
C3D_API PassComponentPlugin const & | getComponentPlugin (PassComponentID componentId) const |
C3D_API PassComponentCombineID | getComponentCombineID () const |
C3D_API TextureCombineID | getTextureCombineID () const |
uint32_t | getHash () const noexcept |
PassComponentPlugin const & | getComponentPlugin (castor::String const &componentType) const |
template<typename ComponentT > | |
PassComponentPlugin const & | getComponentPlugin () const |
template<typename ComponentT > | |
void | removeComponent () |
template<typename ComponentT , typename ... ParamsT> | |
ComponentT * | createComponent (ParamsT &&... params) |
template<typename ComponentT > | |
bool | hasComponent () const noexcept |
template<typename ComponentT > | |
ComponentT * | getComponent () const noexcept |
PassComponentMap const & | getComponents () const |
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 BlendMode | getAlphaBlendMode () const |
C3D_API BlendMode | getColourBlendMode () const |
C3D_API VkCompareOp | getAlphaFunc () const |
C3D_API VkCompareOp | getBlendAlphaFunc () const |
C3D_API bool | hasEnvironmentMapping () const |
C3D_API bool | hasSubsurfaceScattering () const |
C3D_API bool | isTwoSided () const |
C3D_API UnitArray | getTextureUnits () const |
C3D_API uint32_t | getTextureUnitsCount () const |
C3D_API TextureCombine | getTexturesMask () const noexcept |
C3D_API bool | hasLighting () const |
C3D_API PassComponentRegister & | getPassComponentsRegister () const |
C3D_API castor::String | getTextureFlagsName (PassComponentTextureFlag flags) const |
C3D_API LightingModelID | getLightingModelId () const |
bool | isInitialised () const noexcept |
bool | isInitialising () const noexcept |
bool | hasAutomaticShader () const noexcept |
uint32_t | getId () const noexcept |
bool | isImplicit () const noexcept |
RenderPassRegisterInfo * | getRenderPassInfo () const noexcept |
uint32_t | getIndex () const noexcept |
uint32_t | getMaxTexCoordSet () const noexcept |
PassComponentTextureFlag | getColourMapFlags () const noexcept |
PassComponentTextureFlag | getOpacityMapFlags () const noexcept |
PassComponentTextureFlag | getNormalMapFlags () const noexcept |
PassComponentTextureFlag | getHeightMapFlags () const noexcept |
PassComponentTextureFlag | getOcclusionMapFlags () const noexcept |
PassComponentTextureFlag | getReflRefrFlags () const noexcept |
auto | begin () const noexcept |
auto | begin () noexcept |
auto | end () const noexcept |
auto | end () noexcept |
C3D_API void | enableLighting (bool value) const |
C3D_API void | enablePicking (bool value) const |
void | setId (uint32_t value) noexcept |
void | setImplicit (bool value=true) noexcept |
void | setColour (castor::RgbColour const &v, float gamma=2.2f) |
void | setColour (castor::Coords3f const &v) |
void | setColour (castor::Point3f const &v) |
void | reset () const noexcept |
Public Member Functions inherited from castor::OwnedBy< Material > | |
Material * | getOwner () const |
Static Public Member Functions | |
static C3D_API void | addParsers (castor::AttributeParsers &result, castor::UInt32StrMap const &textureChannels) |
static C3D_API float | computeRoughnessFromGlossiness (float glossiness) |
static C3D_API float | computeGlossinessFromRoughness (float roughness) |
static C3D_API float | computeGlossinessFromShininess (float shininess) |
static C3D_API float | computeShininessFromGlossiness (float glossiness) |
static float | computeRoughnessFromShininess (float const &shininess) |
static float | computeShininessFromRoughness (float const &roughness) |
Public Attributes | |
OnPassChanged | onChanged |
Protected Attributes | |
std::atomic_bool | m_dirty { true } |
Friends | |
struct | PassComponent |
Additional Inherited Members | |
Protected Member Functions inherited from castor::OwnedBy< Material > | |
OwnedBy (Material &owner) | |
Constructor. | |
using castor3d::Pass::UnitArray = castor::Vector< TextureUnitRPtr > |
using castor3d::Pass::UnitDataSources = castor::Map< TextureUnitDataRPtr, castor::Vector< TextureSourceInfo > > |
C3D_API castor3d::Pass::Pass | ( | Material & | parent, |
LightingModelID | lightingModelId ) |
Constructor.
[in] | parent | The parent material. |
[in] | lightingModelId | The material's lighting model ID. |
Copy constructor.
[in] | parent | The parent material. |
[in] | rhs | The pass top copy. |
|
noexcept |
Destructor.
C3D_API void castor3d::Pass::accept | ( | ConfigurationVisitorBase & | vis | ) |
ConfigurationVisitorBase acceptance function.
vis | The ... visitor. |
C3D_API void castor3d::Pass::addComponent | ( | PassComponentUPtr | component | ) |
|
static |
|
inlinenoexcept |
name Textures iteration.
|
inlinenoexcept |
C3D_API void castor3d::Pass::cleanup | ( | ) |
Cleans up the pass and all it's dependencies.
|
static |
|
static |
|
static |
|
inlinestatic |
References computeGlossinessFromShininess(), and computeRoughnessFromGlossiness().
|
static |
|
inlinestatic |
References computeGlossinessFromRoughness(), and computeShininessFromGlossiness().
|
inline |
C3D_API void castor3d::Pass::enableLighting | ( | bool | value | ) | const |
name Mutators.
C3D_API void castor3d::Pass::enablePicking | ( | bool | value | ) | const |
|
inlinenoexcept |
|
inlinenoexcept |
C3D_API void castor3d::Pass::fillBuffer | ( | PassBuffer & | buffer | ) | const |
Fills the pass buffer with this pass data.
[in,out] | buffer | The pass buffer. |
C3D_API void castor3d::Pass::fillConfig | ( | TextureConfiguration & | config, |
ConfigurationVisitorBase & | vis ) |
ConfigurationVisitorBase acceptance function, for a specific texture configuration.
config | The texture configuration. |
vis | The ... visitor. |
C3D_API VkCompareOp castor3d::Pass::getAlphaFunc | ( | ) | const |
C3D_API VkCompareOp castor3d::Pass::getBlendAlphaFunc | ( | ) | const |
C3D_API castor::HdrRgbColour const & castor3d::Pass::getColour | ( | ) | const |
|
inlinenoexcept |
|
inlinenoexcept |
References getComponent().
Referenced by getComponent().
C3D_API PassComponent * castor3d::Pass::getComponent | ( | castor::String const & | name | ) | const |
C3D_API PassComponentCombineID castor3d::Pass::getComponentCombineID | ( | ) | const |
C3D_API PassComponentID castor3d::Pass::getComponentId | ( | castor::String const & | componentType | ) | const |
Referenced by getComponentPlugin(), and getComponentPlugin().
|
inline |
References getComponentId(), and getComponentPlugin().
Referenced by getComponentPlugin(), and getComponentPlugin().
|
inline |
C3D_API PassComponentPlugin const & castor3d::Pass::getComponentPlugin | ( | PassComponentID | componentId | ) | const |
|
inline |
|
inlinenoexcept |
References getComponentCombineID(), and getTextureCombineID().
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
C3D_API LightingModelID castor3d::Pass::getLightingModelId | ( | ) | const |
C3D_API shader::PassMaterialShader * castor3d::Pass::getMaterialShader | ( | castor::String const & | componentType | ) | const |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
C3D_API PassComponentRegister & castor3d::Pass::getPassComponentsRegister | ( | ) | const |
|
noexcept |
|
inlinenoexcept |
|
inlinenoexcept |
C3D_API TextureCombineID castor3d::Pass::getTextureCombineID | ( | ) | const |
C3D_API castor::String castor3d::Pass::getTextureFlagsName | ( | PassComponentTextureFlag | flags | ) | const |
|
noexcept |
C3D_API TextureUnitRPtr castor3d::Pass::getTextureUnit | ( | uint32_t | index | ) | const |
Retrieves the TextureUnit at the given index.
[in] | index | The index of the TextureUnit to retrieve. |
nullptr
if index was out of bounds. C3D_API uint32_t castor3d::Pass::getTextureUnitsCount | ( | ) | const |
C3D_API bool castor3d::Pass::hasAlphaBlending | ( | ) | const |
C3D_API bool castor3d::Pass::hasAlphaTest | ( | ) | const |
|
inlinenoexcept |
C3D_API bool castor3d::Pass::hasBlendAlphaTest | ( | ) | const |
|
inlinenoexcept |
References hasComponent().
Referenced by hasComponent().
|
noexcept |
C3D_API bool castor3d::Pass::hasEnvironmentMapping | ( | ) | const |
C3D_API bool castor3d::Pass::hasLighting | ( | ) | const |
C3D_API bool castor3d::Pass::hasOnlyAlphaBlending | ( | ) | const |
C3D_API bool castor3d::Pass::hasSubsurfaceScattering | ( | ) | const |
C3D_API void castor3d::Pass::initialise | ( | ) |
Initialises the pass and all it's dependencies.
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
C3D_API bool castor3d::Pass::isTwoSided | ( | ) | const |
C3D_API bool castor3d::Pass::needsAlphaProcessing | ( | ) | const |
name Getters.
C3D_API void castor3d::Pass::prepareTextures | ( | ) |
Reduces the textures.
C3D_API void castor3d::Pass::registerTexture | ( | TextureSourceInfo | sourceInfo, |
PassTextureConfig | configuration ) |
Adds a texture.
[in] | sourceInfo | The texture source. |
[in] | configuration | The texture configuration. |
C3D_API void castor3d::Pass::registerTexture | ( | TextureSourceInfo | sourceInfo, |
PassTextureConfig | configuration, | ||
TextureAnimationUPtr | animation ) |
Adds an animated texture.
[in] | sourceInfo | The texture source. |
[in] | configuration | The texture configuration. |
[in] | animation | The texture animation. |
|
inline |
References removeComponent().
Referenced by removeComponent().
C3D_API castor::Vector< PassComponentUPtr > castor3d::Pass::removeComponent | ( | castor::String const & | name | ) |
|
inlinenoexcept |
References m_dirty.
C3D_API void castor3d::Pass::resetTexture | ( | TextureSourceInfo const & | srcSourceInfo, |
TextureSourceInfo | dstSourceInfo ) |
Replaces a texture source.
[in] | srcSourceInfo | The original texture source. |
[in] | dstSourceInfo | The replacement texture source. |
|
inline |
C3D_API void castor3d::Pass::setColour | ( | castor::HdrRgbColour const & | value | ) |
Sets the basic pass colour.
[in] | value | The new value. |
Referenced by setColour(), setColour(), and setColour().
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
noexcept |
Removes a texture unit.
[in] | sourceInfo | The texture source. |
C3D_API void castor3d::Pass::update | ( | ) |
Updates the render pass, CPU wise.
C3D_API void castor3d::Pass::updateConfig | ( | TextureSourceInfo const & | sourceInfo, |
TextureConfiguration | configuration ) |
Updates the configuration for a texture.
[in] | sourceInfo | The texture source. |
[in] | configuration | The new texture configuration. |
C3D_API bool castor3d::Pass::writeText | ( | castor::String const & | tabs, |
castor::Path const & | folder, | ||
castor::String const & | subfolder, | ||
castor::StringStream & | file ) const |
Writes the component content to text.
[in] | tabs | The current tabulation level. |
[in] | folder | The resources folder. |
[in] | subfolder | The resources subfolder. |
[in,out] | file | The output file. |
|
friend |
|
mutableprotected |
Referenced by reset().
OnPassChanged castor3d::Pass::onChanged |
name Signals.