Castor3D 0.16.0
Multiplatform 3D engine
Public Member Functions | Protected Member Functions | List of all members
castor3d::shader::PassComponentsShader Struct Reference

#include <PassComponent.hpp>

Inheritance diagram for castor3d::shader::PassComponentsShader:
Inheritance graph
[legend]
Collaboration diagram for castor3d::shader::PassComponentsShader:
Collaboration graph
[legend]

Public Member Functions

C3D_API PassComponentsShader (PassComponentPlugin const &plugin)
 
virtual C3D_API void fillComponents (ComponentModeFlags componentsMask, sdw::type::BaseStruct &components, Materials const &materials, sdw::StructInstance const *surface) const
 Fills the components shader struct with the members provided by this component.
 
virtual C3D_API void fillComponentsInits (sdw::type::BaseStruct const &components, Materials const &materials, Material const *material, sdw::StructInstance const *surface, sdw::Vec4 const *clrCot, sdw::expr::ExprList &inits) const
 Fills the components shader struct members initialiser with the ones provided by this component.
 
virtual C3D_API void applyComponents (PipelineFlags const *flags, shader::TextureConfigData const &config, sdw::U32Vec3 const &imgCompConfig, sdw::Vec4 const &sampled, sdw::Vec2 const &uv, BlendComponents &components) const
 Fills this component's values with the data retrieved from a texture.
 
virtual C3D_API void blendComponents (shader::Materials const &materials, sdw::Float const &passMultiplier, BlendComponents &res, BlendComponents const &src) const
 Used to mix components when multiple passes are blended together.
 
virtual C3D_API void updateComponent (sdw::Array< sdw::CombinedImage2DRgba32 > const &maps, shader::Material const &material, shader::BlendComponents &components, bool isFrontCulled) const
 
virtual C3D_API sdw::Vec4 sampleMap (sdw::CombinedImage2DRgba32 const &map, sdw::Vec3 const &texCoords, shader::BlendComponents const &components) const
 
virtual C3D_API sdw::Vec4 sampleMap (sdw::CombinedImage2DRgba32 const &map, shader::DerivTex const &texCoords, shader::BlendComponents const &components) const
 
virtual C3D_API bool isMapSampling (PipelineFlags const &flags) const
 

Getters.

C3D_API PassComponentID getId () const
 
PassComponentPlugin const & getPlugin () const
 
- Public Member Functions inherited from castor3d::shader::PassShader
 PassShader ()=default
 
 PassShader (PassShader const &)=delete
 
PassShaderoperator= (PassShader const &)=delete
 
C3D_API PassShader (PassShader &&)=default
 
C3D_API PassShaderoperator= (PassShader &&)=default
 
virtual C3D_API ~PassShader ()=default
 

Protected Member Functions

C3D_API void applyFloatComponent (castor::String const &mapName, castor::String const &valueName, PassShaders const &passShaders, TextureConfigurations const &textureConfigs, TextureAnimations const &textureAnims, Material const &material, BlendComponents &components, SampleTexture const &sampleTexture) const
 
C3D_API void applyVec3Component (castor::String const &mapName, castor::String const &valueName, PassShaders const &passShaders, TextureConfigurations const &textureConfigs, TextureAnimations const &textureAnims, Material const &material, BlendComponents &components, SampleTexture const &sampleTexture) const
 
void applyFloatComponent (castor::String const &valueName, PassShaders const &passShaders, TextureConfigurations const &textureConfigs, TextureAnimations const &textureAnims, Material const &material, BlendComponents &components, SampleTexture const &sampleTexture) const
 
void applyVec3Component (castor::String const &valueName, PassShaders const &passShaders, TextureConfigurations const &textureConfigs, TextureAnimations const &textureAnims, Material const &material, BlendComponents &components, SampleTexture const &sampleTexture) const
 

Constructor & Destructor Documentation

◆ PassComponentsShader()

C3D_API castor3d::shader::PassComponentsShader::PassComponentsShader ( PassComponentPlugin const & plugin)
inlineexplicit

Member Function Documentation

◆ applyComponents()

virtual C3D_API void castor3d::shader::PassComponentsShader::applyComponents ( PipelineFlags const * flags,
shader::TextureConfigData const & config,
sdw::U32Vec3 const & imgCompConfig,
sdw::Vec4 const & sampled,
sdw::Vec2 const & uv,
BlendComponents & components ) const
inlinevirtual

Fills this component's values with the data retrieved from a texture.

Parameters
[in]flagsUsed to check if the render pass is configured so the component is usable.
[in]configUsed to say if the texture has the needed configuration for this component.
[in]imgCompConfigThe current image component(s) to use.
[in]sampledThe data retrieved from the texture.
[in]uvThe texture coordinates used to retrieve sampled.
[in]componentsContains the component members.

◆ applyFloatComponent() [1/2]

C3D_API void castor3d::shader::PassComponentsShader::applyFloatComponent ( castor::String const & mapName,
castor::String const & valueName,
PassShaders const & passShaders,
TextureConfigurations const & textureConfigs,
TextureAnimations const & textureAnims,
Material const & material,
BlendComponents & components,
SampleTexture const & sampleTexture ) const
protected

