Castor3D 0.17.0
Multiplatform 3D engine
Public Member Functions | List of all members
castor3d::shader::LightingModel Class Referenceabstract

#include <GlslLighting.hpp>

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

Public Member Functions

C3D_API LightingModel (LightingModelID lightingModelId, sdw::ShaderWriter &writer, Materials const &materials, Utils &utils, BRDFHelpers &brdfHelpers, LightingModelSpec spec, Shadow &shadowModel, Lights &lights, bool hasIblSupport, bool hasBackgroundReflectionsSupport, bool hasBackgroundRefractionSupport, bool enableVolumetric, castor::String prefix)
 
virtual C3D_API ~LightingModel ()=default
 
LightingModelID getLightingModelId () const
 
bool hasIblSupport () const
 
bool hasBackgroundReflectionsSupport () const
 
bool hasBackgroundRefractionSupport () const
 
C3D_API sdw::Vec3 combine (DebugOutput &debugOutput, ReflectionModel &reflections, sdw::CombinedImage2DRgba32 const &brdf, BlendComponents const &components, LightSurface const &lightSurface, sdw::Vec3 const &incident, sdw::Float const &ambientOcclusion, DirectLighting const &directLighting, IndirectLighting const &indirectLighting, ReflectionRefraction const &reflRefr)
 

Diffuse + Specular

C3D_API void compute (DebugOutputCategory const &debugOutput, DirectionalLight const &light, BlendComponents const &components, BackgroundModel &background, LightSurface const &lightSurface, sdw::UInt const &receivesShadows, DirectLighting &output)
 
C3D_API void compute (DebugOutputCategory const &debugOutput, PointLight const &light, BlendComponents const &components, LightSurface const &lightSurface, sdw::UInt const &receivesShadows, DirectLighting &output)
 
C3D_API void compute (DebugOutputCategory const &debugOutput, SpotLight const &light, BlendComponents const &components, LightSurface const &lightSurface, sdw::UInt const &receivesShadows, DirectLighting &output)
 

Diffuse only

C3D_API sdw::Vec3 computeDiffuse (DebugOutputCategory const &debugOutput, DirectionalLight const &light, BlendComponents const &components, BackgroundModel &background, LightSurface const &lightSurface, sdw::UInt const &receivesShadows)
 
C3D_API sdw::Vec3 computeDiffuse (DebugOutputCategory const &debugOutput, PointLight const &light, BlendComponents const &components, LightSurface const &lightSurface, sdw::UInt const &receivesShadows)
 
C3D_API sdw::Vec3 computeDiffuse (DebugOutputCategory const &debugOutput, SpotLight const &light, BlendComponents const &components, LightSurface const &lightSurface, sdw::UInt const &receivesShadows)
 

All but diffuse

LightingModelID m_lightingModelId
 
sdw::ShaderWriter & m_writer
 
Materials const & m_materials
 
Utilsm_utils
 
BRDFHelpersm_brdfHelpers
 
Shadowm_shadowModel
 
Lightsm_lights
 
DiffuseBRDFPtr m_diffuse
 
SpecularBRDFPtr m_specular
 
SheenBRDFPtr m_sheen
 
ClearcoatBRDFPtr m_clearcoat
 
ScatteringModelPtr m_scattering
 
bool m_hasBackgroundReflectionsSupport
 
bool m_hasBackgroundRefractionSupport
 
bool m_hasIblSupport
 
bool m_enableVolumetric
 
castor::String m_prefix
 
castor::RawUniquePtr< sdw::Struct > m_type
 
castor::RawUniquePtr< sdw::UInt > m_directionalCascadeIndex
 
castor::RawUniquePtr< sdw::UInt > m_directionalCascadeCount
 
castor::RawUniquePtr< sdw::Mat4 > m_directionalTransform
 
sdw::Function< sdw::Void, PDirectionalLight, InBlendComponents, InLightSurface, sdw::InUInt, InOutDirectLighting > m_computeDirectional
 
sdw::Function< sdw::Void, PPointLight, InBlendComponents, InLightSurface, sdw::InUInt, InOutDirectLighting > m_computePoint
 
sdw::Function< sdw::Void, PSpotLight, InBlendComponents, InLightSurface, sdw::InUInt, InOutDirectLighting > m_computeSpot
 
