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

#include <PhongPass.hpp>

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

Public Member Functions

C3D_API PhongPass (Material &parent, PassFlags initialFlags=PassFlag::eNone)
 Constructor. More...
 
C3D_API PhongPass (Material &parent, PassTypeID typeID, PassFlags initialFlags=PassFlag::eNone)
 Constructor, from derived classes. More...
 
C3D_API void fillBuffer (PassBuffer &buffer) const override
 Fills the pass buffer with this pass data. More...
 
C3D_API uint32_t getPassSectionID () const override
 
C3D_API uint32_t getTextureSectionID () const override
 
C3D_API bool writeText (castor::String const &tabs, castor::Path const &folder, castor::String const &subfolder, castor::StringStream &file) const override
 
void setColour (castor::RgbColour const &value) override
 Sets the basic pass colour. More...
 
castor::RgbColour const & getColour () const override
 
void setDiffuse (castor::RgbColour const &value)
 Sets the diffuse colour. More...
 
void setSpecular (castor::RgbColour const &value)
 Sets the specular colour. More...
 
void setAmbient (float const &value)
 Sets the ambient factor. More...
 
void setShininess (float value)
 Sets the shininess. More...
 
castor::RangedValue< float > const & getShininess () const
 
castor::RgbColour const & getDiffuse () const
 
castor::RgbColour const & getSpecular () const
 
float getAmbient () const
 
castor::RgbColour & getDiffuse ()
 
castor::RgbColour & getSpecular ()
 
- Public Member Functions inherited from castor3d::Pass
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 PassSPtr create (Material &parent)
 
static C3D_API castor::AttributeParsers createParsers ()
 
static C3D_API castor::AttributeParsers createParsers (uint32_t mtlSectionID, uint32_t texSectionID, uint32_t texRemapSectionID, castor::String const &texRemapSectionName, uint32_t remapChannelSectionID)
 
static C3D_API castor::StrUInt32Map createSections ()
 
- Static Public Member Functions inherited from castor3d::Pass
static C3D_API void addParser (castor::AttributeParsers &parsers, uint32_t section, castor::String const &name, castor::ParserFunction function, castor::ParserParameterArray &&array=castor::ParserParameterArray{})
 

Static Public Attributes

static constexpr float MaxShininess = 256.0f
 
static C3D_API castor::String const Type
 
static C3D_API castor::String const LightingModel
 
- Static Public Attributes inherited from castor3d::Pass
static float constexpr MinEdgeWidth = 0.001f
 
static float constexpr MaxEdgeWidth = 1000.0f
 

Protected Member Functions

C3D_API void doAccept (PassVisitorBase &vis) override
 
C3D_API void doAccept (TextureConfiguration &config, PassVisitorBase &vis) override
 
- Protected Member Functions inherited from castor3d::Pass
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
 

Additional Inherited Members

- Public Attributes inherited from castor3d::Pass
OnPassChanged onChanged
 
OnPassChanged onSssProfileChanged
 
- Static Protected Member Functions inherited from castor3d::Pass
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 inherited from castor3d::Pass
bool m_dirty { true }
 
bool m_sssDirty { true }
 

Constructor & Destructor Documentation

◆ PhongPass() [1/2]

C3D_API castor3d::PhongPass::PhongPass ( Material parent,
PassFlags  initialFlags = PassFlag::eNone 
)
explicit

Constructor.

Parameters
[in]parentThe parent material.
[in]initialFlagsThe pass initial flags.

◆ PhongPass() [2/2]

C3D_API castor3d::PhongPass::PhongPass ( Material parent,
PassTypeID  typeID,
PassFlags  initialFlags = PassFlag::eNone 
)

Constructor, from derived classes.

Parameters
[in]parentThe parent material.
[in]typeIDThe pass real type ID.
[in]initialFlagsThe pass initial flags.

Member Function Documentation

◆ create()

static C3D_API PassSPtr castor3d::PhongPass::create ( Material parent)
static

◆ createParsers() [1/2]

static C3D_API castor::AttributeParsers castor3d::PhongPass::createParsers ( )
static

◆ createParsers() [2/2]

