Shaders for Shadows
Shader code for rendering shadows of translucent occluders, soft shadows and single scattering with moment shadow maps.
|
#include "ShadowUtility.fx"
#include "TrigonometricMomentProblemShadow.fx"
#include "RandomNumbers.fx"
Go to the source code of this file.
Functions | |
void | ComputeFragmentDepth (out float OutFragmentDepth, float4 ProjectionSpacePosition) |
void | ComputeShadowMapDepth (out float OutShadowMapDepth, float FragmentDepth) |
void | CombineVectorWithAlpha_float1 (out float4 OutVectorWithAlpha, float Vector, float Alpha) |
void | CombineVectorWithAlpha_float2 (out float4 OutVectorWithAlpha, float2 Vector, float Alpha) |
void | CombineVectorWithAlpha_float3 (out float4 OutVectorWithAlpha, float3 Vector, float Alpha) |
void | CombineVectorWithAlpha_float4 (out float4 OutVectorWithAlpha, float4 Vector) |
void | ConvertShadowIntensityToColor (out float4 OutColor, float ShadowIntensity) |
void | ComputeMomentVectorExponential (out float OutExponential, float FragmentDepth, float Factor=80.0f) |
void | ComputeMomentVectorFourier8 (out float4 OutFourier1_2, out float4 OutFourier3_4, out float4 OutFourier5_6, out float4 OutFourier7_8, float FragmentDepth) |
void | ComputeMomentVectorFourier16 (out float4 OutFourier1_2, out float4 OutFourier3_4, out float4 OutFourier5_6, out float4 OutFourier7_8, out float4 OutFourier9_10, out float4 OutFourier11_12, out float4 OutFourier13_14, out float4 OutFourier15_16, float FragmentDepth) |
void | ComputeTrigonometricMomentVector (out float4 OutFourier1_2, float FragmentDepth) |
void | ComputeExponentialVarianceVector (out float4 OutDepthExponentialVariance, float FragmentDepth, float2 ExponentialVarianceFactors) |
void | ComputeExponentialVarianceVectorSplit (out float2 OutDepthExponentialVariance0, out float2 OutDepthExponentialVariance1, float FragmentDepth, float2 ExponentialVarianceFactors) |
void | ComputeMomentVector2Moments_float2 (out float2 Out2Moments_float2, float FragmentDepth) |
void | ComputeMomentVector4Moments_float4 (out float4 Out4Moments_float4, float FragmentDepth) |
void | ComputeMomentVector4MomentsOptimized_float4 (out float4 Out4MomentsOptimized_float4, float FragmentDepth) |
void | ComputeMomentVector4Moments_float2_float2 (out float2 Out4Moments0_float2, out float2 Out4Moments1_float2, float FragmentDepth) |
void | ComputeMomentVector4MomentsOptimized_float2_float2 (out float2 Out4MomentsOptimized0_float2, out float2 Out4MomentsOptimized1_float2, float FragmentDepth) |
void | ComputeDirectionalLightCamera (out float4x4 OutViewToWorldSpace, out float4x4 OutViewToProjectionSpace, float3 WorldSpaceBoundingBoxMin, float3 WorldSpaceBoundingBoxMax, float3 WorldSpaceLightDirection) |
void | ComputeSpotLightCamera (out float4x4 OutViewToWorldSpace, out float4x4 OutViewToProjectionSpace, float3 WorldSpaceLightPosition, float3 WorldSpaceConeAxisDirection, float OuterConeAngle, float NearClippingPlane, float FarClippingPlane) |
void | ComputeShadowMapCoordinate (out float2 OutShadowMapTexCoord, out float OutShadowMapDepth, float4 ShadowMapProjectionSpacePosition, float4 ShadowMapSize) |
void | ComputeWorldSpacePositionUnderCursor (out float3 OutWorldSpacePosition, Texture2DMS< float, 1 > SceneDepthTexture, float4 SceneDepthTextureSize, int2 iCursorPosition, float4x4 CameraProjectionToWorldSpace) |
void | HeavisideStepFunction (out float OutShadowIntensity, float BlockerDepth, float FragmentDepth) |
void | SampleShadowMap (out float OutShadowMapDepth, SSamplerTexturePair2D_float ShadowMapSampler, float2 ShadowMapTexCoord) |
void | SampleExponentialVarianceShadowMap (out float4 OutExponentialVarianceVector, SSamplerTexturePair2D ExponentialVarianceShadowMapSampler0, float2 ShadowMapTexCoord) |
void | SampleExponentialVarianceSplitShadowMap (out float4 OutExponentialVarianceVector, SSamplerTexturePair2D_float2 ExponentialVarianceShadowMapSampler0, SSamplerTexturePair2D_float2 ExponentialVarianceShadowMapSampler1, float2 ShadowMapTexCoord) |
void | SampleExponentialShadowMap (out float OutExponentialShadowMap, SSamplerTexturePair2D_float ExponentialShadowMapSampler, float2 ShadowMapTexCoord) |
void | SampleConvolutionShadowMap8 (out float2 pOutFourierCoefficient[8], SSamplerTexturePair2D ConvolutionShadowMapSampler0, SSamplerTexturePair2D ConvolutionShadowMapSampler1, SSamplerTexturePair2D ConvolutionShadowMapSampler2, SSamplerTexturePair2D ConvolutionShadowMapSampler3, float2 ShadowMapTexCoord) |
void | SampleConvolutionShadowMap16 (out float2 pOutFourierCoefficient[16], SSamplerTexturePair2D ConvolutionShadowMapSampler0, SSamplerTexturePair2D ConvolutionShadowMapSampler1, SSamplerTexturePair2D ConvolutionShadowMapSampler2, SSamplerTexturePair2D ConvolutionShadowMapSampler3, SSamplerTexturePair2D ConvolutionShadowMapSampler4, SSamplerTexturePair2D ConvolutionShadowMapSampler5, SSamplerTexturePair2D ConvolutionShadowMapSampler6, SSamplerTexturePair2D ConvolutionShadowMapSampler7, float2 ShadowMapTexCoord) |
void | Sample2TMSMShadowMap (out float2 pOutFourierCoefficient[2], SSamplerTexturePair2D _2TMSMShadowMapSampler, float2 ShadowMapTexCoord) |
void | Sample2MomentShadowMap (out float2 OutBiased2Moments, SSamplerTexturePair2D_float2 _2MomentShadowMapSampler, float2 ShadowMapTexCoord, float MomentBias=0.0f) |
void | Convert2MomentToCanonical (out float2 OutBiased2Moments, float2 Moments0, float MomentBias=0.0f) |
void | Sample4MomentShadowMap (out float4 OutBiased4Moments, SSamplerTexturePair2D _4MomentShadowMapSampler, float2 ShadowMapTexCoord, float MomentBias=3.0e-7f) |
void | Sample4MomentOptimizedShadowMap (out float4 OutBiased4Moments, SSamplerTexturePair2D _4MomentOptimizedShadowMapSampler, float2 ShadowMapTexCoord, float MomentBias=6.0e-5f) |
void | Sample4MomentSplitShadowMap (out float4 OutBiased4Moments, SSamplerTexturePair2D_float2 _4MomentShadowMapSampler0, SSamplerTexturePair2D_float2 _4MomentShadowMapSampler1, float2 ShadowMapTexCoord, float MomentBias=3.0e-7f) |
void | Sample4MomentOptimizedSplitShadowMap (out float4 OutBiased4Moments, SSamplerTexturePair2D_float2 _4MomentOptimizedShadowMapSampler0, SSamplerTexturePair2D_float2 _4MomentOptimizedShadowMapSampler1, float2 ShadowMapTexCoord, float MomentBias=6.0e-5f) |
void | Convert4MomentToCanonical (out float4 OutBiased4Moments, float4 Moments0, float MomentBias=3.0e-7f) |
void | ConvertSplit4MomentToCanonical (out float4 OutBiased4Moments, float2 Moments0, float2 Moments1, float MomentBias=3.0e-7f) |
void | Convert4MomentOptimizedToCanonical (out float4 OutBiased4Moments, float4 OptimizedMoments0, float MomentBias=6.0e-5f) |
void | ConvertSplit4MomentOptimizedToCanonical (out float4 OutBiased4Moments, float2 OptimizedMoments0, float2 OptimizedMoments1, float MomentBias=6.0e-5f) |
void | ScaleShadowIntensity (out float OutShadowIntensity, float ShadowIntensity, float ShadowIntensityFactor, float2 ShadowMapTexCoord, float FragmentDepth) |
void | ComputeHardShadowIntensity (out float OutShadowIntensity, float SampledShadowMapDepth, float FragmentDepth, float DepthBias) |
void | ComputePCFShadowIntensity1x1 (out float OutShadowIntensity, SSamplerTexturePair2D_float ShadowMapSampler, float2 ShadowMapTexCoord, float FragmentDepth, float4 ShadowMapSize, float DepthBias) |
void | ComputePCFShadowIntensity5x5 (out float OutShadowIntensity, SSamplerTexturePair2D_float ShadowMapSampler, float2 ShadowMapTexCoord, float FragmentDepth, float4 ShadowMapSize, float DepthBias) |
void | ComputePCFShadowIntensity7x7 (out float OutShadowIntensity, SSamplerTexturePair2D_float ShadowMapSampler, float2 ShadowMapTexCoord, float FragmentDepth, float4 ShadowMapSize, float DepthBias) |
void | ComputePCFShadowIntensity9x9 (out float OutShadowIntensity, SSamplerTexturePair2D_float ShadowMapSampler, float2 ShadowMapTexCoord, float FragmentDepth, float4 ShadowMapSize, float DepthBias) |
void | ComputePCFShadowIntensity15x15 (out float OutShadowIntensity, SSamplerTexturePair2D_float ShadowMapSampler, float2 ShadowMapTexCoord, float FragmentDepth, float4 ShadowMapSize, float DepthBias) |
void | ComputePCFShadowIntensityPoisson (out float OutShadowIntensity, SSamplerTexturePair2D_float ShadowMapSampler, float2 ShadowMapTexCoord, float FragmentDepth, float4 ShadowMapSize, float DepthBias, float KernelDiameter) |
void | ComputeExponentialShadowIntensity (out float OutShadowIntensity, float ExponentialShadowMapSample, float FragmentDepth, float DepthBias, float Factor=80.0f) |
void | ComputeConvolutionShadowIntensity8 (out float OutShadowIntensity, float2 pFourierCoefficient[8], float FragmentDepth, float DepthBias) |
void | ComputeConvolutionShadowIntensity16 (out float OutShadowIntensity, float2 pFourierCoefficient[16], float FragmentDepth, float DepthBias) |
void | ComputeExponentialVarianceShadowIntensity (out float OutShadowIntensity, float4 ExponentialVarianceVector, float FragmentDepth, float DepthBias, float2 ExponentialVarianceFactors) |
void | Compute2MomentShadowIntensity (out float OutShadowIntensity, float2 Biased2Moments, float FragmentDepth, float DepthBias) |
void | Compute4MomentShadowIntensity (out float OutShadowIntensity, float4 Biased4Moments, float FragmentDepth, float DepthBias) |
void | Compute4MomentUnboundedShadowIntensity (out float OutShadowIntensity, float4 Biased4Moments, float FragmentDepth, float DepthBias) |
void | Compute2TMSMShadowIntensity (out float OutShadowIntensity, float2 pFourierCoefficient[2], float FragmentDepth, float DepthBias, float MomentBias) |
void | ApplyGaussianFilterHorizontal5_float4 (out float4 OutFilteredValue, SSamplerTexturePair2D SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterVertical5_float4 (out float4 OutFilteredValue, SSamplerTexturePair2D SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterHorizontal7_float4 (out float4 OutFilteredValue, SSamplerTexturePair2D SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterVertical7_float4 (out float4 OutFilteredValue, SSamplerTexturePair2D SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterHorizontal9_float4 (out float4 OutFilteredValue, SSamplerTexturePair2D SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterVertical9_float4 (out float4 OutFilteredValue, SSamplerTexturePair2D SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterHorizontal15_float4 (out float4 OutFilteredValue, SSamplerTexturePair2D SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterVertical15_float4 (out float4 OutFilteredValue, SSamplerTexturePair2D SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterHorizontal5_float2 (out float4 OutFilteredValue, SSamplerTexturePair2D_float2 SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterVertical5_float2 (out float4 OutFilteredValue, SSamplerTexturePair2D_float2 SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterHorizontal7_float2 (out float4 OutFilteredValue, SSamplerTexturePair2D_float2 SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterVertical7_float2 (out float4 OutFilteredValue, SSamplerTexturePair2D_float2 SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterHorizontal9_float2 (out float4 OutFilteredValue, SSamplerTexturePair2D_float2 SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterVertical9_float2 (out float4 OutFilteredValue, SSamplerTexturePair2D_float2 SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterHorizontal15_float2 (out float4 OutFilteredValue, SSamplerTexturePair2D_float2 SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterVertical15_float2 (out float4 OutFilteredValue, SSamplerTexturePair2D_float2 SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterHorizontal5_float (out float4 OutFilteredValue, SSamplerTexturePair2D_float SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterVertical5_float (out float4 OutFilteredValue, SSamplerTexturePair2D_float SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterHorizontal7_float (out float4 OutFilteredValue, SSamplerTexturePair2D_float SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterVertical7_float (out float4 OutFilteredValue, SSamplerTexturePair2D_float SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterHorizontal9_float (out float4 OutFilteredValue, SSamplerTexturePair2D_float SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterVertical9_float (out float4 OutFilteredValue, SSamplerTexturePair2D_float SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterHorizontal15_float (out float4 OutFilteredValue, SSamplerTexturePair2D_float SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyGaussianFilterVertical15_float (out float4 OutFilteredValue, SSamplerTexturePair2D_float SourceSampler, float2 TexCoord, float4 TextureSize) |
void | ApplyPrefixSumHorizontal_float4 (inout RWTexture2D< float4 > OutFilteredTexture, SSamplerTexturePair2D SourceSampler, uint3 ThreadID) |
void | ApplyPrefixSumVertical_float4 (inout RWTexture2D< float4 > OutFilteredTexture, SSamplerTexturePair2D SourceSampler, uint3 ThreadID) |
void | ApplyPrefixSumHorizontal_uint4 (inout RWTexture2D< uint4 > OutFilteredTexture, SSamplerTexturePair2D SourceSampler, uint3 ThreadID, float2 FixedPrecision) |
void | ApplyPrefixSumVertical_uint4 (inout RWTexture2D< uint4 > OutFilteredTexture, SSamplerTexturePair2D_uint4 SourceSampler, uint3 ThreadID) |
void | ApplyPrefixSumHorizontal_float2 (inout RWTexture2D< float2 > OutFilteredTexture, SSamplerTexturePair2D_float2 SourceSampler, uint3 ThreadID) |
void | ApplyPrefixSumVertical_float2 (inout RWTexture2D< float2 > OutFilteredTexture, SSamplerTexturePair2D_float2 SourceSampler, uint3 ThreadID) |
void | ApplyPrefixSumHorizontal_uint2 (inout RWTexture2D< uint2 > OutFilteredTexture, SSamplerTexturePair2D_float2 SourceSampler, uint3 ThreadID, float2 FixedPrecision) |
void | ApplyPrefixSumVertical_uint2 (inout RWTexture2D< uint2 > OutFilteredTexture, SSamplerTexturePair2D_uint2 SourceSampler, uint3 ThreadID) |
void | ApplyPrefixSumHorizontal_half4 (inout RWTexture2D< half4 > OutFilteredTexture, SSamplerTexturePair2D SourceSampler, uint3 ThreadID) |
void | ApplyPrefixSumVertical_half4 (inout RWTexture2D< half4 > OutFilteredTexture, SSamplerTexturePair2D SourceSampler, uint3 ThreadID) |
void | GetSummedAreaTableThreadGroupCount (out uint3 nOutThreadGroupHorizontal, out uint3 nOutThreadGroupVertical, uint3 ThreadGroupSizeHorizontal, uint3 ThreadGroupSizeVertical, float4 TextureSize) |
void | ComputeRectangleAverage_uint4 (out float4 OutAverageValue, float2 LeftTop, float2 RightBottom, SSamplerTexturePair2D_uint4 SummedAreaTableSampler, float4 TextureSize, float2 FixedPrecision) |
void | ComputeIntegerRectangleAverage_uint4 (out float4 OutAverageValue, float2 LeftTop, float2 RightBottom, SSamplerTexturePair2D_uint4 SummedAreaTableSampler, float4 TextureSize, float2 FixedPrecision) |
void | ComputeRectangleAverage_float4 (out float4 OutAverageValue, float2 LeftTop, float2 RightBottom, SSamplerTexturePair2D SummedAreaTableSampler, float4 TextureSize) |
void | ComputeRectangleAverage_uint2 (out float2 OutAverageValue, float2 LeftTop, float2 RightBottom, SSamplerTexturePair2D_uint2 SummedAreaTableSampler, float4 TextureSize, float2 FixedPrecision) |
void | ComputeIntegerRectangleAverage_uint2 (out float2 OutAverageValue, float2 LeftTop, float2 RightBottom, SSamplerTexturePair2D_uint2 SummedAreaTableSampler, float4 TextureSize, float2 FixedPrecision) |
void | ComputeRectangleAverage_float2 (out float2 OutAverageValue, float2 LeftTop, float2 RightBottom, SSamplerTexturePair2D_float2 SummedAreaTableSampler, float4 TextureSize) |
void | ComputeFixedPrecision (out float2 OutFixedPrecision, float3x2 KernelSizeParameter, float2 ShadowMapSize) |
void | GetBlockerSearchRectangle (out float2 OutSearchRegionLeftTop, out float2 OutSearchRegionRightBottom, float2 SearchRegionCenter, float3x2 KernelSizeParameter, float4 ShadowMapSize) |
void | GetShadowFilterRectangle (out float2 OutFilterRegionLeftTop, out float2 OutFilterRegionRightBottom, float2 FilterRegionCenter, float2 KernelSize) |
void | EstimatePenumbraSize (out float2 OutKernelSize, out float OutDepthBias, float OccluderDepth, float FragmentDepth, float3x2 LightParameter, float3x2 KernelSizeParameter, float MaxDepthBias) |
void | ComputeDirectionalLightSoftShadowParameters (out float3x2 OutLightParameter, float4x4 ViewToProjectionSpace, float2 LightSourceAngle) |
void | Compute2MomentAverageBlockerDepth (out float OutAverageBlockerDepth, out float OutBlockerSearchShadowIntensity, float2 BlockerSearchBiased2Moments, float FragmentDepth, float DepthBias) |
void | Compute4MomentAverageBlockerDepth (out float OutAverageBlockerDepth, out float OutBlockerSearchShadowIntensity, float4 BlockerSearchBiased4Moments, float FragmentDepth) |
void | ComputePCSSAverageBlockerDepth (out float OutAverageBlockerDepth, out float OutBlockerSearchShadowIntensity, SSamplerTexturePair2D_float ShadowMapSampler, float2 ShadowMapTexCoord, float FragmentDepth, float4 ShadowMapSize, float DepthBias, float3x2 KernelSizeParameter) |
void | PickShadowIntensity (out float OutShadowIntensity, float FilteredShadowIntensity, float BlockerSearchShadowIntensity) |
void | ComputeIntegerPCSSShadowIntensity (out float OutShadowIntensity, SSamplerTexturePair2D_float ShadowMapSampler, float2 FilterRegionLeftTop, float2 FilterRegionRightBottom, float FragmentDepth, float4 ShadowMapSize, float DepthBias) |
void | ComputePCSSShadowIntensity (out float OutShadowIntensity, float BlockerSearchShadowIntensity, SSamplerTexturePair2D_float ShadowMapSampler, float2 FilterRegionLeftTop, float2 FilterRegionRightBottom, float FragmentDepth, float4 ShadowMapSize, float DepthBias) |
void | LoadDepthSample1 (out float OutDepthSample, Texture2DMS< float, 1 > ShadowMap, float2 TexCoord, uint SampleIndex, float4 ShadowMapSize) |
void | LoadDepthSample2 (out float OutDepthSample, Texture2DMS< float, 2 > ShadowMap, float2 TexCoord, uint SampleIndex, float4 ShadowMapSize) |
void | LoadDepthSample4 (out float OutDepthSample, Texture2DMS< float, 4 > ShadowMap, float2 TexCoord, uint SampleIndex, float4 ShadowMapSize) |
void | LoadDepthSample8 (out float OutDepthSample, Texture2DMS< float, 8 > ShadowMap, float2 TexCoord, uint SampleIndex, float4 ShadowMapSize) |
void | AddShadowMapData_float (out float OutSum, float LHS, float RHS) |
void | AddShadowMapData_float2 (out float2 OutSum, float2 LHS, float2 RHS) |
void | AddShadowMapData_float4 (out float4 OutSum, float4 LHS, float4 RHS) |
void | AddShadowMapData_uint2 (out uint2 OutSum, uint2 LHS, uint2 RHS) |
void | AddShadowMapData_uint4 (out uint4 OutSum, uint4 LHS, uint4 RHS) |
void | AddShadowMapData_half4 (out half4 OutSum, half4 LHS, half4 RHS) |
void | ComputeSampleAverage_float (out float OutSampleAverage, float SampleSum, uint nSample) |
void | ComputeSampleAverage_float2 (out float2 OutSampleAverage, float2 SampleSum, uint nSample) |
void | ComputeSampleAverage_float4 (out float4 OutSampleAverage, float4 SampleSum, uint nSample) |
void | ComputeSampleAverage_uint2 (out uint2 OutSampleAverage, uint2 SampleSum, uint nSample) |
void | ComputeSampleAverage_uint4 (out uint4 OutSampleAverage, uint4 SampleSum, uint nSample) |
void | ComputeSampleAverage_half4 (out half4 OutSampleAverage, half4 SampleSum, uint nSample) |
Provides function definitions for all available shadow mapping techniques. This includes parametrization, generation, post-processing and usage of shadow maps.
Definition in file Shadow.fx.
void AddShadowMapData_float | ( | out float | OutSum, |
float | LHS, | ||
float | RHS | ||
) |
void ApplyGaussianFilterHorizontal15_float | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Horizontal Gaussian filter with standard deviation 4.3 and kernel size 15.
void ApplyGaussianFilterHorizontal15_float2 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float2 | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Horizontal Gaussian filter with standard deviation 4.3 and kernel size 15.
void ApplyGaussianFilterHorizontal15_float4 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Horizontal Gaussian filter with standard deviation 4.3 and kernel size 15.
void ApplyGaussianFilterHorizontal5_float | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Horizontal Gaussian filter with standard deviation 1.2 and kernel size 5.
void ApplyGaussianFilterHorizontal5_float2 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float2 | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Horizontal Gaussian filter with standard deviation 1.2 and kernel size 5.
void ApplyGaussianFilterHorizontal5_float4 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
This function can be used to filter a texture using a horizontal Gaussian with standard deviation 1.2, cut off to obtain a 5-texel kernel.
OutFilteredValue | The weighted sum of the values in the kernel. |
SourceSampler | A sampler for the texture to be filtered, which uses bilinear interpolation. |
TexCoord | A grid-aligned texture coordinate, i.e. its x-coordinate is a multiple of TextureSize.z and its y-coordinate is a multiple of TextureSize.w. |
TextureSize | The source texture size in x and y and its reciproque in z and w. |
void ApplyGaussianFilterHorizontal7_float | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Horizontal Gaussian filter with standard deviation 1.8 and kernel size 7.
void ApplyGaussianFilterHorizontal7_float2 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float2 | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Horizontal Gaussian filter with standard deviation 1.8 and kernel size 7.
void ApplyGaussianFilterHorizontal7_float4 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Horizontal Gaussian filter with standard deviation 1.8 and kernel size 7.
void ApplyGaussianFilterHorizontal9_float | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Horizontal Gaussian filter with standard deviation 2.4 and kernel size 9.
void ApplyGaussianFilterHorizontal9_float2 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float2 | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Horizontal Gaussian filter with standard deviation 2.4 and kernel size 9.
void ApplyGaussianFilterHorizontal9_float4 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Horizontal Gaussian filter with standard deviation 2.4 and kernel size 9.
void ApplyGaussianFilterVertical15_float | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Vertical Gaussian filter with standard deviation 4.3 and kernel size 15.
void ApplyGaussianFilterVertical15_float2 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float2 | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Vertical Gaussian filter with standard deviation 4.3 and kernel size 15.
void ApplyGaussianFilterVertical15_float4 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Vertical Gaussian filter with standard deviation 4.3 and kernel size 15.
void ApplyGaussianFilterVertical5_float | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Vertical Gaussian filter with standard deviation 1.2 and kernel size 5.
void ApplyGaussianFilterVertical5_float2 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float2 | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Vertical Gaussian filter with standard deviation 1.2 and kernel size 5.
void ApplyGaussianFilterVertical5_float4 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Vertical Gaussian filter with standard deviation 1.2 and kernel size 5.
void ApplyGaussianFilterVertical7_float | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Vertical Gaussian filter with standard deviation 1.8 and kernel size 7.
void ApplyGaussianFilterVertical7_float2 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float2 | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Vertical Gaussian filter with standard deviation 1.8 and kernel size 7.
void ApplyGaussianFilterVertical7_float4 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Vertical Gaussian filter with standard deviation 1.8 and kernel size 7.
void ApplyGaussianFilterVertical9_float | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Vertical Gaussian filter with standard deviation 2.4 and kernel size 9.
void ApplyGaussianFilterVertical9_float2 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D_float2 | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Vertical Gaussian filter with standard deviation 2.4 and kernel size 9.
void ApplyGaussianFilterVertical9_float4 | ( | out float4 | OutFilteredValue, |
SSamplerTexturePair2D | SourceSampler, | ||
float2 | TexCoord, | ||
float4 | TextureSize | ||
) |
Vertical Gaussian filter with standard deviation 2.4 and kernel size 9.
void ApplyPrefixSumHorizontal_float2 | ( | inout RWTexture2D< float2 > | OutFilteredTexture, |
SSamplerTexturePair2D_float2 | SourceSampler, | ||
uint3 | ThreadID | ||
) |
Like ApplyPrefixSumHorizontal_float4() but operates on two channel textures.
void ApplyPrefixSumHorizontal_float4 | ( | inout RWTexture2D< float4 > | OutFilteredTexture, |
SSamplerTexturePair2D | SourceSampler, | ||
uint3 | ThreadID | ||
) |
Generates horizontal prefix sums of the given source texture and stores them in the given output texture.
OutFilteredTexture | The texture which is to be overwritten by prefix sums. |
SourceSampler | A texture and sampler providing access to the texture for which prefix sums are to be generated. It must have the same dimensions as the output texture. |
ThreadID | The y component of this vector indicates the row on which to operate. |
void ApplyPrefixSumHorizontal_half4 | ( | inout RWTexture2D< half4 > | OutFilteredTexture, |
SSamplerTexturePair2D | SourceSampler, | ||
uint3 | ThreadID | ||
) |
Like ApplyPrefixSumHorizontal_float4() but operates on four channel textures with half precision entries.
void ApplyPrefixSumHorizontal_uint2 | ( | inout RWTexture2D< uint2 > | OutFilteredTexture, |
SSamplerTexturePair2D_float2 | SourceSampler, | ||
uint3 | ThreadID, | ||
float2 | FixedPrecision | ||
) |
Like ApplyPrefixSumHorizontal_float4() but operates on two channel textures with 32-bit unsigned integers.
void ApplyPrefixSumHorizontal_uint4 | ( | inout RWTexture2D< uint4 > | OutFilteredTexture, |
SSamplerTexturePair2D | SourceSampler, | ||
uint3 | ThreadID, | ||
float2 | FixedPrecision | ||
) |
Like ApplyPrefixSumHorizontal_float4() but operates on four channel textures with 32-bit unsigned integers.
void ApplyPrefixSumVertical_float2 | ( | inout RWTexture2D< float2 > | OutFilteredTexture, |
SSamplerTexturePair2D_float2 | SourceSampler, | ||
uint3 | ThreadID | ||
) |
Like ApplyPrefixSumVertical_float4() but operates on two channel textures.
void ApplyPrefixSumVertical_float4 | ( | inout RWTexture2D< float4 > | OutFilteredTexture, |
SSamplerTexturePair2D | SourceSampler, | ||
uint3 | ThreadID | ||
) |
void ApplyPrefixSumVertical_half4 | ( | inout RWTexture2D< half4 > | OutFilteredTexture, |
SSamplerTexturePair2D | SourceSampler, | ||
uint3 | ThreadID | ||
) |
Like ApplyPrefixSumVertical_float4() but operates on four channel textures with half precision entries.
void ApplyPrefixSumVertical_uint2 | ( | inout RWTexture2D< uint2 > | OutFilteredTexture, |
SSamplerTexturePair2D_uint2 | SourceSampler, | ||
uint3 | ThreadID | ||
) |
Like ApplyPrefixSumVertical_float4() but operates on two channel textures with 32-bit unsigned integers.
void ApplyPrefixSumVertical_uint4 | ( | inout RWTexture2D< uint4 > | OutFilteredTexture, |
SSamplerTexturePair2D_uint4 | SourceSampler, | ||
uint3 | ThreadID | ||
) |
Like ApplyPrefixSumVertical_float4() but operates on four channel textures with 32-bit unsigned integers.
void CombineVectorWithAlpha_float1 | ( | out float4 | OutVectorWithAlpha, |
float | Vector, | ||
float | Alpha | ||
) |
void CombineVectorWithAlpha_float2 | ( | out float4 | OutVectorWithAlpha, |
float2 | Vector, | ||
float | Alpha | ||
) |
void CombineVectorWithAlpha_float3 | ( | out float4 | OutVectorWithAlpha, |
float3 | Vector, | ||
float | Alpha | ||
) |
void CombineVectorWithAlpha_float4 | ( | out float4 | OutVectorWithAlpha, |
float4 | Vector | ||
) |
void Compute2MomentAverageBlockerDepth | ( | out float | OutAverageBlockerDepth, |
out float | OutBlockerSearchShadowIntensity, | ||
float2 | BlockerSearchBiased2Moments, | ||
float | FragmentDepth, | ||
float | DepthBias | ||
) |
This function estimates the average depth of fragments in a filter region which are less than FragmentDepth-DepthBias and outputs it. This is done using two moments of the shadow map depth within this filter region.
OutBlockerSearchShadowIntensity | See ComputePCSSAverageBlockerDepth(). |
void Compute2MomentShadowIntensity | ( | out float | OutShadowIntensity, |
float2 | Biased2Moments, | ||
float | FragmentDepth, | ||
float | DepthBias | ||
) |
Given a sampled value from a two-moment shadow map (i.e. a variance shadow map) and a computed shadow map depth for a point at the same location this function outputs 1.0, if the fragment is in shadow 0.0f, if the fragment is lit and an intermediate value for partial shadow.
void Compute2TMSMShadowIntensity | ( | out float | OutShadowIntensity, |
float2 | pFourierCoefficient[2], | ||
float | FragmentDepth, | ||
float | DepthBias, | ||
float | MomentBias | ||
) |
Given a sampled value from a trigonometric moment shadow map providing two complex Fourier coefficients and a computed shadow map depth for a point at the same location this function outputs 1.0, if the fragment is in shadow 0.0f, if the fragment is lit and an intermediate value for partial shadow. The returned value is an optimal lower bound.
void Compute4MomentAverageBlockerDepth | ( | out float | OutAverageBlockerDepth, |
out float | OutBlockerSearchShadowIntensity, | ||
float4 | BlockerSearchBiased4Moments, | ||
float | FragmentDepth | ||
) |
This function estimates the average depth of fragments in a filter region which are less than FragmentDepth-DepthBias and outputs it. This is done using four moments of the shadow map depth within this filter region.
OutBlockerSearchShadowIntensity | See ComputePCSSAverageBlockerDepth(). |
void Compute4MomentShadowIntensity | ( | out float | OutShadowIntensity, |
float4 | Biased4Moments, | ||
float | FragmentDepth, | ||
float | DepthBias | ||
) |
Given a sampled value from a four-moment shadow map and a computed shadow map depth for a point at the same location this function outputs 1.0, if the fragment is in shadow 0.0f, if the fragment is lit and an intermediate value for partial shadow. The returned value is an optimal lower bound.
void Compute4MomentUnboundedShadowIntensity | ( | out float | OutShadowIntensity, |
float4 | Biased4Moments, | ||
float | FragmentDepth, | ||
float | DepthBias | ||
) |
Given a sampled value from a four-moment shadow map and a computed shadow map depth for a point at the same location this function outputs 1.0, if the fragment is in shadow 0.0f, if the fragment is lit and an intermediate value for partial shadow. The returned value is an optimal lower bound except for the fact that it does not exploit the knowledge that the original distribution has support in [0,1].
void ComputeConvolutionShadowIntensity16 | ( | out float | OutShadowIntensity, |
float2 | pFourierCoefficient[16], | ||
float | FragmentDepth, | ||
float | DepthBias | ||
) |
Like ComputeConvolutionShadowIntensity8() but for 16 Fourier coefficients.
void ComputeConvolutionShadowIntensity8 | ( | out float | OutShadowIntensity, |
float2 | pFourierCoefficient[8], | ||
float | FragmentDepth, | ||
float | DepthBias | ||
) |
void ComputeDirectionalLightCamera | ( | out float4x4 | OutViewToWorldSpace, |
out float4x4 | OutViewToProjectionSpace, | ||
float3 | WorldSpaceBoundingBoxMin, | ||
float3 | WorldSpaceBoundingBoxMax, | ||
float3 | WorldSpaceLightDirection | ||
) |
This function computes the transformations for a shadow map camera for a directional light such that the given axis-aligned world-space bounding box is contained in its frustum.
void ComputeDirectionalLightSoftShadowParameters | ( | out float3x2 | OutLightParameter, |
float4x4 | ViewToProjectionSpace, | ||
float2 | LightSourceAngle | ||
) |
Computes LightParameter as expected by EstimatePenumbraSize() for a directional light.
OutLightParameter | The light parameters as expected by EstimatePenumbraSize(). |
ViewToProjectionSpace | The projection matrix used for the shadow map of the directional light. |
LightSourceAngle | The angle spanned by the directional light across the hemisphere along the two directions corresponding to rows and columns in the shadow map. |
void ComputeExponentialShadowIntensity | ( | out float | OutShadowIntensity, |
float | ExponentialShadowMapSample, | ||
float | FragmentDepth, | ||
float | DepthBias, | ||
float | Factor = 80.0f |
||
) |
void ComputeExponentialVarianceShadowIntensity | ( | out float | OutShadowIntensity, |
float4 | ExponentialVarianceVector, | ||
float | FragmentDepth, | ||
float | DepthBias, | ||
float2 | ExponentialVarianceFactors | ||
) |
void ComputeExponentialVarianceVector | ( | out float4 | OutDepthExponentialVariance, |
float | FragmentDepth, | ||
float2 | ExponentialVarianceFactors | ||
) |
void ComputeExponentialVarianceVectorSplit | ( | out float2 | OutDepthExponentialVariance0, |
out float2 | OutDepthExponentialVariance1, | ||
float | FragmentDepth, | ||
float2 | ExponentialVarianceFactors | ||
) |
void ComputeFixedPrecision | ( | out float2 | OutFixedPrecision, |
float3x2 | KernelSizeParameter, | ||
float2 | ShadowMapSize | ||
) |
This function computes factors that define how much precision is to be used for moments stored in integers. It chooses the precision such that adding up all the integer moments within a kernel of the specified maximal size will not overflow a 32-bit unsigned integer.
OutFixedPrecision | x holds a factor by which values between zero and one have to be multiplied to convert them to the unsigned integer representation with fixed precision. y holds the reciprocal of x. |
KernelSizeParameter | See EstimatePenumbraSize(). |
ShadowMapSize | The size of the shadow map KernelSizeParameter refers to in x and y. |
void ComputeFragmentDepth | ( | out float | OutFragmentDepth, |
float4 | ProjectionSpacePosition | ||
) |
void ComputeHardShadowIntensity | ( | out float | OutShadowIntensity, |
float | SampledShadowMapDepth, | ||
float | FragmentDepth, | ||
float | DepthBias | ||
) |
void ComputeIntegerPCSSShadowIntensity | ( | out float | OutShadowIntensity, |
SSamplerTexturePair2D_float | ShadowMapSampler, | ||
float2 | FilterRegionLeftTop, | ||
float2 | FilterRegionRightBottom, | ||
float | FragmentDepth, | ||
float4 | ShadowMapSize, | ||
float | DepthBias | ||
) |
This function evaluates percentage closer filtering for a rectangular kernel with the given dynamically computed corners (in texture coordinates). Texture coordinates are rounded to the texel grid such that texels contribute either entirely or not at all. In this sense there is no interpoltion. SampleCmp() is used to quarter the number of required samples.
void ComputeIntegerRectangleAverage_uint2 | ( | out float2 | OutAverageValue, |
float2 | LeftTop, | ||
float2 | RightBottom, | ||
SSamplerTexturePair2D_uint2 | SummedAreaTableSampler, | ||
float4 | TextureSize, | ||
float2 | FixedPrecision | ||
) |
Like ComputeIntegerRectangleAverage_uint4() but for two-channel textures.
void ComputeIntegerRectangleAverage_uint4 | ( | out float4 | OutAverageValue, |
float2 | LeftTop, | ||
float2 | RightBottom, | ||
SSamplerTexturePair2D_uint4 | SummedAreaTableSampler, | ||
float4 | TextureSize, | ||
float2 | FixedPrecision | ||
) |
Like ComputeRectangleAverage_uint4() but without interpolation. The result refers to a modified version of the given rectangle where corner points have been rounded to the pixel grid. This is substantially faster.
void ComputeMomentVector2Moments_float2 | ( | out float2 | Out2Moments_float2, |
float | FragmentDepth | ||
) |
void ComputeMomentVector4Moments_float2_float2 | ( | out float2 | Out4Moments0_float2, |
out float2 | Out4Moments1_float2, | ||
float | FragmentDepth | ||
) |
Given a scalar this function outputs two vectors consisting of the first, second, third and fourth power of this scalar. Splitting it up into two vectors (and two textures) is useful if the alpha channel is needed for alpha blending.
void ComputeMomentVector4Moments_float4 | ( | out float4 | Out4Moments_float4, |
float | FragmentDepth | ||
) |
void ComputeMomentVector4MomentsOptimized_float2_float2 | ( | out float2 | Out4MomentsOptimized0_float2, |
out float2 | Out4MomentsOptimized1_float2, | ||
float | FragmentDepth | ||
) |
Given a scalar this function outputs a vector consisting of the first, second, third and fourth power of this scalar linearly transformed using an optimized basis for optimal quantization. The output is split up into two vectors as with ComputeMomentVector4Moments_float2_float2.
void ComputeMomentVector4MomentsOptimized_float4 | ( | out float4 | Out4MomentsOptimized_float4, |
float | FragmentDepth | ||
) |
void ComputeMomentVectorExponential | ( | out float | OutExponential, |
float | FragmentDepth, | ||
float | Factor = 80.0f |
||
) |
void ComputeMomentVectorFourier16 | ( | out float4 | OutFourier1_2, |
out float4 | OutFourier3_4, | ||
out float4 | OutFourier5_6, | ||
out float4 | OutFourier7_8, | ||
out float4 | OutFourier9_10, | ||
out float4 | OutFourier11_12, | ||
out float4 | OutFourier13_14, | ||
out float4 | OutFourier15_16, | ||
float | FragmentDepth | ||
) |
void ComputeMomentVectorFourier8 | ( | out float4 | OutFourier1_2, |
out float4 | OutFourier3_4, | ||
out float4 | OutFourier5_6, | ||
out float4 | OutFourier7_8, | ||
float | FragmentDepth | ||
) |
void ComputePCFShadowIntensity15x15 | ( | out float | OutShadowIntensity, |
SSamplerTexturePair2D_float | ShadowMapSampler, | ||
float2 | ShadowMapTexCoord, | ||
float | FragmentDepth, | ||
float4 | ShadowMapSize, | ||
float | DepthBias | ||
) |
Performs bilinearly filtered PCF using standard deviation 4.3 and a kernel of size 15*15.
void ComputePCFShadowIntensity1x1 | ( | out float | OutShadowIntensity, |
SSamplerTexturePair2D_float | ShadowMapSampler, | ||
float2 | ShadowMapTexCoord, | ||
float | FragmentDepth, | ||
float4 | ShadowMapSize, | ||
float | DepthBias | ||
) |
Performs bilinearly filtered PCF using standard deviation 0.0 and a kernel of size 1*1.
void ComputePCFShadowIntensity5x5 | ( | out float | OutShadowIntensity, |
SSamplerTexturePair2D_float | ShadowMapSampler, | ||
float2 | ShadowMapTexCoord, | ||
float | FragmentDepth, | ||
float4 | ShadowMapSize, | ||
float | DepthBias | ||
) |
Performs bilinearly filtered PCF using standard deviation 1.2 and a kernel of size 5*5.
void ComputePCFShadowIntensity7x7 | ( | out float | OutShadowIntensity, |
SSamplerTexturePair2D_float | ShadowMapSampler, | ||
float2 | ShadowMapTexCoord, | ||
float | FragmentDepth, | ||
float4 | ShadowMapSize, | ||
float | DepthBias | ||
) |
Performs bilinearly filtered PCF using standard deviation 1.8 and a kernel of size 7*7.
void ComputePCFShadowIntensity9x9 | ( | out float | OutShadowIntensity, |
SSamplerTexturePair2D_float | ShadowMapSampler, | ||
float2 | ShadowMapTexCoord, | ||
float | FragmentDepth, | ||
float4 | ShadowMapSize, | ||
float | DepthBias | ||
) |
Performs bilinearly filtered PCF using standard deviation 2.4 and a kernel of size 9*9.
void ComputePCFShadowIntensityPoisson | ( | out float | OutShadowIntensity, |
SSamplerTexturePair2D_float | ShadowMapSampler, | ||
float2 | ShadowMapTexCoord, | ||
float | FragmentDepth, | ||
float4 | ShadowMapSize, | ||
float | DepthBias, | ||
float | KernelDiameter | ||
) |
Performs bilinearly filtered PCF using a hard-coded, randomly rotated Poisson disk sampling.
void ComputePCSSAverageBlockerDepth | ( | out float | OutAverageBlockerDepth, |
out float | OutBlockerSearchShadowIntensity, | ||
SSamplerTexturePair2D_float | ShadowMapSampler, | ||
float2 | ShadowMapTexCoord, | ||
float | FragmentDepth, | ||
float4 | ShadowMapSize, | ||
float | DepthBias, | ||
float3x2 | KernelSizeParameter | ||
) |
This function computes the average depth of fragments in a filter region which are less than FragmentDepth-DepthBias and outputs it. Samples are taken from the given shadow map in filter kernel whose size corresponds to the maximal admitted size according to the shadow map parameters. The kernel is centered at ShadowMapTexCoord. If all samples are less than FragmentDepth-DepthBias, it outputs FragmentDepth to avoid that time is wasted on filtering a large kernel.
OutBlockerSearchShadowIntensity | If the information obtained during the blocker search admits a definite statement on the appropriate shadow intensity, this value is set accordingly. Otherwise it is set to -1.0f. |
void ComputePCSSShadowIntensity | ( | out float | OutShadowIntensity, |
float | BlockerSearchShadowIntensity, | ||
SSamplerTexturePair2D_float | ShadowMapSampler, | ||
float2 | FilterRegionLeftTop, | ||
float2 | FilterRegionRightBottom, | ||
float | FragmentDepth, | ||
float4 | ShadowMapSize, | ||
float | DepthBias | ||
) |
This function evaluates percentage closer filtering for a rectangular kernel with the given dynamically computed corners (in texture coordinates). Texels are weighted according to the area covered by the specified rectangle. This results in bilinear interpolation. SampleCmp() is used to quarter the number of required samples.
void ComputeRectangleAverage_float2 | ( | out float2 | OutAverageValue, |
float2 | LeftTop, | ||
float2 | RightBottom, | ||
SSamplerTexturePair2D_float2 | SummedAreaTableSampler, | ||
float4 | TextureSize | ||
) |
void ComputeRectangleAverage_float4 | ( | out float4 | OutAverageValue, |
float2 | LeftTop, | ||
float2 | RightBottom, | ||
SSamplerTexturePair2D | SummedAreaTableSampler, | ||
float4 | TextureSize | ||
) |
void ComputeRectangleAverage_uint2 | ( | out float2 | OutAverageValue, |
float2 | LeftTop, | ||
float2 | RightBottom, | ||
SSamplerTexturePair2D_uint2 | SummedAreaTableSampler, | ||
float4 | TextureSize, | ||
float2 | FixedPrecision | ||
) |
Like ComputeRectangleAverage_uint4 but for two-channel textures.
void ComputeRectangleAverage_uint4 | ( | out float4 | OutAverageValue, |
float2 | LeftTop, | ||
float2 | RightBottom, | ||
SSamplerTexturePair2D_uint4 | SummedAreaTableSampler, | ||
float4 | TextureSize, | ||
float2 | FixedPrecision | ||
) |
This function computes the average value (component-wise) of a texture with values from zero to one within a rectangle.
OutAverageValue | The average value as values in the range from zero to one. |
LeftTop,RightBottom | The minimal and maximal texture coordinates which are still contained in the rectangle. Restrictions to the size of this rectangle may apply. |
SummedAreaTableSampler | A texture and sampler for a summed area table which provides prefix sums of the texture of interest. |
TextureSize | The width and height of the texture in x and y, reciprocals in z,w. |
void ComputeSampleAverage_float | ( | out float | OutSampleAverage, |
float | SampleSum, | ||
uint | nSample | ||
) |
The following functions divide a vector of moments by an integer. They are used to compute the average of moment vectors moment vectors for different samples of a multisampled depth stencil texture once the sum has been computed.
OutSampleAverage | The result of the component-wise division. |
SampleSum | The dividend. |
nSample | The divisor. |
void ComputeShadowMapCoordinate | ( | out float2 | OutShadowMapTexCoord, |
out float | OutShadowMapDepth, | ||
float4 | ShadowMapProjectionSpacePosition, | ||
float4 | ShadowMapSize | ||
) |
Given the coordinate of a point in the projection space of the shadow map camera of a light source this function outputs the texture coordinate, which has to be used to look up a shadow map sample for this point and the depth this point would have in the shadow map.
void ComputeShadowMapDepth | ( | out float | OutShadowMapDepth, |
float | FragmentDepth | ||
) |
void ComputeSpotLightCamera | ( | out float4x4 | OutViewToWorldSpace, |
out float4x4 | OutViewToProjectionSpace, | ||
float3 | WorldSpaceLightPosition, | ||
float3 | WorldSpaceConeAxisDirection, | ||
float | OuterConeAngle, | ||
float | NearClippingPlane, | ||
float | FarClippingPlane | ||
) |
Given various parameters of a spot light this function outputs a view to world space and view to projection space transformation, which can be used for a camera to render a shadow map for this spot light.
void ComputeTrigonometricMomentVector | ( | out float4 | OutFourier1_2, |
float | FragmentDepth | ||
) |
void ComputeWorldSpacePositionUnderCursor | ( | out float3 | OutWorldSpacePosition, |
Texture2DMS< float, 1 > | SceneDepthTexture, | ||
float4 | SceneDepthTextureSize, | ||
int2 | iCursorPosition, | ||
float4x4 | CameraProjectionToWorldSpace | ||
) |
This function computes the world space position of the surface that is currently visible under the mouse cursor.
OutWorldSpacePosition | The world space position of the fragment that last wrote to the depth buffer at the cursor position. Typically this is the foremost opaque surface. |
SceneDepthTexture | The depth stencil texture used during main scene rendering. |
SceneDepthTextureSize | The size (xy) and reciprocal size (zw) of SceneDepthTexture in pixels. |
iCursorPosition | The index of the pixel in the depth stencil texture pointed to by the mouse cursor. |
CameraProjectionToWorldSpace | The projection to world space transform of the camera used for main scene rendering. |
void Convert2MomentToCanonical | ( | out float2 | OutBiased2Moments, |
float2 | Moments0, | ||
float | MomentBias = 0.0f |
||
) |
void Convert4MomentOptimizedToCanonical | ( | out float4 | OutBiased4Moments, |
float4 | OptimizedMoments0, | ||
float | MomentBias = 6.0e-5f |
||
) |
void Convert4MomentToCanonical | ( | out float4 | OutBiased4Moments, |
float4 | Moments0, | ||
float | MomentBias = 3.0e-7f |
||
) |
void ConvertShadowIntensityToColor | ( | out float4 | OutColor, |
float | ShadowIntensity | ||
) |
void ConvertSplit4MomentOptimizedToCanonical | ( | out float4 | OutBiased4Moments, |
float2 | OptimizedMoments0, | ||
float2 | OptimizedMoments1, | ||
float | MomentBias = 6.0e-5f |
||
) |
Like Convert4MomentOptimizedToCanonical() but takes in a moment vector which is split into two.
void ConvertSplit4MomentToCanonical | ( | out float4 | OutBiased4Moments, |
float2 | Moments0, | ||
float2 | Moments1, | ||
float | MomentBias = 3.0e-7f |
||
) |
void EstimatePenumbraSize | ( | out float2 | OutKernelSize, |
out float | OutDepthBias, | ||
float | OccluderDepth, | ||
float | FragmentDepth, | ||
float3x2 | LightParameter, | ||
float3x2 | KernelSizeParameter, | ||
float | MaxDepthBias | ||
) |
This function computes the adequate filter size for generating a contact hardening shadow. It also adapts the depth bias to the filter size.
OutKernelSize | The size of the kernel as texture coordinate offset from its center to the right bottom. |
OutDepthBias | The depth bias to be used when computing filtered shadows over the returned kernel. For a maximal kernel size it is MaxDepthBias and it is proportional to OutKernelSize but may be clamped below. |
OccluderDepth | The (estimated) depth of the occluding geometry in shadow map coordintes. |
FragmentDepth | The depth of the receiving fragment in shadow map coordinates. |
LightParameter | Parameters defining the computation of the kernel size which depend solely on the light source and the shadow map projection. The first column relates to the horizontal kernel size, the second one to the vertical kernel size. Row 0 holds the factor to be multiplied onto the distance between occluder and receiver. Row 1 and 2 hold the gradient and intercept of the linear function in the denominator which depends on the occluder depth, respectively. |
KernelSizeParameter | The first row provides the upper top texture coordinate offst from the center of the smallest possible filter kernel. The second row provides the same for the biggest possible kernel. The third row provides the reciprocal of the horizontal kernel offset (in texture coordinates) at which the depth bias becomes maximal and the minimal depth bias as multiple of MaxDepthBias. |
MaxDepthBias | The depth bias that is to be used for a kernel of maximal size. |
void GetBlockerSearchRectangle | ( | out float2 | OutSearchRegionLeftTop, |
out float2 | OutSearchRegionRightBottom, | ||
float2 | SearchRegionCenter, | ||
float3x2 | KernelSizeParameter, | ||
float4 | ShadowMapSize | ||
) |
This function computes the left top and right bottom of the rectangle in which the blocker search is to take place.
OutSearchRegionLeftTop | The left top of the search region as texture coordinate. |
OutSearchRegionRightBottom | The right bottom of the search region as texture coordinate. |
SearchRegionCenter | The center of the search region as texture coordinate. |
KernelSizeParameter | See KernelSizeParameter in EstimatePenumbraSize(). |
ShadowMapSize | Shadow map resolution in xy, reciprocal in zw. |
void GetShadowFilterRectangle | ( | out float2 | OutFilterRegionLeftTop, |
out float2 | OutFilterRegionRightBottom, | ||
float2 | FilterRegionCenter, | ||
float2 | KernelSize | ||
) |
This function computes the left top and right bottom of the rectangle over which the shadow map should be filtered to get contact-hardening shadows.
OutFilterRegionLeftTop | The left top of the filter region as texture coordinate. |
OutFilterRegionRightBottom | The right bottom of the filter region as texture coordinate. |
FilterRegionCenter | The center of the filter region as texture coordinate. |
KernelSize | See OutKernelSize in EstimatePenumbraSize(). |
void GetSummedAreaTableThreadGroupCount | ( | out uint3 | nOutThreadGroupHorizontal, |
out uint3 | nOutThreadGroupVertical, | ||
uint3 | ThreadGroupSizeHorizontal, | ||
uint3 | ThreadGroupSizeVertical, | ||
float4 | TextureSize | ||
) |
This function computes the number of thread groups to be dispatched for generation of a summed area table.
nOutThreadGroupHorizontal | The number of thread groups along each dimension to be dispatched for the horizontal filter. |
nOutThreadGroupVertical | The number of thread groups along each dimension to be dispatched for the vertical filter. |
ThreadGroupSizeHorizontal | The size of thread groups along each dimension for the horizontal filter. Only the second entry is supposed to be not one. |
ThreadGroupSizeVertical | The size of thread groups along each dimension for the vertical filter. Only the first entry is supposed to be not one. |
TextureSize | The width and height of the texture for which a summed area table is to be generated in x and y. |
void HeavisideStepFunction | ( | out float | OutShadowIntensity, |
float | BlockerDepth, | ||
float | FragmentDepth | ||
) |
void LoadDepthSample1 | ( | out float | OutDepthSample, |
Texture2DMS< float, 1 > | ShadowMap, | ||
float2 | TexCoord, | ||
uint | SampleIndex, | ||
float4 | ShadowMapSize | ||
) |
The following functions take a depth sample from a multisampled texture.
OutDepthSample | The loaded depth sample mapped to the range from -1 to 1. |
ShadowMap | The multisampled shadow map. |
TexCoord | The texture coordinate at which sampling should take place. No interpolation is performed. |
SampleIndex | The index of the sample in the multisampled texture which is to be loaded. |
ShadowMapSize | The size of the texture in texels in x and y. |
void PickShadowIntensity | ( | out float | OutShadowIntensity, |
float | FilteredShadowIntensity, | ||
float | BlockerSearchShadowIntensity | ||
) |
This function takes in a shadow intensity computed by the filtering step of an algorithm for contact-hardening shadows and another shadow intensity computed by the blocker search. The shadow intensity computed by the blocker search can be negative to imply that results are inconclusive. Only in this case the shadow intensity computed during filtering will be used. Otherwise the shadow intensity computed during the blocker search is output and the compiler can branch away the entire filtering step.
void Sample2MomentShadowMap | ( | out float2 | OutBiased2Moments, |
SSamplerTexturePair2D_float2 | _2MomentShadowMapSampler, | ||
float2 | ShadowMapTexCoord, | ||
float | MomentBias = 0.0f |
||
) |
void Sample2TMSMShadowMap | ( | out float2 | pOutFourierCoefficient[2], |
SSamplerTexturePair2D | _2TMSMShadowMapSampler, | ||
float2 | ShadowMapTexCoord | ||
) |
void Sample4MomentOptimizedShadowMap | ( | out float4 | OutBiased4Moments, |
SSamplerTexturePair2D | _4MomentOptimizedShadowMapSampler, | ||
float2 | ShadowMapTexCoord, | ||
float | MomentBias = 6.0e-5f |
||
) |
void Sample4MomentOptimizedSplitShadowMap | ( | out float4 | OutBiased4Moments, |
SSamplerTexturePair2D_float2 | _4MomentOptimizedShadowMapSampler0, | ||
SSamplerTexturePair2D_float2 | _4MomentOptimizedShadowMapSampler1, | ||
float2 | ShadowMapTexCoord, | ||
float | MomentBias = 6.0e-5f |
||
) |
void Sample4MomentShadowMap | ( | out float4 | OutBiased4Moments, |
SSamplerTexturePair2D | _4MomentShadowMapSampler, | ||
float2 | ShadowMapTexCoord, | ||
float | MomentBias = 3.0e-7f |
||
) |
void Sample4MomentSplitShadowMap | ( | out float4 | OutBiased4Moments, |
SSamplerTexturePair2D_float2 | _4MomentShadowMapSampler0, | ||
SSamplerTexturePair2D_float2 | _4MomentShadowMapSampler1, | ||
float2 | ShadowMapTexCoord, | ||
float | MomentBias = 3.0e-7f |
||
) |
void SampleConvolutionShadowMap16 | ( | out float2 | pOutFourierCoefficient[16], |
SSamplerTexturePair2D | ConvolutionShadowMapSampler0, | ||
SSamplerTexturePair2D | ConvolutionShadowMapSampler1, | ||
SSamplerTexturePair2D | ConvolutionShadowMapSampler2, | ||
SSamplerTexturePair2D | ConvolutionShadowMapSampler3, | ||
SSamplerTexturePair2D | ConvolutionShadowMapSampler4, | ||
SSamplerTexturePair2D | ConvolutionShadowMapSampler5, | ||
SSamplerTexturePair2D | ConvolutionShadowMapSampler6, | ||
SSamplerTexturePair2D | ConvolutionShadowMapSampler7, | ||
float2 | ShadowMapTexCoord | ||
) |
void SampleConvolutionShadowMap8 | ( | out float2 | pOutFourierCoefficient[8], |
SSamplerTexturePair2D | ConvolutionShadowMapSampler0, | ||
SSamplerTexturePair2D | ConvolutionShadowMapSampler1, | ||
SSamplerTexturePair2D | ConvolutionShadowMapSampler2, | ||
SSamplerTexturePair2D | ConvolutionShadowMapSampler3, | ||
float2 | ShadowMapTexCoord | ||
) |
void SampleExponentialShadowMap | ( | out float | OutExponentialShadowMap, |
SSamplerTexturePair2D_float | ExponentialShadowMapSampler, | ||
float2 | ShadowMapTexCoord | ||
) |
void SampleExponentialVarianceShadowMap | ( | out float4 | OutExponentialVarianceVector, |
SSamplerTexturePair2D | ExponentialVarianceShadowMapSampler0, | ||
float2 | ShadowMapTexCoord | ||
) |
void SampleExponentialVarianceSplitShadowMap | ( | out float4 | OutExponentialVarianceVector, |
SSamplerTexturePair2D_float2 | ExponentialVarianceShadowMapSampler0, | ||
SSamplerTexturePair2D_float2 | ExponentialVarianceShadowMapSampler1, | ||
float2 | ShadowMapTexCoord | ||
) |
void SampleShadowMap | ( | out float | OutShadowMapDepth, |
SSamplerTexturePair2D_float | ShadowMapSampler, | ||
float2 | ShadowMapTexCoord | ||
) |
void ScaleShadowIntensity | ( | out float | OutShadowIntensity, |
float | ShadowIntensity, | ||
float | ShadowIntensityFactor, | ||
float2 | ShadowMapTexCoord, | ||
float | FragmentDepth | ||
) |