Castor3D 0.14.0
Multiplatform 3D engine
Fonctions membres publiques | Liste de tous les membres
Référence de la classe castor3d::shader::LightingModelabstract

#include <GlslLighting.hpp>

Graphe d'héritage de castor3d::shader::LightingModel:
Inheritance graph
[légende]
Graphe de collaboration de castor3d::shader::LightingModel:
Collaboration graph
[légende]

Fonctions membres publiques

C3D_API LightingModel (sdw::ShaderWriter &writer, Materials const &materials, Utils &utils, BRDFHelpers &brdf, ShadowOptions shadowOptions, SssProfiles const *sssProfiles, bool enableVolumetric, std::string prefix)
 
virtual C3D_API ~LightingModel ()=default
 
virtual C3D_API sdw::Float getFinalTransmission (BlendComponents const &components, sdw::Vec3 const &incident)=0
 
C3D_API sdw::Vec3 combine (BlendComponents const &components, sdw::Vec3 const &incident, sdw::Vec3 const &directDiffuse, sdw::Vec3 const &indirectDiffuse, sdw::Vec3 const &directSpecular, sdw::Vec3 const &directScattering, sdw::Vec3 const &directCoatingSpecular, sdw::Vec2 const &directSheen, sdw::Vec3 const &indirectSpecular, sdw::Vec3 const &directAmbient, sdw::Vec3 const &indirectAmbient, sdw::Float const &ambientOcclusion, sdw::Vec3 const &emissive, sdw::Vec3 reflectedDiffuse, sdw::Vec3 reflectedSpecular, sdw::Vec3 refracted, sdw::Vec3 coatReflected, sdw::Vec3 sheenReflected)
 
virtual C3D_API sdw::Vec3 adjustDirectAmbient (BlendComponents const &components, sdw::Vec3 const &directAmbient) const =0
 
virtual C3D_API sdw::Vec3 adjustDirectSpecular (BlendComponents const &components, sdw::Vec3 const &directSpecular) const =0
 
C3D_API sdw::Vec3 combine (BlendComponents const &components, sdw::Vec3 const &incident, sdw::Vec3 const &directDiffuse, sdw::Vec3 const &indirectDiffuse, sdw::Vec3 const &directSpecular, sdw::Vec3 const &directScattering, sdw::Vec3 const &directCoatingSpecular, sdw::Vec2 const &directSheen, sdw::Vec3 const &indirectSpecular, sdw::Vec3 const &directAmbient, sdw::Vec3 const &indirectAmbient, sdw::Vec3 reflectedDiffuse, sdw::Vec3 reflectedSpecular, sdw::Vec3 refracted, sdw::Vec3 coatReflected, sdw::Vec3 sheenReflected)
 
virtual C3D_API ReflectionModelPtr getReflectionModel (uint32_t &envMapBinding, uint32_t envMapSet) const =0
 

Deferred renderring

C3D_API void declareDirectionalModel (bool lightUbo, uint32_t lightBinding, uint32_t lightSet, uint32_t &shadowMapBinding, uint32_t shadowMapSet)
 
C3D_API void declarePointModel (bool lightUbo, uint32_t lightBinding, uint32_t lightSet, uint32_t &shadowMapBinding, uint32_t shadowMapSet)
 
C3D_API void declareSpotModel (bool lightUbo, uint32_t lightBinding, uint32_t lightSet, uint32_t &shadowMapBinding, uint32_t shadowMapSet)
 

Diffuse + Specular

virtual C3D_API void compute (DirectionalLight const &light, BlendComponents const &components, Surface const &surface, BackgroundModel &background, sdw::Vec3 const &worldEye, sdw::UInt const &receivesShadows, OutputComponents &output)=0
 
virtual C3D_API void compute (PointLight const &light, BlendComponents const &components, Surface const &surface, sdw::Vec3 const &worldEye, sdw::UInt const &receivesShadows, OutputComponents &output)=0
 
virtual C3D_API void compute (SpotLight const &light, BlendComponents const &components, Surface const &surface, sdw::Vec3 const &worldEye, sdw::UInt const &receivesShadows, OutputComponents &output)=0
 

Diffuse only