sdw::Function< sdw::Vec3, InOutDirectionalLight, InBlendComponents, InLightSurface, sdw::InUInt > m_computeDirectionalDiffuse
 
sdw::Function< sdw::Vec3, InOutPointLight, InBlendComponents, InLightSurface, sdw::InUInt > m_computePointDiffuse
 
sdw::Function< sdw::Vec3, InOutSpotLight, InBlendComponents, InLightSurface, sdw::InUInt > m_computeSpotDiffuse
 
sdw::Function< sdw::Void, PDirectionalLight, InBlendComponents, InLightSurface, sdw::InUInt, InOutDirectLighting > m_computeDirectionalAllButDiffuse
 
sdw::Function< sdw::Void, PPointLight, InBlendComponents, InLightSurface, sdw::InUInt, InOutDirectLighting > m_computePointAllButDiffuse
 
sdw::Function< sdw::Void, PSpotLight, InBlendComponents, InLightSurface, sdw::InUInt, InOutDirectLighting > m_computeSpotAllButDiffuse
 
C3D_API void computeAllButDiffuse (DebugOutputCategory const &debugOutput, DirectionalLight const &light, BlendComponents const &components, BackgroundModel &background, LightSurface const &lightSurface, sdw::UInt const &receivesShadows, DirectLighting &output)
 
C3D_API void computeAllButDiffuse (DebugOutputCategory const &debugOutput, PointLight const &light, BlendComponents const &components, LightSurface const &lightSurface, sdw::UInt const &receivesShadows, DirectLighting &output)
 
C3D_API void computeAllButDiffuse (DebugOutputCategory const &debugOutput, SpotLight const &light, BlendComponents const &components, LightSurface const &lightSurface, sdw::UInt const &receivesShadows, DirectLighting &output)
 
C3D_API void applyVolumetric (ShadowData const &shadows, sdw::Int const shadowMapIndex, sdw::Float const &lightIntensity, LightSurface const &lightSurface, sdw::Vec3 output, bool multiply)
 
C3D_API void doApplyShadows (DirectionalShadowData const &light, sdw::Int const shadowMapIndex, sdw::Float const &lightIntensity, LightSurface const &lightSurface, sdw::Vec3 const &radiance, sdw::UInt const &receivesShadows, DirectLighting &output, bool withDiffuse=true)
 
C3D_API void doApplyShadows (PointShadowData const &light, sdw::Int const shadowMapIndex, sdw::Float const lightRange, LightSurface const &lightSurface, sdw::Vec3 const &radiance, sdw::UInt const &receivesShadows, DirectLighting &output, bool withDiffuse=true)
 
C3D_API void doApplyShadows (SpotShadowData const &light, sdw::Int const shadowMapIndex, sdw::Float const lightRange, LightSurface const &lightSurface, sdw::Vec3 const &radiance, sdw::UInt const &receivesShadows, DirectLighting &output, bool withDiffuse=true)
 
C3D_API void doApplyShadowsDiffuse (DirectionalShadowData const &light, sdw::Int const shadowMapIndex, LightSurface const &lightSurface, sdw::Vec3 const &radiance, sdw::UInt const &receivesShadows, sdw::Vec3 &output)
 
C3D_API void doApplyShadowsDiffuse (PointShadowData const &light, sdw::Int const shadowMapIndex, sdw::Float const lightRange, LightSurface const &lightSurface, sdw::Vec3 const &radiance, sdw::UInt const &receivesShadows, sdw::Vec3 &output)
 
C3D_API void doApplyShadowsDiffuse (SpotShadowData const &light, sdw::Int const shadowMapIndex, sdw::Float const lightRange, LightSurface const &lightSurface, sdw::Vec3 const &radiance, sdw::UInt const &receivesShadows, sdw::Vec3 &output)
 
virtual C3D_API void doInitLightSpecifics (LightSurface const &lightSurface, BlendComponents const &components)
 
virtual C3D_API DerivFloat doGetNdotL (LightSurface const &lightSurface, BlendComponents const &components)
 
virtual C3D_API DerivFloat doGetNdotH (LightSurface const &lightSurface, BlendComponents const &components)
 
