Castor3D 0.15.0
Multiplatform 3D engine
|
#include <Pass.hpp>
Types publics | |
using | UnitArray = std::vector< TextureUnitRPtr > |
using | PassTextureSource = std::pair< TextureSourceInfo, PassTextureConfig > |
using | UnitDataSources = std::map< TextureUnitDataRPtr, std::vector< TextureSourceInfo > > |
Fonctions membres publiques | |
C3D_API | Pass (Material &parent, LightingModelID lightingModelId) |
Constructeur. | |
C3D_API | Pass (Material &parent, Pass const &rhs) |
Constructeur par copie. | |
C3D_API | ~Pass () noexcept |
Destructeur. | |
C3D_API void | initialise () |
Initialise la passe et toutes ses dépendances. | |
C3D_API void | cleanup () |
Nettoie la passe et toutes ses dépendances. | |
C3D_API void | update () |
Met à jour la passe de rendu, au niveau CPU. | |
C3D_API TextureUnitRPtr | getTextureUnit (uint32_t index) const |
Récupère la TextureUnit à l'index donné. | |
C3D_API void | registerTexture (TextureSourceInfo sourceInfo, PassTextureConfig configuration) |
Ajoute une texture. | |
C3D_API void | registerTexture (TextureSourceInfo sourceInfo, PassTextureConfig configuration, TextureAnimationUPtr animation) |
Ajoute une texture animée. | |
C3D_API void | unregisterTexture (TextureSourceInfo sourceInfo) |
Supprime une unité de texture. | |
C3D_API void | resetTexture (TextureSourceInfo const &srcSourceInfo, TextureSourceInfo dstSourceInfo) |
Remplace la source d'une texture. | |
C3D_API void | updateConfig (TextureSourceInfo const &sourceInfo, TextureConfiguration configuration) |
Met à jour la configuration d'une texture. | |
C3D_API void | prepareTextures () |
Réduit les textures. | |
C3D_API void | setColour (castor::HdrRgbColour const &value) |
Définit la couleur basique de la passe. | |
C3D_API castor::HdrRgbColour const & | getColour () const |
C3D_API PassComponentCombine | getPassFlags () const |
C3D_API void | accept (PassVisitorBase &vis) |
Fonction d'acceptation de PassVisitor. | |
C3D_API void | fillBuffer (PassBuffer &buffer, uint16_t passTypeIndex) const |
Remplit le pass buffer aves les données de cette passe. | |
C3D_API bool | writeText (castor::String const &tabs, castor::Path const &folder, castor::String const &subfolder, castor::StringStream &file) const |
Ecrit le contenu du composant en texte. | |
C3D_API void | fillConfig (TextureConfiguration &config, PassVisitorBase &vis) |
Fonction d'acceptation de PassVisitor, pour une configuration de texture. | |
Gestion des composants. | |
C3D_API void | addComponent (PassComponentUPtr component) |
C3D_API bool | hasComponent (castor::String const &name) const |
C3D_API PassComponent * | getComponent (castor::String const &name) const |
C3D_API std::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 |
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 |
template<typename ComponentT > | |
ComponentT * | getComponent () const |
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 | areNormalsInverted () 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 |
C3D_API bool | hasLighting () const |
C3D_API PassComponentRegister & | getPassComponentsRegister () const |
C3D_API PassComponentTextureFlag | getColourMapFlags () const |
C3D_API PassComponentTextureFlag | getOpacityMapFlags () const |
C3D_API PassComponentTextureFlag | getNormalMapFlags () const |
C3D_API PassComponentTextureFlag | getHeightMapFlags () const |
C3D_API PassComponentTextureFlag | getOcclusionMapFlags () const |
C3D_API castor::String | getTextureFlagsName (PassComponentTextureFlag flags) const |
C3D_API LightingModelID | getLightingModelId () const |
bool | hasAutomaticShader () const |
uint32_t | getId () const |
bool | isImplicit () const |
RenderPassRegisterInfo * | getRenderPassInfo () const |
uint32_t | getIndex () const |
uint32_t | getMaxTexCoordSet () const |
auto | begin () const |
auto | begin () |
auto | end () const |
auto | end () |
C3D_API void | enableLighting (bool value) |
C3D_API void | enablePicking (bool value) |
void | setId (uint32_t value) |
void | setImplicit (bool value=true) |
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 |
Fonctions membres publiques statiques | |
static C3D_API castor::AttributeParsers | createParsers (Engine const &engine) |
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) |
Attributs publics | |
OnPassChanged | onChanged |
Fonctions membres protégées statiques | |
static C3D_API void | parseError (castor::String const &error) |
Attributs protégés | |
std::atomic_bool | m_dirty { true } |
Amis | |
struct | PassComponent |
using castor3d::Pass::PassTextureSource = std::pair< TextureSourceInfo, PassTextureConfig > |
using castor3d::Pass::UnitArray = std::vector< TextureUnitRPtr > |
using castor3d::Pass::UnitDataSources = std::map< TextureUnitDataRPtr, std::vector< TextureSourceInfo > > |
|
explicit |
Constructeur.
[in] | parent | Le matériau parent. |
[in] | lightingModelId | L'ID du modèle d'éclairage du matériau. |
Constructeur par copie.
[in] | parent | Le matériau parent. |
[in] | rhs | La passe à copier. |
|
noexcept |
Destructeur.
C3D_API void castor3d::Pass::accept | ( | PassVisitorBase & | vis | ) |
Fonction d'acceptation de PassVisitor.
vis | Le ... visiteur. |
C3D_API void castor3d::Pass::addComponent | ( | PassComponentUPtr | component | ) |
C3D_API bool castor3d::Pass::areNormalsInverted | ( | ) | const |
|
inline |
|
inline |
name Itération sur les textures.
C3D_API void castor3d::Pass::cleanup | ( | ) |
Nettoie la passe et toutes ses dépendances.
|
static |
|
static |
|
static |
|
inlinestatic |
Références computeGlossinessFromShininess(), et computeRoughnessFromGlossiness().
|
static |
|
inlinestatic |
Références computeGlossinessFromRoughness(), et computeShininessFromGlossiness().
|
inline |
|
static |
C3D_API void castor3d::Pass::enableLighting | ( | bool | value | ) |
name Mutateurs.
C3D_API void castor3d::Pass::enablePicking | ( | bool | value | ) |
|
inline |
|
inline |
C3D_API void castor3d::Pass::fillBuffer | ( | PassBuffer & | buffer, |
uint16_t | passTypeIndex | ||
) | const |
Remplit le pass buffer aves les données de cette passe.
[in,out] | buffer | Le pass buffer. |
[in] | passTypeIndex | L'indice du type de passe. |
C3D_API void castor3d::Pass::fillConfig | ( | TextureConfiguration & | config, |
PassVisitorBase & | vis | ||
) |
Fonction d'acceptation de PassVisitor, pour une configuration de texture.
config | La configuration de texture. |
vis | Le ... visiteur. |
C3D_API VkCompareOp castor3d::Pass::getAlphaFunc | ( | ) | const |
C3D_API VkCompareOp castor3d::Pass::getBlendAlphaFunc | ( | ) | const |
C3D_API castor::HdrRgbColour const & castor3d::Pass::getColour | ( | ) | const |
C3D_API PassComponentTextureFlag castor3d::Pass::getColourMapFlags | ( | ) | const |
|
inline |
Références getComponent().
Référencé par 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 |
|
inline |
Références getComponentId(), et getComponentPlugin().
Référencé par getComponentPlugin().
|
inline |
C3D_API PassComponentPlugin const & castor3d::Pass::getComponentPlugin | ( | PassComponentID | componentId | ) | const |
|
inline |
C3D_API PassComponentTextureFlag castor3d::Pass::getHeightMapFlags | ( | ) | const |
|
inline |
|
inline |
C3D_API LightingModelID castor3d::Pass::getLightingModelId | ( | ) | const |
C3D_API shader::PassMaterialShader * castor3d::Pass::getMaterialShader | ( | castor::String const & | componentType | ) | const |
|
inline |
C3D_API PassComponentTextureFlag castor3d::Pass::getNormalMapFlags | ( | ) | const |
C3D_API PassComponentTextureFlag castor3d::Pass::getOcclusionMapFlags | ( | ) | const |
C3D_API PassComponentTextureFlag castor3d::Pass::getOpacityMapFlags | ( | ) | const |
C3D_API PassComponentRegister & castor3d::Pass::getPassComponentsRegister | ( | ) | const |
C3D_API PassComponentCombine castor3d::Pass::getPassFlags | ( | ) | const |
|
inline |
C3D_API TextureCombineID castor3d::Pass::getTextureCombineID | ( | ) | const |
C3D_API castor::String castor3d::Pass::getTextureFlagsName | ( | PassComponentTextureFlag | flags | ) | const |
C3D_API TextureCombine castor3d::Pass::getTexturesMask | ( | ) | const |
C3D_API TextureUnitRPtr castor3d::Pass::getTextureUnit | ( | uint32_t | index | ) | const |
Récupère la TextureUnit à l'index donné.
[in] | index | L'index voulu. |
nullptr
si index était hors bornes. C3D_API uint32_t castor3d::Pass::getTextureUnitsCount | ( | ) | const |
C3D_API bool castor3d::Pass::hasAlphaBlending | ( | ) | const |
C3D_API bool castor3d::Pass::hasAlphaTest | ( | ) | const |
|
inline |
C3D_API bool castor3d::Pass::hasBlendAlphaTest | ( | ) | const |
|
inline |
Références hasComponent().
Référencé par hasComponent().
C3D_API bool castor3d::Pass::hasComponent | ( | castor::String const & | name | ) | const |
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 | ( | ) |
Initialise la passe et toutes ses dépendances.
|
inline |
C3D_API bool castor3d::Pass::isTwoSided | ( | ) | const |
C3D_API bool castor3d::Pass::needsAlphaProcessing | ( | ) | const |
name Accesseurs.
|
staticprotected |
C3D_API void castor3d::Pass::prepareTextures | ( | ) |
Réduit les textures.
C3D_API void castor3d::Pass::registerTexture | ( | TextureSourceInfo | sourceInfo, |
PassTextureConfig | configuration | ||
) |
Ajoute une texture.
[in] | sourceInfo | La source de la texture. |
[in] | configuration | La configuration de la texture. |
C3D_API void castor3d::Pass::registerTexture | ( | TextureSourceInfo | sourceInfo, |
PassTextureConfig | configuration, | ||
TextureAnimationUPtr | animation | ||
) |
Ajoute une texture animée.
[in] | sourceInfo | La source de la texture. |
[in] | configuration | La configuration de la texture. |
[in] | animation | L'animation de la texture. |
|
inline |
Références removeComponent().
Référencé par removeComponent().
C3D_API std::vector< PassComponentUPtr > castor3d::Pass::removeComponent | ( | castor::String const & | name | ) |
|
inline |
Références m_dirty.
C3D_API void castor3d::Pass::resetTexture | ( | TextureSourceInfo const & | srcSourceInfo, |
TextureSourceInfo | dstSourceInfo | ||
) |
Remplace la source d'une texture.
[in] | srcSourceInfo | La source d'origine de la texture. |
[in] | dstSourceInfo | La source de remplacement de la texture. |
|
inline |
C3D_API void castor3d::Pass::setColour | ( | castor::HdrRgbColour const & | value | ) |
Définit la couleur basique de la passe.
[in] | value | La nouvelle valeur. |
Référencé par setColour().
|
inline |
|
inline |
|
inline |
|
inline |
C3D_API void castor3d::Pass::unregisterTexture | ( | TextureSourceInfo | sourceInfo | ) |
Supprime une unité de texture.
[in] | sourceInfo | La source de la texture. |
C3D_API void castor3d::Pass::update | ( | ) |
Met à jour la passe de rendu, au niveau CPU.
C3D_API void castor3d::Pass::updateConfig | ( | TextureSourceInfo const & | sourceInfo, |
TextureConfiguration | configuration | ||
) |
Met à jour la configuration d'une texture.
[in] | sourceInfo | La source de la texture. |
[in] | configuration | La nouvelle configuration de la texture. |
C3D_API bool castor3d::Pass::writeText | ( | castor::String const & | tabs, |
castor::Path const & | folder, | ||
castor::String const & | subfolder, | ||
castor::StringStream & | file | ||
) | const |
Ecrit le contenu du composant en texte.
[in] | tabs | Le niveau actuel de tabulation. |
[in] | folder | Le dossier de ressources. |
[in] | subfolder | Le sous-dossier de ressources. |
[in,out] | file | Le fichier de sortie. |
|
friend |
|
mutableprotected |
Référencé par reset().
OnPassChanged castor3d::Pass::onChanged |
name Signals.