virtual C3D_API sdw::Vec3 computeDiffuse (DirectionalLight const &light, BlendComponents const &components, Surface const &surface, sdw::Vec3 const &worldEye, sdw::UInt const &receivesShadows)=0
 
virtual C3D_API sdw::Vec3 computeDiffuse (PointLight const &light, BlendComponents const &components, Surface const &surface, sdw::Vec3 const &worldEye, sdw::UInt const &receivesShadows)=0
 
virtual C3D_API sdw::Vec3 computeDiffuse (SpotLight const &light, BlendComponents const &components, Surface const &surface, sdw::Vec3 const &worldEye, sdw::UInt const &receivesShadows)=0
 

Light accessors

sdw::ShaderWriter & m_writer
 
Materials const & m_materials
 
Utilsm_utils
 
std::unique_ptr< sdw::Struct > m_type
 
std::unique_ptr< sdw::StorageBuffer > m_ssbo
 
std::unique_ptr< sdw::RImageBufferRgba32 > m_tbo
 
bool m_enableVolumetric
 
std::string m_prefix
 
std::shared_ptr< Shadowm_shadowModel
 
std::shared_ptr< SssTransmittancem_sssTransmittance
 
sdw::Function< sdw::Vec3, sdw::InVec3, sdw::InVec4, sdw::InUInt > m_getCascadeFactors
 
sdw::Function< sdw::Vec3, sdw::InVec3, sdw::InVec4Array, sdw::InUInt > m_getTileFactors
 
sdw::Function< shader::Light, sdw::InOutUInt > m_getBaseLight
 
sdw::Function< shader::DirectionalLight, sdw::InUInt > m_getDirectionalLight
 
sdw::Function< shader::PointLight, sdw::InUInt > m_getPointLight
 
sdw::Function< shader::SpotLight, sdw::InUInt > m_getSpotLight
 
C3D_API DirectionalLight getDirectionalLight (sdw::UInt const &index) const
 
C3D_API PointLight getPointLight (sdw::UInt const &index) const
 
C3D_API SpotLight getSpotLight (sdw::UInt const &index) const
 
ShadowgetShadowModel () const
 
C3D_API Light getBaseLight (sdw::UInt &offset) const
 
C3D_API void doDeclareLightsBuffer (uint32_t binding, uint32_t set)
 
C3D_API void doDeclareDirectionalLightUbo (uint32_t binding, uint32_t set)
 
C3D_API void doDeclarePointLightUbo (uint32_t binding, uint32_t set)
 
C3D_API void doDeclareSpotLightUbo (uint32_t binding, uint32_t set)
 
C3D_API void doDeclareGetBaseLight ()
 
C3D_API void doDeclareGetDirectionalLight ()
 
C3D_API void doDeclareGetPointLight ()
 
C3D_API void doDeclareGetSpotLight ()
 
C3D_API void doDeclareGetCascadeFactors ()
 

Diffuse + Specular

C3D_API void declareModel (uint32_t lightsBufBinding, uint32_t lightsBufSet, uint32_t &shadowMapBinding, uint32_t shadowMapSet)
 
C3D_API void computeCombined (BlendComponents const &components, SceneData const &sceneData, BackgroundModel &background, Surface const &surface, sdw::Vec3 const &worldEye, sdw::UInt const &receivesShadows, OutputComponents &output)
 
static C3D_API LightingModelPtr createModel (Engine const &engine, Materials const &materials, Utils &utils, BRDFHelpers &brdf, castor::String const &name, uint32_t lightsBufBinding, uint32_t lightsBufSet, ShadowOptions const &shadows, SssProfiles const *sssProfiles, uint32_t &shadowMapBinding, uint32_t shadowMapSet, bool enableVolumetric)
 
template<typename LightsBufBindingT >
static LightingModelPtr createModelT (Engine const &engine, Materials const &materials, Utils &utils, BRDFHelpers &brdf, castor::String const &name, LightsBufBindingT lightsBufBinding, uint32_t lightsBufSet, ShadowOptions const &shadows, SssProfiles const *sssProfiles, uint32_t &shadowMapBinding, uint32_t shadowMapSet, bool enableVolumetric)
 