virtual C3D_API void doComputeBackgroundLayers (DebugOutputCategory const &debugOutput, BlendComponents const &components, ReflectionRefraction const &reflRefr, sdw::Vec3 const &clearcoatFresnel, sdw::Vec3 &backgroundResult)
 

Constructor & Destructor Documentation

◆ LightingModel()

C3D_API castor3d::shader::LightingModel::LightingModel ( LightingModelID lightingModelId,
sdw::ShaderWriter & writer,
Materials const & materials,
Utils & utils,
BRDFHelpers & brdfHelpers,
LightingModelSpec spec,
Shadow & shadowModel,
Lights & lights,
bool hasIblSupport,
bool hasBackgroundReflectionsSupport,
bool hasBackgroundRefractionSupport,
bool enableVolumetric,
castor::String prefix )

◆ ~LightingModel()

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

Member Function Documentation

◆ applyVolumetric()

C3D_API void castor3d::shader::LightingModel::applyVolumetric ( ShadowData const & shadows,
sdw::Int const shadowMapIndex,
sdw::Float const & lightIntensity,
LightSurface const & lightSurface,
sdw::Vec3 output,
bool multiply )

◆ combine()

C3D_API sdw::Vec3 castor3d::shader::LightingModel::combine ( DebugOutput & debugOutput,
ReflectionModel & reflections,
sdw::CombinedImage2DRgba32 const & brdf,
BlendComponents const & components,
LightSurface const & lightSurface,
sdw::Vec3 const & incident,
sdw::Float const & ambientOcclusion,
DirectLighting const & directLighting,
IndirectLighting const & indirectLighting,
ReflectionRefraction const & reflRefr )

◆ compute() [1/3]

C3D_API void castor3d::shader::LightingModel::compute ( DebugOutputCategory const & debugOutput,
DirectionalLight const & light,
BlendComponents const & components,
BackgroundModel & background,
LightSurface const & lightSurface,
sdw::UInt const & receivesShadows,
DirectLighting & output )

◆ compute() [2/3]

C3D_API void castor3d::shader::LightingModel::compute ( DebugOutputCategory const & debugOutput,
PointLight const & light,
BlendComponents const & components,
LightSurface const & lightSurface,
sdw::UInt const & receivesShadows,
DirectLighting & output )

◆ compute() [3/3]

C3D_API void castor3d::shader::LightingModel::compute ( DebugOutputCategory const & debugOutput,
SpotLight const & light,
BlendComponents const & components,
LightSurface const & lightSurface,
sdw::UInt const & receivesShadows,
DirectLighting & output )

◆ computeAllButDiffuse() [1/3]

C3D_API void castor3d::shader::LightingModel::computeAllButDiffuse ( DebugOutputCategory const & debugOutput,
DirectionalLight const & light,
BlendComponents const & components,
BackgroundModel & background,
LightSurface const & lightSurface,
sdw::UInt const & receivesShadows,
DirectLighting & output )

◆ computeAllButDiffuse() [2/3]

C3D_API void castor3d::shader::LightingModel::computeAllButDiffuse ( DebugOutputCategory const & debugOutput,
PointLight const & light,
BlendComponents const & components,
LightSurface const & lightSurface,
sdw::UInt const & receivesShadows,
DirectLighting & output )

◆ computeAllButDiffuse() [3/3]

C3D_API void castor3d::shader::LightingModel::computeAllButDiffuse ( DebugOutputCategory const & debugOutput,
SpotLight const & light,
BlendComponents const & components,
LightSurface const & lightSurface,
sdw::UInt const & receivesShadows,
DirectLighting & output )

◆ computeDiffuse() [1/3]

C3D_API sdw::Vec3 castor3d::shader::LightingModel::computeDiffuse ( DebugOutputCategory const & debugOutput,
DirectionalLight const & light,
BlendComponents const & components,
BackgroundModel & background,
LightSurface const & lightSurface,
sdw::UInt const & receivesShadows )

◆ computeDiffuse() [2/3]

C3D_API sdw::Vec3 castor3d::shader::LightingModel::computeDiffuse ( DebugOutputCategory const & debugOutput,
PointLight const & light,
BlendComponents const & components,
LightSurface const & lightSurface,
sdw::UInt const & receivesShadows )

◆ computeDiffuse() [3/3]

