Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Public Member Functions | List of all members
GPUShaders::Common::Shadow_maps Class Reference

Shadow maps general shader. More...

Public Member Functions

float shadowBasic (vec3 lightSpacePosition, texture2DArray smap, uint layer, float bias)
 
float shadowBasicCube (vec3 lightToPosDir, textureCubeArray smap, uint layer, float farPlane, float bias)
 
float shadowPCF (vec3 lightSpacePosition, texture2DArray smap, uint layer, float bias)
 
vec3 cubemapToFaceIdAndUV (vec3 dir, out vec3 uDir, out vec3 vDir)
 
float shadowPCFCube (vec3 lightToPosDir, textureCubeArray smap, uint layer, float farPlane, float bias)
 
float shadowVSM (vec3 lightSpacePosition, texture2DArray smap, uint layer)
 
float shadowVSMCube (vec3 lightToPosDir, textureCubeArray smap, uint layer, float farPlane)
 
float shadow (uint mode, vec3 lightSpacePosition, texture2DArray smap, uint layer, float bias)
 
float shadowCube (uint mode, vec3 lightToPosDir, textureCubeArray smap, uint layer, float farPlane, float bias)
 

Detailed Description

Shadow maps general shader.

See also
GPUShaders::Common::Utils, GPUShaders::Common::Samplers

Member Function Documentation

◆ cubemapToFaceIdAndUV()

vec3 GPUShaders::Common::Shadow_maps::cubemapToFaceIdAndUV ( vec3  dir,
out vec3  uDir,
out vec3  vDir 
)
inline

Convert a unit direction to a cubemap face and local UVs

Parameters
dirthe direction to sample
uDirwill contain the axis corresponding to the U coordinate
vDirwill contain the axis corresponding to the V coordinate
Returns
the face index and the UV coordinates

◆ shadow()

float GPUShaders::Common::Shadow_maps::shadow ( uint  mode,
vec3  lightSpacePosition,
texture2DArray  smap,
uint  layer,
float  bias 
)
inline

Compute the lighting factor based on shadow map.

Parameters
modethe shadow mapping technique (basic or VSM)
lightSpacePositionfragment position in light space
smapthe shadow map
layerthe texture layer to read from
biasthe bias to apply
Returns
the lighting factor (0.0 = in shadow)

◆ shadowBasic()

float GPUShaders::Common::Shadow_maps::shadowBasic ( vec3  lightSpacePosition,
texture2DArray  smap,
uint  layer,
float  bias 
)
inline

Compute the lighting factor based on shadow map.

Parameters
lightSpacePositionfragment position in light space
smapthe shadow map
layerthe texture layer to read from
biasthe bias to apply
Returns
the lighting factor (0.0 = in shadow)

◆ shadowBasicCube()

float GPUShaders::Common::Shadow_maps::shadowBasicCube ( vec3  lightToPosDir,
textureCubeArray  smap,
uint  layer,
float  farPlane,
float  bias 
)
inline

Compute the lighting factor based on shadow map.

Parameters
lightToPosDirdirection from the light to the fragment position, in world space.
smapthe shadow cube map
layerthe texture layer to read from
farPlanedistance to the light projection far plane
biasthe bias to apply
Returns
the lighting factor (0.0 = in shadow)

◆ shadowCube()

float GPUShaders::Common::Shadow_maps::shadowCube ( uint  mode,
vec3  lightToPosDir,
textureCubeArray  smap,
uint  layer,
float  farPlane,
float  bias 
)
inline

Compute the lighting factor based on shadow map.

Parameters
modethe shadow mapping technique (basic or VSM)
lightToPosDirdirection from the light to the fragment position, in world space.
smapthe shadow cube map
layerthe texture layer to read from
farPlanedistance to the light projection far plane
biasthe bias to apply
Returns
the lighting factor (0.0 = in shadow)

◆ shadowPCF()

float GPUShaders::Common::Shadow_maps::shadowPCF ( vec3  lightSpacePosition,
texture2DArray  smap,
uint  layer,
float  bias 
)
inline

Compute the lighting factor based on shadow map.

Parameters
lightSpacePositionfragment position in light space
smapthe shadow map
layerthe texture layer to read from
biasthe bias to apply
Returns
the lighting factor (0.0 = in shadow)

◆ shadowPCFCube()

float GPUShaders::Common::Shadow_maps::shadowPCFCube ( vec3  lightToPosDir,
textureCubeArray  smap,
uint  layer,
float  farPlane,
float  bias 
)
inline

Compute the lighting factor based on shadow map.

Parameters
lightToPosDirdirection from the light to the fragment position, in world space.
smapthe shadow cube map
layerthe texture layer to read from
farPlanedistance to the light projection far plane
biasthe bias to apply
Returns
the lighting factor (0.0 = in shadow)

◆ shadowVSM()

float GPUShaders::Common::Shadow_maps::shadowVSM ( vec3  lightSpacePosition,
texture2DArray  smap,
uint  layer 
)
inline

Compute the lighting factor based on shadow map, using variance shadow mapping.

Parameters
lightSpacePositionfragment position in light space
smapthe shadow map
layerthe texture layer to read from
Returns
the lighting factor (0.0 = in shadow)

◆ shadowVSMCube()

float GPUShaders::Common::Shadow_maps::shadowVSMCube ( vec3  lightToPosDir,
textureCubeArray  smap,
uint  layer,
float  farPlane 
)
inline

Compute the lighting factor based on shadow map, using variance shadow mapping.

Parameters
lightToPosDirdirection from the light to the fragment position, in world space.
smapthe shadow cube map
layerthe texture layer to read from
farPlanedistance to the light projection far plane
Returns
the lighting factor (0.0 = in shadow)

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