template<typename LightBindingT >
static LightingModelPtr createModel (Engine const &engine, Materials const &materials, Utils &utils, BRDFHelpers &brdf, castor::String const &name, LightType light, LightBindingT lightBinding, uint32_t lightSet, bool lightUbo, ShadowOptions const &shadows, SssProfiles const *sssProfiles, uint32_t &shadowMapBinding, uint32_t shadowMapSet)
 

Diffuse only

C3D_API void declareDiffuseModel (uint32_t lightsBufBinding, uint32_t lightsBufSet, uint32_t &shadowMapBinding, uint32_t shadowMapSet)
 
C3D_API sdw::Vec3 computeCombinedDiffuse (BlendComponents const &components, SceneData const &sceneData, Surface const &surface, sdw::Vec3 const &worldEye, sdw::UInt const &receivesShadows)
 
static C3D_API LightingModelPtr createDiffuseModel (Engine const &engine, Materials const &materials, Utils &utils, BRDFHelpers &brdf, castor::String const &name, uint32_t lightsBufBinding, uint32_t lightsBufSet, ShadowOptions const &shadows, uint32_t &shadowMapBinding, uint32_t shadowMapSet, bool enableVolumetric)
 
template<typename LightsBufBindingT >
static LightingModelPtr createDiffuseModelT (Engine const &engine, Materials const &materials, Utils &utils, BRDFHelpers &brdf, castor::String const &name, LightsBufBindingT lightsBufBinding, uint32_t lightsBufSet, ShadowOptions const &shadows, uint32_t &shadowMapBinding, uint32_t shadowMapSet, bool enableVolumetric)
 

Documentation des constructeurs et destructeur

◆ LightingModel()

C3D_API castor3d::shader::LightingModel::LightingModel ( sdw::ShaderWriter &  writer,
Materials const &  materials,
Utils utils,
BRDFHelpers brdf,
ShadowOptions  shadowOptions,
SssProfiles const *  sssProfiles,
bool  enableVolumetric,
std::string  prefix 
)

◆ ~LightingModel()

virtual C3D_API castor3d::shader::LightingModel::~LightingModel ( )
virtualdefault

Documentation des fonctions membres

◆ adjustDirectAmbient()

virtual C3D_API sdw::Vec3 castor3d::shader::LightingModel::adjustDirectAmbient ( BlendComponents const &  components,
sdw::Vec3 const &  directAmbient 
) const
pure virtual

◆ adjustDirectSpecular()

virtual C3D_API sdw::Vec3 castor3d::shader::LightingModel::adjustDirectSpecular ( BlendComponents const &  components,
sdw::Vec3 const &  directSpecular 
) const
pure virtual

◆ combine() [1/2]

C3D_API sdw::Vec3 castor3d::shader::LightingModel::combine ( BlendComponents const &  components,
sdw::Vec3 const &  incident,
sdw::Vec3 const &  directDiffuse,
sdw::Vec3 const &  indirectDiffuse,
sdw::Vec3 const &  directSpecular,
sdw::Vec3 const &  directScattering,
sdw::Vec3 const &  directCoatingSpecular,
sdw::Vec2 const &  directSheen,
sdw::Vec3 const &  indirectSpecular,
sdw::Vec3 const &  directAmbient,
sdw::Vec3 const &  indirectAmbient,
sdw::Float const &  ambientOcclusion,
sdw::Vec3 const &  emissive,
sdw::Vec3  reflectedDiffuse,
sdw::Vec3  reflectedSpecular,
sdw::Vec3  refracted,
sdw::Vec3  coatReflected,
sdw::Vec3  sheenReflected 
)

◆ combine() [2/2]

C3D_API sdw::Vec3 castor3d::shader::LightingModel::combine ( BlendComponents const &  components,
sdw::Vec3 const &  incident,
sdw::Vec3 const &  directDiffuse,
sdw::Vec3 const &  indirectDiffuse,
sdw::Vec3 const &  directSpecular,
sdw::Vec3 const &  directScattering,
sdw::Vec3 const &  directCoatingSpecular,
sdw::Vec2 const &  directSheen,
sdw::Vec3 const &  indirectSpecular,
sdw::Vec3 const &  directAmbient,
sdw::Vec3 const &  indirectAmbient,
sdw::Vec3  reflectedDiffuse,
sdw::Vec3  reflectedSpecular,
sdw::Vec3  refracted,
sdw::Vec3  coatReflected,
sdw::Vec3  sheenReflected 
)