C3D_API sdw::Vec3 castor3d::shader::LightingModel::computeDiffuse ( DebugOutputCategory const & debugOutput,
SpotLight const & light,
BlendComponents const & components,
LightSurface const & lightSurface,
sdw::UInt const & receivesShadows )

◆ doApplyShadows() [1/3]

C3D_API void castor3d::shader::LightingModel::doApplyShadows ( DirectionalShadowData const & light,
sdw::Int const shadowMapIndex,
sdw::Float const & lightIntensity,
LightSurface const & lightSurface,
sdw::Vec3 const & radiance,
sdw::UInt const & receivesShadows,
DirectLighting & output,
bool withDiffuse = true )
protected

◆ doApplyShadows() [2/3]

C3D_API void castor3d::shader::LightingModel::doApplyShadows ( PointShadowData const & light,
sdw::Int const shadowMapIndex,
sdw::Float const lightRange,
LightSurface const & lightSurface,
sdw::Vec3 const & radiance,
sdw::UInt const & receivesShadows,
DirectLighting & output,
bool withDiffuse = true )
protected

◆ doApplyShadows() [3/3]

C3D_API void castor3d::shader::LightingModel::doApplyShadows ( SpotShadowData const & light,
sdw::Int const shadowMapIndex,
sdw::Float const lightRange,
LightSurface const & lightSurface,
sdw::Vec3 const & radiance,
sdw::UInt const & receivesShadows,
DirectLighting & output,
bool withDiffuse = true )
protected

◆ doApplyShadowsDiffuse() [1/3]

C3D_API void castor3d::shader::LightingModel::doApplyShadowsDiffuse ( DirectionalShadowData const & light,
sdw::Int const shadowMapIndex,
LightSurface const & lightSurface,
sdw::Vec3 const & radiance,
sdw::UInt const & receivesShadows,
sdw::Vec3 & output )
protected

◆ doApplyShadowsDiffuse() [2/3]

C3D_API void castor3d::shader::LightingModel::doApplyShadowsDiffuse ( PointShadowData const & light,
sdw::Int const shadowMapIndex,
sdw::Float const lightRange,
LightSurface const & lightSurface,
sdw::Vec3 const & radiance,
sdw::UInt const & receivesShadows,
sdw::Vec3 & output )
protected

◆ doApplyShadowsDiffuse() [3/3]

C3D_API void castor3d::shader::LightingModel::doApplyShadowsDiffuse ( SpotShadowData const & light,
sdw::Int const shadowMapIndex,
sdw::Float const lightRange,
LightSurface const & lightSurface,
sdw::Vec3 const & radiance,
sdw::UInt const & receivesShadows,
sdw::Vec3 & output )
protected

◆ doComputeBackgroundLayers()

virtual C3D_API void castor3d::shader::LightingModel::doComputeBackgroundLayers ( DebugOutputCategory const & debugOutput,
BlendComponents const & components,
ReflectionRefraction const & reflRefr,
sdw::Vec3 const & clearcoatFresnel,
sdw::Vec3 & backgroundResult )
protectedvirtual

◆ doGetNdotH()

virtual C3D_API DerivFloat castor3d::shader::LightingModel::doGetNdotH ( LightSurface const & lightSurface,
BlendComponents const & components )
protectedvirtual

◆ doGetNdotL()

virtual C3D_API DerivFloat castor3d::shader::LightingModel::doGetNdotL ( LightSurface const & lightSurface,
BlendComponents const & components )
protectedvirtual

◆ doInitLightSpecifics()

virtual C3D_API void castor3d::shader::LightingModel::doInitLightSpecifics ( LightSurface const & lightSurface,
BlendComponents const & components )
protectedvirtual

◆ getLightingModelId()

LightingModelID castor3d::shader::LightingModel::getLightingModelId ( ) const
inline

References m_lightingModelId.

◆ hasBackgroundReflectionsSupport()

bool castor3d::shader::LightingModel::hasBackgroundReflectionsSupport ( ) const
inline

◆ hasBackgroundRefractionSupport()

bool castor3d::shader::LightingModel::hasBackgroundRefractionSupport ( ) const
inline

◆ hasIblSupport()

bool castor3d::shader::LightingModel::hasIblSupport ( ) const
inline

References m_hasIblSupport.

Member Data Documentation

◆ m_brdfHelpers

BRDFHelpers& castor3d::shader::LightingModel::m_brdfHelpers
protected

