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

#include <GlslPbrLighting.hpp>

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

Public Member Functions

C3D_API PbrLightingModel (LightingModelID lightingModelId, sdw::ShaderWriter &writer, Materials const &materials, Utils &utils, BRDFHelpers &brdf, Shadow &shadowModel, Lights &lights, bool enableVolumetric)
 
C3D_API void adjustDirectLighting (BlendComponents const &components, DirectLighting &lighting) const override
 
- Public Member Functions inherited from castor3d::shader::LightingModel
C3D_API LightingModel (LightingModelID lightingModelId, sdw::ShaderWriter &writer, Materials const &materials, Utils &utils, BRDFHelpers &brdf, Shadow &shadowModel, Lights &lights, bool hasIblSupport, bool enableVolumetric, castor::String prefix)
 
virtual C3D_API ~LightingModel ()=default
 
LightingModelID getLightingModelId () const
 
bool hasIblSupport () const
 
C3D_API void finish (PassShaders const &passShaders, DerivSurfaceBase const &surface, Utils &utils, sdw::Vec3 const worldEye, BlendComponents &components)
 
C3D_API sdw::Vec3 combine (DebugOutput &debugOutput, BlendComponents const &components, sdw::Vec3 const &incident, DirectLighting directLighting, IndirectLighting indirectLighting, 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 combine (DebugOutput &debugOutput, BlendComponents const &components, sdw::Vec3 const &incident, DirectLighting directLighting, IndirectLighting indirectLighting, sdw::Float const &ambientOcclusion, sdw::Vec3 const &emissive, sdw::Vec3 reflectedDiffuse, sdw::Vec3 reflectedSpecular, sdw::Vec3 refracted)
 
C3D_API void compute (DebugOutput &debugOutput, DirectionalLight const &light, BlendComponents const &components, BackgroundModel &background, LightSurface const &lightSurface, sdw::UInt const &receivesShadows, DirectLighting &output)
 
C3D_API void compute (DebugOutput &debugOutput, PointLight const &light, BlendComponents const &components, LightSurface const &lightSurface, sdw::UInt const &receivesShadows, DirectLighting &output)
 
C3D_API void compute (DebugOutput &debugOutput, SpotLight const &light, BlendComponents const &components, LightSurface const &lightSurface, sdw::UInt const &receivesShadows, DirectLighting &output)
 
C3D_API sdw::Vec3 computeDiffuse (DebugOutput &debugOutput, DirectionalLight const &light, BlendComponents const &components, BackgroundModel &background, LightSurface const &lightSurface, sdw::UInt const &receivesShadows)
 
C3D_API sdw::Vec3 computeDiffuse (DebugOutput &debugOutput, PointLight const &light, BlendComponents const &components, LightSurface const &lightSurface, sdw::UInt const &receivesShadows)
 
C3D_API sdw::Vec3 computeDiffuse (DebugOutput &debugOutput, SpotLight const &light, BlendComponents const &components, LightSurface const &lightSurface, sdw::UInt const &receivesShadows)
 
C3D_API void computeAllButDiffuse (DebugOutput &debugOutput, DirectionalLight const &light, BlendComponents const &components, BackgroundModel &background, LightSurface const &lightSurface, sdw::UInt const &receivesShadows, DirectLighting &output)
 
C3D_API void computeAllButDiffuse (DebugOutput &debugOutput, PointLight const &light, BlendComponents const &components, LightSurface const &lightSurface, sdw::UInt const &receivesShadows, DirectLighting &output)
 
C3D_API void computeAllButDiffuse (DebugOutput &debugOutput, SpotLight const &light, BlendComponents const &components, LightSurface const &lightSurface, sdw::UInt const &receivesShadows, DirectLighting &output)
 

Static Public Member Functions

static C3D_API castor::StringView getName ()
 
static C3D_API LightingModelUPtr create (LightingModelID lightingModelId, sdw::ShaderWriter &writer, Materials const &materials, Utils &utils, BRDFHelpers &brdf, Shadow &shadowModel, Lights &lights, bool enableVolumetric)
 

Public Attributes

CookTorranceBRDF m_cookTorrance
 
SheenBRDF m_sheen
 

Protected Member Functions

C3D_API void doFinish (PassShaders const &passShaders, BlendComponents &components) override
 
C3D_API sdw::Vec3 doComputeDiffuseTerm (sdw::Vec3 const &radiance, sdw::Float const &intensity, BlendComponents const &components, LightSurface const &lightSurface, sdw::Float &isLit, sdw::Vec3 output) override
 
C3D_API void doComputeSpecularTerm (sdw::Vec3 const &radiance, sdw::Float const &intensity, BlendComponents const &components, LightSurface const &lightSurface, sdw::Float const &isLit, sdw::Vec3 output) override
 
C3D_API void doComputeCoatingTerm (sdw::Vec3 const &radiance, sdw::Float const &intensity, BlendComponents const &components, LightSurface const &lightSurface, sdw::Float const &isLit, sdw::Vec3 output) override
 
C3D_API void doComputeSheenTerm (sdw::Vec3 const &radiance, sdw::Float const &intensity, BlendComponents const &components, LightSurface const &lightSurface, sdw::Float const &isLit, sdw::Vec2 output) override
 
C3D_API sdw::Vec3 doGetDiffuseBrdf (BlendComponents const &components, DirectLighting const &lighting, IndirectLighting const &indirect, sdw::Float const &ambientOcclusion, sdw::Vec3 const &reflectedDiffuse) override
 
C3D_API sdw::Vec3 doGetSpecularBrdf (BlendComponents const &components, DirectLighting const &lighting, IndirectLighting const &indirect, sdw::Float const &ambientOcclusion, sdw::Vec3 const &reflectedSpecular) override
 
- Protected Member Functions inherited from castor3d::shader::LightingModel
C3D_API void doAttenuate (sdw::Float const attenuation, DirectLighting &output, bool withDiffuse=true)
 
C3D_API void doApplyShadows (DirectionalShadowData const &light, sdw::Int const shadowMapIndex, sdw::Vec2 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)
 
C3D_API void doApplyVolumetric (ShadowData const &shadows, sdw::Int const shadowMapIndex, sdw::Vec2 const &lightIntensity, LightSurface const &lightSurface, sdw::Vec3 output, bool multiply)
 
virtual C3D_API void doInitialiseBackground (BackgroundModel &background)
 
virtual C3D_API sdw::Vec3 doComputeRadiance (Light const &light, sdw::Vec3 const &lightDirection) const
 
virtual C3D_API void doComputeScatteringTerm (ShadowData const &shadows, sdw::Int const shadowMapIndex, sdw::Vec3 const &radiance, sdw::Vec2 const &lightIntensity, BlendComponents const &components, LightSurface const &lightSurface, 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)
 

Additional Inherited Members

- Protected Attributes inherited from castor3d::shader::LightingModel
LightingModelID m_lightingModelId
 
sdw::ShaderWriter & m_writer
 
Materials const & m_materials
 
Utilsm_utils
 
Shadowm_shadowModel
 
Lightsm_lights
 
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
 

Constructor & Destructor Documentation

◆ PbrLightingModel()

C3D_API castor3d::shader::PbrLightingModel::PbrLightingModel ( LightingModelID lightingModelId,
sdw::ShaderWriter & writer,
Materials const & materials,
Utils & utils,
BRDFHelpers & brdf,
Shadow & shadowModel,
Lights & lights,
bool enableVolumetric )
explicit

Member Function Documentation

◆ adjustDirectLighting()

C3D_API void castor3d::shader::PbrLightingModel::adjustDirectLighting ( BlendComponents const & components,
DirectLighting & lighting ) const
overridevirtual

◆ create()

static C3D_API LightingModelUPtr castor3d::shader::PbrLightingModel::create ( LightingModelID lightingModelId,
sdw::ShaderWriter & writer,
Materials const & materials,
Utils & utils,
BRDFHelpers & brdf,
Shadow & shadowModel,
Lights & lights,
bool enableVolumetric )
static

◆ doComputeCoatingTerm()

C3D_API void castor3d::shader::PbrLightingModel::doComputeCoatingTerm ( sdw::Vec3 const & radiance,
sdw::Float const & intensity,
BlendComponents const & components,
LightSurface const & lightSurface,
sdw::Float const & isLit,
sdw::Vec3 output )
overrideprotectedvirtual

◆ doComputeDiffuseTerm()

C3D_API sdw::Vec3 castor3d::shader::PbrLightingModel::doComputeDiffuseTerm ( sdw::Vec3 const & radiance,
sdw::Float const & intensity,
BlendComponents const & components,
LightSurface const & lightSurface,
sdw::Float & isLit,
sdw::Vec3 output )
overrideprotectedvirtual

◆ doComputeSheenTerm()

C3D_API void castor3d::shader::PbrLightingModel::doComputeSheenTerm ( sdw::Vec3 const & radiance,
sdw::Float const & intensity,
BlendComponents const & components,
LightSurface const & lightSurface,
sdw::Float const & isLit,
sdw::Vec2 output )
overrideprotectedvirtual

Reimplemented from castor3d::shader::LightingModel.

◆ doComputeSpecularTerm()

C3D_API void castor3d::shader::PbrLightingModel::doComputeSpecularTerm ( sdw::Vec3 const & radiance,
sdw::Float const & intensity,
BlendComponents const & components,
LightSurface const & lightSurface,
sdw::Float const & isLit,
sdw::Vec3 output )
overrideprotectedvirtual

◆ doFinish()

C3D_API void castor3d::shader::PbrLightingModel::doFinish ( PassShaders const & passShaders,
BlendComponents & components )
overrideprotectedvirtual

◆ doGetDiffuseBrdf()

C3D_API sdw::Vec3 castor3d::shader::PbrLightingModel::doGetDiffuseBrdf ( BlendComponents const & components,
DirectLighting const & lighting,
IndirectLighting const & indirect,
sdw::Float const & ambientOcclusion,
sdw::Vec3 const & reflectedDiffuse )
overrideprotectedvirtual

◆ doGetSpecularBrdf()

C3D_API sdw::Vec3 castor3d::shader::PbrLightingModel::doGetSpecularBrdf ( BlendComponents const & components,
DirectLighting const & lighting,
IndirectLighting const & indirect,
sdw::Float const & ambientOcclusion,
sdw::Vec3 const & reflectedSpecular )
overrideprotectedvirtual

◆ getName()

static C3D_API castor::StringView castor3d::shader::PbrLightingModel::getName ( )
static

Member Data Documentation

◆ m_cookTorrance

CookTorranceBRDF castor3d::shader::PbrLightingModel::m_cookTorrance

◆ m_sheen

SheenBRDF castor3d::shader::PbrLightingModel::m_sheen

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