◆ compute() [1/3]

virtual C3D_API void castor3d::shader::LightingModel::compute ( DirectionalLight const &  light,
BlendComponents const &  components,
Surface const &  surface,
BackgroundModel background,
sdw::Vec3 const &  worldEye,
sdw::UInt const &  receivesShadows,
OutputComponents output 
)
pure virtual

◆ compute() [2/3]

virtual C3D_API void castor3d::shader::LightingModel::compute ( PointLight const &  light,
BlendComponents const &  components,
Surface const &  surface,
sdw::Vec3 const &  worldEye,
sdw::UInt const &  receivesShadows,
OutputComponents output 
)
pure virtual

◆ compute() [3/3]

virtual C3D_API void castor3d::shader::LightingModel::compute ( SpotLight const &  light,
BlendComponents const &  components,
Surface const &  surface,
sdw::Vec3 const &  worldEye,
sdw::UInt const &  receivesShadows,
OutputComponents output 
)
pure virtual

◆ computeCombined()

C3D_API void castor3d::shader::LightingModel::computeCombined ( BlendComponents const &  components,
SceneData const &  sceneData,
BackgroundModel background,
Surface const &  surface,
sdw::Vec3 const &  worldEye,
sdw::UInt const &  receivesShadows,
OutputComponents output 
)

◆ computeCombinedDiffuse()

C3D_API sdw::Vec3 castor3d::shader::LightingModel::computeCombinedDiffuse ( BlendComponents const &  components,
SceneData const &  sceneData,
Surface const &  surface,
sdw::Vec3 const &  worldEye,
sdw::UInt const &  receivesShadows 
)

◆ computeDiffuse() [1/3]

virtual C3D_API sdw::Vec3 castor3d::shader::LightingModel::computeDiffuse ( DirectionalLight const &  light,
BlendComponents const &  components,
Surface const &  surface,
sdw::Vec3 const &  worldEye,
sdw::UInt const &  receivesShadows 
)
pure virtual

◆ computeDiffuse() [2/3]

virtual C3D_API sdw::Vec3 castor3d::shader::LightingModel::computeDiffuse ( PointLight const &  light,
BlendComponents const &  components,
Surface const &  surface,
sdw::Vec3 const &  worldEye,
sdw::UInt const &  receivesShadows 
)
pure virtual

◆ computeDiffuse() [3/3]

virtual C3D_API sdw::Vec3 castor3d::shader::LightingModel::computeDiffuse ( SpotLight const &  light,
BlendComponents const &  components,
Surface const &  surface,
sdw::Vec3 const &  worldEye,
sdw::UInt const &  receivesShadows 
)
pure virtual

◆ createDiffuseModel()

static C3D_API LightingModelPtr castor3d::shader::LightingModel::createDiffuseModel ( Engine const &  engine,
Materials const &  materials,
Utils utils,
BRDFHelpers brdf,
castor::String const &  name,
uint32_t  lightsBufBinding,
uint32_t  lightsBufSet,
ShadowOptions const &  shadows,
uint32_t &  shadowMapBinding,
uint32_t  shadowMapSet,
bool  enableVolumetric 
)
static

Référencé par createDiffuseModelT().

Voici le graphe des appelants de cette fonction :

◆ createDiffuseModelT()

template<typename LightsBufBindingT >
static LightingModelPtr castor3d::shader::LightingModel::createDiffuseModelT ( Engine const &  engine,
Materials const &  materials,
Utils utils,
BRDFHelpers brdf,
castor::String const &  name,
LightsBufBindingT  lightsBufBinding,
uint32_t  lightsBufSet,
ShadowOptions const &  shadows,
uint32_t &  shadowMapBinding,
uint32_t  shadowMapSet,
bool  enableVolumetric 
)
inlinestatic

Références createDiffuseModel().