◆ m_clearcoat

ClearcoatBRDFPtr castor3d::shader::LightingModel::m_clearcoat
protected

◆ m_computeDirectional

sdw::Function< sdw::Void , PDirectionalLight , InBlendComponents , InLightSurface , sdw::InUInt , InOutDirectLighting > castor3d::shader::LightingModel::m_computeDirectional
protected

◆ m_computeDirectionalAllButDiffuse

sdw::Function< sdw::Void , PDirectionalLight , InBlendComponents , InLightSurface , sdw::InUInt , InOutDirectLighting > castor3d::shader::LightingModel::m_computeDirectionalAllButDiffuse
protected

◆ m_computeDirectionalDiffuse

sdw::Function< sdw::Vec3 , InOutDirectionalLight , InBlendComponents , InLightSurface , sdw::InUInt > castor3d::shader::LightingModel::m_computeDirectionalDiffuse
protected

◆ m_computePoint

sdw::Function< sdw::Void , PPointLight , InBlendComponents , InLightSurface , sdw::InUInt , InOutDirectLighting > castor3d::shader::LightingModel::m_computePoint
protected

◆ m_computePointAllButDiffuse

sdw::Function< sdw::Void , PPointLight , InBlendComponents , InLightSurface , sdw::InUInt , InOutDirectLighting > castor3d::shader::LightingModel::m_computePointAllButDiffuse
protected

◆ m_computePointDiffuse

sdw::Function< sdw::Vec3 , InOutPointLight , InBlendComponents , InLightSurface , sdw::InUInt > castor3d::shader::LightingModel::m_computePointDiffuse
protected

◆ m_computeSpot

sdw::Function< sdw::Void , PSpotLight , InBlendComponents , InLightSurface , sdw::InUInt , InOutDirectLighting > castor3d::shader::LightingModel::m_computeSpot
protected

◆ m_computeSpotAllButDiffuse

sdw::Function< sdw::Void , PSpotLight , InBlendComponents , InLightSurface , sdw::InUInt , InOutDirectLighting > castor3d::shader::LightingModel::m_computeSpotAllButDiffuse
protected

◆ m_computeSpotDiffuse

sdw::Function< sdw::Vec3 , InOutSpotLight , InBlendComponents , InLightSurface , sdw::InUInt > castor3d::shader::LightingModel::m_computeSpotDiffuse
protected

◆ m_diffuse

DiffuseBRDFPtr castor3d::shader::LightingModel::m_diffuse
protected

◆ m_directionalCascadeCount

castor::RawUniquePtr< sdw::UInt > castor3d::shader::LightingModel::m_directionalCascadeCount
protected

◆ m_directionalCascadeIndex

castor::RawUniquePtr< sdw::UInt > castor3d::shader::LightingModel::m_directionalCascadeIndex
protected

◆ m_directionalTransform

castor::RawUniquePtr< sdw::Mat4 > castor3d::shader::LightingModel::m_directionalTransform
protected

◆ m_enableVolumetric

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

◆ m_hasBackgroundReflectionsSupport

bool castor3d::shader::LightingModel::m_hasBackgroundReflectionsSupport
protected

◆ m_hasBackgroundRefractionSupport

bool castor3d::shader::LightingModel::m_hasBackgroundRefractionSupport
protected

◆ m_hasIblSupport

bool castor3d::shader::LightingModel::m_hasIblSupport
protected

Referenced by hasIblSupport().

◆ m_lightingModelId

LightingModelID castor3d::shader::LightingModel::m_lightingModelId
protected

Referenced by getLightingModelId().

◆ m_lights

Lights& castor3d::shader::LightingModel::m_lights
protected

◆ m_materials

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

◆ m_prefix

castor::String castor3d::shader::LightingModel::m_prefix
protected

◆ m_scattering

ScatteringModelPtr castor3d::shader::LightingModel::m_scattering
protected

◆ m_shadowModel

Shadow& castor3d::shader::LightingModel::m_shadowModel
protected

◆ m_sheen

SheenBRDFPtr castor3d::shader::LightingModel::m_sheen
protected

◆ m_specular

SpecularBRDFPtr castor3d::shader::LightingModel::m_specular
protected

◆ m_type

castor::RawUniquePtr< 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

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