Referenced by applyFloatComponent().

Here is the caller graph for this function:

◆ applyFloatComponent() [2/2]

void castor3d::shader::PassComponentsShader::applyFloatComponent ( castor::String const & valueName,
PassShaders const & passShaders,
TextureConfigurations const & textureConfigs,
TextureAnimations const & textureAnims,
Material const & material,
BlendComponents & components,
SampleTexture const & sampleTexture ) const
inlineprotected

References applyFloatComponent().

Here is the call graph for this function:

◆ applyVec3Component() [1/2]

C3D_API void castor3d::shader::PassComponentsShader::applyVec3Component ( castor::String const & mapName,
castor::String const & valueName,
PassShaders const & passShaders,
TextureConfigurations const & textureConfigs,
TextureAnimations const & textureAnims,
Material const & material,
BlendComponents & components,
SampleTexture const & sampleTexture ) const
protected

Referenced by applyVec3Component().

Here is the caller graph for this function:

◆ applyVec3Component() [2/2]

void castor3d::shader::PassComponentsShader::applyVec3Component ( castor::String const & valueName,
PassShaders const & passShaders,
TextureConfigurations const & textureConfigs,
TextureAnimations const & textureAnims,
Material const & material,
BlendComponents & components,
SampleTexture const & sampleTexture ) const
inlineprotected

References applyVec3Component().

Here is the call graph for this function:

◆ blendComponents()

virtual C3D_API void castor3d::shader::PassComponentsShader::blendComponents ( shader::Materials const & materials,
sdw::Float const & passMultiplier,
BlendComponents & res,
BlendComponents const & src ) const
inlinevirtual

◆ fillComponents()

virtual C3D_API void castor3d::shader::PassComponentsShader::fillComponents ( ComponentModeFlags componentsMask,
sdw::type::BaseStruct & components,
Materials const & materials,
sdw::StructInstance const * surface ) const
inlinevirtual

Fills the components shader struct with the members provided by this component.

Parameters
[in]componentsMaskUsed to check if the component is valid in the context of the call.
[in,out]componentsReceives the struct members.
[in]materialsUsed to check if the current render pass needs this component.
[in]surfaceUsed to check if the surface supports needed data for this component.

Reimplemented in castor3d::FractalMappingComponent::ComponentsShader, castor3d::NormalComponent::ComponentsShader, castor3d::TexturesComponent::ComponentsShader, castor3d::AmbientComponent::ComponentsShader, castor3d::AttenuationComponent::ComponentsShader, castor3d::ClearcoatComponent::ComponentsShader, castor3d::EmissiveComponent::ComponentsShader, castor3d::IridescenceComponent::ComponentsShader, castor3d::MetalnessComponent::ComponentsShader, castor3d::RoughnessComponent::ComponentsShader, castor3d::SheenComponent::ComponentsShader, castor3d::SpecularComponent::ComponentsShader, castor3d::SpecularFactorComponent::ComponentsShader, castor3d::SubsurfaceScatteringComponent::ComponentsShader, castor3d::ThicknessComponent::ComponentsShader, castor3d::TransmissionComponent::ComponentsShader, castor3d::TransmittanceComponent::ComponentsShader, castor3d::OcclusionMapComponent::ComponentsShader, castor3d::AlphaTestComponent::ComponentsShader, castor3d::ColourComponent::ComponentsShader, castor3d::HeightComponent::ComponentsShader, castor3d::OpacityComponent::ComponentsShader, castor3d::ReflectionComponent::ComponentsShader, and castor3d::RefractionComponent::ComponentsShader.

◆ fillComponentsInits()

virtual C3D_API void castor3d::shader::PassComponentsShader::fillComponentsInits ( sdw::type::BaseStruct const & components,
Materials const & materials,
Material const * material,
sdw::StructInstance const * surface,
sdw::Vec4 const * clrCot,
sdw::expr::ExprList & inits ) const
inlinevirtual

Fills the components shader struct members initialiser with the ones provided by this component.

Remarks
The initialisers order and count must match the ones in fillComponent.
Parameters
[in]componentsReceives the struct members.
[in]materialsUsed to check if the current render pass needs this component.
[in]materialUsed to retrieve needed data for this component.
[in]surfaceUsed to retrieve needed data for this component.
[in]clrCotUsed to retrieve needed data for this component.
[in,out]initsReceives the initialisers.