Voici le graphe d'appel pour cette fonction :

◆ createModel() [1/2]

template<typename LightBindingT >
static LightingModelPtr castor3d::shader::LightingModel::createModel ( Engine const &  engine,
Materials const &  materials,
Utils utils,
BRDFHelpers brdf,
castor::String const &  name,
LightType  light,
LightBindingT  lightBinding,
uint32_t  lightSet,
bool  lightUbo,
ShadowOptions const &  shadows,
SssProfiles const *  sssProfiles,
uint32_t &  shadowMapBinding,
uint32_t  shadowMapSet 
)
inlinestatic

Références createModel().

Voici le graphe d'appel pour cette fonction :

◆ createModel() [2/2]

static C3D_API LightingModelPtr castor3d::shader::LightingModel::createModel ( Engine const &  engine,
Materials const &  materials,
Utils utils,
BRDFHelpers brdf,
castor::String const &  name,
uint32_t  lightsBufBinding,
uint32_t  lightsBufSet,
ShadowOptions const &  shadows,
SssProfiles const *  sssProfiles,
uint32_t &  shadowMapBinding,
uint32_t  shadowMapSet,
bool  enableVolumetric 
)
static

Référencé par createModel(), et createModelT().

Voici le graphe des appelants de cette fonction :

◆ createModelT()

template<typename LightsBufBindingT >
static LightingModelPtr castor3d::shader::LightingModel::createModelT ( Engine const &  engine,
Materials const &  materials,
Utils utils,
BRDFHelpers brdf,
castor::String const &  name,
LightsBufBindingT  lightsBufBinding,
uint32_t  lightsBufSet,
ShadowOptions const &  shadows,
SssProfiles const *  sssProfiles,
uint32_t &  shadowMapBinding,
uint32_t  shadowMapSet,
bool  enableVolumetric 
)
inlinestatic

Références createModel().

Voici le graphe d'appel pour cette fonction :

◆ declareDiffuseModel()

C3D_API void castor3d::shader::LightingModel::declareDiffuseModel ( uint32_t  lightsBufBinding,
uint32_t  lightsBufSet,
uint32_t &  shadowMapBinding,
uint32_t  shadowMapSet 
)

◆ declareDirectionalModel()

C3D_API void castor3d::shader::LightingModel::declareDirectionalModel ( bool  lightUbo,
uint32_t  lightBinding,
uint32_t  lightSet,
uint32_t &  shadowMapBinding,
uint32_t  shadowMapSet 
)

◆ declareModel()

C3D_API void castor3d::shader::LightingModel::declareModel ( uint32_t  lightsBufBinding,
uint32_t  lightsBufSet,
uint32_t &  shadowMapBinding,
uint32_t  shadowMapSet 
)

◆ declarePointModel()

C3D_API void castor3d::shader::LightingModel::declarePointModel ( bool  lightUbo,
uint32_t  lightBinding,
uint32_t  lightSet,
uint32_t &  shadowMapBinding,
uint32_t  shadowMapSet 
)

◆ declareSpotModel()

C3D_API void castor3d::shader::LightingModel::declareSpotModel ( bool  lightUbo,
uint32_t  lightBinding,
uint32_t  lightSet,
uint32_t &  shadowMapBinding,
uint32_t  shadowMapSet 
)

◆ doDeclareDirectionalLightUbo()

C3D_API void castor3d::shader::LightingModel::doDeclareDirectionalLightUbo ( uint32_t  binding,
uint32_t  set 
)
protected

◆ doDeclareGetBaseLight()

C3D_API void castor3d::shader::LightingModel::doDeclareGetBaseLight ( )
protected

◆ doDeclareGetCascadeFactors()

C3D_API void castor3d::shader::LightingModel::doDeclareGetCascadeFactors ( )
protected

◆ doDeclareGetDirectionalLight()

C3D_API void castor3d::shader::LightingModel::doDeclareGetDirectionalLight ( )
protected

◆ doDeclareGetPointLight()

C3D_API void castor3d::shader::LightingModel::doDeclareGetPointLight ( )
protected

◆ doDeclareGetSpotLight()