static C3D_API castor::AttributeParsers castor3d::PhongPass::createParsers ( uint32_t  mtlSectionID,
uint32_t  texSectionID,
uint32_t  texRemapSectionID,
castor::String const &  texRemapSectionName,
uint32_t  remapChannelSectionID 
)
static

◆ createSections()

static C3D_API castor::StrUInt32Map castor3d::PhongPass::createSections ( )
static

◆ doAccept() [1/2]

C3D_API void castor3d::PhongPass::doAccept ( PassVisitorBase vis)
overrideprotectedvirtual

Implements castor3d::Pass.

◆ doAccept() [2/2]

C3D_API void castor3d::PhongPass::doAccept ( TextureConfiguration config,
PassVisitorBase vis 
)
overrideprotectedvirtual

Implements castor3d::Pass.

◆ fillBuffer()

C3D_API void castor3d::PhongPass::fillBuffer ( PassBuffer buffer) const
overridevirtual

Fills the pass buffer with this pass data.

Parameters
[in,out]bufferThe pass buffer.

Implements castor3d::Pass.

◆ getAmbient()

float castor3d::PhongPass::getAmbient ( ) const
inline
Returns
The ambient factor.

◆ getColour()

castor::RgbColour const & castor3d::PhongPass::getColour ( ) const
inlineoverridevirtual

Returns
The basic pass colour.

Implements castor3d::Pass.

References getDiffuse().

Here is the call graph for this function:

◆ getDiffuse() [1/2]

castor::RgbColour & castor3d::PhongPass::getDiffuse ( )
inline
Returns
The diffuse colour.

◆ getDiffuse() [2/2]

castor::RgbColour const & castor3d::PhongPass::getDiffuse ( ) const
inline
Returns
The diffuse colour.

Referenced by getColour().

Here is the caller graph for this function:

◆ getPassSectionID()

C3D_API uint32_t castor3d::PhongPass::getPassSectionID ( ) const
overridevirtual

Returns
The scene file section ID used for the pass effective type.

Implements castor3d::Pass.

◆ getShininess()

castor::RangedValue< float > const & castor3d::PhongPass::getShininess ( ) const
inline
Returns
The shininess value.

◆ getSpecular() [1/2]

castor::RgbColour & castor3d::PhongPass::getSpecular ( )
inline
Returns
The specular colour.

◆ getSpecular() [2/2]

castor::RgbColour const & castor3d::PhongPass::getSpecular ( ) const
inline
Returns
The specular colour.

◆ getTextureSectionID()

C3D_API uint32_t castor3d::PhongPass::getTextureSectionID ( ) const
overridevirtual

Returns
The scene file section ID used for the pass' textures effective type.

Implements castor3d::Pass.

◆ setAmbient()

void castor3d::PhongPass::setAmbient ( float const &  value)
inline

Sets the ambient factor.

Parameters
[in]valueThe new value.

◆ setColour()

void castor3d::PhongPass::setColour ( castor::RgbColour const &  value)
inlineoverridevirtual

Sets the basic pass colour.

Parameters
[in]valueThe new value.

Implements castor3d::Pass.

References setDiffuse().

Here is the call graph for this function:

◆ setDiffuse()

void castor3d::PhongPass::setDiffuse ( castor::RgbColour const &  value)
inline

Sets the diffuse colour.

Parameters
[in]valueThe new value.

Referenced by setColour().

Here is the caller graph for this function:

◆ setShininess()

void castor3d::PhongPass::setShininess ( float  value)
inline

Sets the shininess.

Parameters
[in]valueThe new value.

◆ setSpecular()

void castor3d::PhongPass::setSpecular ( castor::RgbColour const &  value)
inline

Sets the specular colour.

Parameters
[in]valueThe new value.

◆ writeText()

C3D_API bool castor3d::PhongPass::writeText ( castor::String const &  tabs,
castor::Path const &  folder,
castor::String const &  subfolder,
castor::StringStream &  file 
) const
overridevirtual

Implements castor3d::Pass.

Member Data Documentation

◆ LightingModel

C3D_API castor::String const castor3d::PhongPass::LightingModel
static

◆ MaxShininess

constexpr float castor3d::PhongPass::MaxShininess = 256.0f
staticconstexpr

◆ Type

C3D_API castor::String const castor3d::PhongPass::Type
static

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