Reimplemented in castor3d::FractalMappingComponent::ComponentsShader, castor3d::NormalComponent::ComponentsShader, castor3d::TexturesComponent::ComponentsShader, castor3d::AmbientComponent::ComponentsShader, castor3d::AttenuationComponent::ComponentsShader, castor3d::ClearcoatComponent::ComponentsShader, castor3d::EmissiveComponent::ComponentsShader, castor3d::IridescenceComponent::ComponentsShader, castor3d::MetalnessComponent::ComponentsShader, castor3d::RoughnessComponent::ComponentsShader, castor3d::SheenComponent::ComponentsShader, castor3d::SpecularComponent::ComponentsShader, castor3d::SpecularFactorComponent::ComponentsShader, castor3d::SubsurfaceScatteringComponent::ComponentsShader, castor3d::ThicknessComponent::ComponentsShader, castor3d::TransmissionComponent::ComponentsShader, castor3d::TransmittanceComponent::ComponentsShader, castor3d::OcclusionMapComponent::ComponentsShader, castor3d::AlphaTestComponent::ComponentsShader, castor3d::ColourComponent::ComponentsShader, castor3d::HeightComponent::ComponentsShader, castor3d::OpacityComponent::ComponentsShader, castor3d::ReflectionComponent::ComponentsShader, and castor3d::RefractionComponent::ComponentsShader.

◆ getId()

C3D_API PassComponentID castor3d::shader::PassComponentsShader::getId ( ) const

Referenced by castor3d::AttenuationMapComponent::ComponentsShader::getTextureFlags(), castor3d::ClearcoatMapComponent::ComponentsShader::getTextureFlags(), castor3d::ClearcoatNormalMapComponent::ComponentsShader::getTextureFlags(), castor3d::ClearcoatRoughnessMapComponent::ComponentsShader::getTextureFlags(), castor3d::ColourMapComponent::ComponentsShader::getTextureFlags(), castor3d::EmissiveMapComponent::ComponentsShader::getTextureFlags(), castor3d::GlossinessMapComponent::ComponentsShader::getTextureFlags(), castor3d::HeightMapComponent::ComponentsShader::getTextureFlags(), castor3d::IridescenceMapComponent::ComponentsShader::getTextureFlags(), castor3d::IridescenceThicknessMapComponent::ComponentsShader::getTextureFlags(), castor3d::MetalnessMapComponent::ComponentsShader::getTextureFlags(), castor3d::NormalMapComponent::ComponentsShader::getTextureFlags(), castor3d::OcclusionMapComponent::ComponentsShader::getTextureFlags(), castor3d::OpacityMapComponent::ComponentsShader::getTextureFlags(), castor3d::RoughnessMapComponent::ComponentsShader::getTextureFlags(), castor3d::SheenMapComponent::ComponentsShader::getTextureFlags(), castor3d::SheenRoughnessMapComponent::ComponentsShader::getTextureFlags(), castor3d::SpecularFactorMapComponent::ComponentsShader::getTextureFlags(), castor3d::SpecularMapComponent::ComponentsShader::getTextureFlags(), castor3d::TransmissionMapComponent::ComponentsShader::getTextureFlags(), castor3d::TransmittanceMapComponent::ComponentsShader::getTextureFlags(), castor3d::FractalMappingComponent::ComponentsShader::isMapSampling(), and castor3d::UntileMappingComponent::ComponentsShader::isMapSampling().

Here is the caller graph for this function:

◆ getPlugin()

PassComponentPlugin const & castor3d::shader::PassComponentsShader::getPlugin ( ) const
inline

◆ isMapSampling()

virtual C3D_API bool castor3d::shader::PassComponentsShader::isMapSampling ( PipelineFlags const & flags) const
inlinevirtual
Returns
true if the component map sampling is usable with given flags.

Reimplemented in castor3d::FractalMappingComponent::ComponentsShader, and castor3d::UntileMappingComponent::ComponentsShader.

◆ sampleMap() [1/2]

virtual C3D_API sdw::Vec4 castor3d::shader::PassComponentsShader::sampleMap ( sdw::CombinedImage2DRgba32 const & map,
sdw::Vec3 const & texCoords,
shader::BlendComponents const & components ) const
virtual

Lets the component sample the map.

Parameters
[in]mapThe texture.
[in]texCoordsThe texture coordinates.
[in]componentsContains the component members.

Reimplemented in castor3d::FractalMappingComponent::ComponentsShader, and castor3d::UntileMappingComponent::ComponentsShader.

◆ sampleMap() [2/2]

virtual C3D_API sdw::Vec4 castor3d::shader::PassComponentsShader::sampleMap ( sdw::CombinedImage2DRgba32 const & map,
shader::DerivTex const & texCoords,
shader::BlendComponents const & components ) const
virtual

Lets the component sample the map.

Parameters
[in]mapThe texture.
[in]texCoordsThe texture coordinates.
[in]componentsContains the component members.

Reimplemented in castor3d::FractalMappingComponent::ComponentsShader, and castor3d::UntileMappingComponent::ComponentsShader.

◆ updateComponent()

virtual C3D_API void castor3d::shader::PassComponentsShader::updateComponent ( sdw::Array< sdw::CombinedImage2DRgba32 > const & maps,
shader::Material const & material,
shader::BlendComponents & components,
bool isFrontCulled ) const
inlinevirtual

Adjusts the component data after textures have been parsed.

Parameters
[in]mapsHolds the material pass images.
[in]materialThe material data.
[in,out]componentsContains the component members.
[in]isFrontCulledTells if this shader is for front culled objects.

Reimplemented in castor3d::MetalnessComponent::ComponentsShader.


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