C3D_API void castor3d::shader::LightingModel::doDeclareGetSpotLight ( )
protected

◆ doDeclareLightsBuffer()

C3D_API void castor3d::shader::LightingModel::doDeclareLightsBuffer ( uint32_t  binding,
uint32_t  set 
)
protected

◆ doDeclarePointLightUbo()

C3D_API void castor3d::shader::LightingModel::doDeclarePointLightUbo ( uint32_t  binding,
uint32_t  set 
)
protected

◆ doDeclareSpotLightUbo()

C3D_API void castor3d::shader::LightingModel::doDeclareSpotLightUbo ( uint32_t  binding,
uint32_t  set 
)
protected

◆ getBaseLight()

C3D_API Light castor3d::shader::LightingModel::getBaseLight ( sdw::UInt &  offset) const
protected

◆ getDirectionalLight()

C3D_API DirectionalLight castor3d::shader::LightingModel::getDirectionalLight ( sdw::UInt const &  index) const

◆ getFinalTransmission()

virtual C3D_API sdw::Float castor3d::shader::LightingModel::getFinalTransmission ( BlendComponents const &  components,
sdw::Vec3 const &  incident 
)
pure virtual

◆ getPointLight()

C3D_API PointLight castor3d::shader::LightingModel::getPointLight ( sdw::UInt const &  index) const

◆ getReflectionModel()

virtual C3D_API ReflectionModelPtr castor3d::shader::LightingModel::getReflectionModel ( uint32_t &  envMapBinding,
uint32_t  envMapSet 
) const
pure virtual

◆ getShadowModel()

Shadow & castor3d::shader::LightingModel::getShadowModel ( ) const
inline

Références m_shadowModel.

◆ getSpotLight()

C3D_API SpotLight castor3d::shader::LightingModel::getSpotLight ( sdw::UInt const &  index) const

Documentation des données membres

◆ m_enableVolumetric

bool castor3d::shader::LightingModel::m_enableVolumetric
protected

◆ m_getBaseLight

sdw::Function< shader::Light , sdw::InOutUInt > castor3d::shader::LightingModel::m_getBaseLight
protected

◆ m_getCascadeFactors

sdw::Function< sdw::Vec3 , sdw::InVec3 , sdw::InVec4 , sdw::InUInt > castor3d::shader::LightingModel::m_getCascadeFactors
protected

◆ m_getDirectionalLight

sdw::Function< shader::DirectionalLight , sdw::InUInt > castor3d::shader::LightingModel::m_getDirectionalLight
protected

◆ m_getPointLight

sdw::Function< shader::PointLight , sdw::InUInt > castor3d::shader::LightingModel::m_getPointLight
protected

◆ m_getSpotLight

sdw::Function< shader::SpotLight , sdw::InUInt > castor3d::shader::LightingModel::m_getSpotLight
protected

◆ m_getTileFactors

sdw::Function< sdw::Vec3 , sdw::InVec3 , sdw::InVec4Array , sdw::InUInt > castor3d::shader::LightingModel::m_getTileFactors
protected

◆ m_materials

Materials const& castor3d::shader::LightingModel::m_materials
protected

◆ m_prefix

std::string castor3d::shader::LightingModel::m_prefix
protected

◆ m_shadowModel

std::shared_ptr< Shadow > castor3d::shader::LightingModel::m_shadowModel
protected

Référencé par getShadowModel().

◆ m_ssbo

std::unique_ptr< sdw::StorageBuffer > castor3d::shader::LightingModel::m_ssbo
protected

◆ m_sssTransmittance

std::shared_ptr< SssTransmittance > castor3d::shader::LightingModel::m_sssTransmittance
protected

◆ m_tbo

std::unique_ptr< sdw::RImageBufferRgba32 > castor3d::shader::LightingModel::m_tbo
protected

◆ m_type

std::unique_ptr< sdw::Struct > castor3d::shader::LightingModel::m_type
protected

◆ m_utils

Utils& castor3d::shader::LightingModel::m_utils
protected

◆ m_writer

sdw::ShaderWriter& castor3d::shader::LightingModel::m_writer
protected

La documentation de cette classe a été générée à partir du fichier suivant :