API Documentation
Static Public Member Functions | List of all members
nkAstraeus::ShadowMappingLib Class Referencefinal

Shader program helping sources for shadow mapping. More...

Static Public Member Functions

static nkMemory::StringView nkShadowMap ()
 

Detailed Description

Shader program helping sources for shadow mapping.

Member Function Documentation

◆ nkShadowMap()

static nkMemory::StringView nkAstraeus::ShadowMappingLib::nkShadowMap ( )
static
float nkShadowMap (nkTexture2dShadow lightDepthMap, nkSamplerComparison s, nkFloat4 worldPosition, nkFloat4x4 lightViewProjectionMatrix, nkInt2 lightDepthMapDimensions) ;


Method computing if a pixel is within light or shadow, given a light depth map, where :

Parameter Description
lightDepthMap Depth map of the light to be tested against.
s Sampler to be used for sampling the light map. Usually using the COMPARISON_LESS comparison function.
worldPosition The position in world coordinates of the pixel to evaluate for.
lightViewProjectionMatrix The (projection * view) matrix for the camera that generated the depth map.
lightDepthMapDimensions The lightDepthMap's dimensions (w x h).
Returns
If the pixel is detected as lit, 1.0. Otherwise, 0.0.


In addition to these runtime parameters, compile time defines allow to customize the behaviour of the method :

Define Description
NK_SHADOW_MAP_METHOD_BIAS Number allowing to overwrite the bias applied to the recomputed depth. Defaults to 0.0001.
NK_SHADOW_MAP_METHOD_DEBUG_OOB If defined, then out of light depth's texture bounds will return 0. If defined, such cases will return 1.
NK_SHADOW_MAP_METHOD_PCF_4_TAP If defined, percentage closer filtering will be enabled with 4 taps.
NK_SHADOW_MAP_METHOD_PCF_9_TAP If defined, percentage closer filtering will be enabled with 9 taps.
NK_SHADOW_MAP_METHOD_PCF_16_TAP If defined, percentage closer filtering will be enabled with 16 taps.
Returns
The source for the method described.

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