|
|
|
|
|
|
// |
|
|
|
float SampleShadow_VSM_1tap( ShadowContext shadowContext, inout uint payloadOffset, float3 tcs, uint slice, uint texIdx, uint sampIdx ) |
|
|
|
{ |
|
|
|
#if UNITY_REVERSED_Z |
|
|
|
float depth = 1.0 - tcs.z; |
|
|
|
#else |
|
|
|
#endif |
|
|
|
float2 params = asfloat( shadowContext.payloads[payloadOffset].xy ); |
|
|
|
float lightLeakBias = params.x; |
|
|
|
float varianceBias = params.y; |
|
|
|
|
|
|
|
|
|
|
float SampleShadow_VSM_1tap(ShadowContext shadowContext, inout uint payloadOffset, float3 tcs, uint slice, Texture2DArray tex, SamplerState samp ) |
|
|
|
{ |
|
|
|
#if UNITY_REVERSED_Z |
|
|
|
float depth = 1.0 - tcs.z; |
|
|
|
#else |
|
|
|
#endif |
|
|
|
float2 params = asfloat( shadowContext.payloads[payloadOffset].xy ); |
|
|
|
float lightLeakBias = params.x; |
|
|
|
float varianceBias = params.y; |
|
|
|
|
|
|
// |
|
|
|
float SampleShadow_EVSM_1tap( ShadowContext shadowContext, inout uint payloadOffset, float3 tcs, uint slice, uint texIdx, uint sampIdx, bool fourMoments ) |
|
|
|
{ |
|
|
|
#if UNITY_REVERSED_Z |
|
|
|
float depth = 1.0 - tcs.z; |
|
|
|
#else |
|
|
|
#endif |
|
|
|
float4 params = asfloat( shadowContext.payloads[payloadOffset] ); |
|
|
|
float lightLeakBias = params.x; |
|
|
|
float varianceBias = params.y; |
|
|
|
|
|
|
|
|
|
|
float SampleShadow_EVSM_1tap( ShadowContext shadowContext, inout uint payloadOffset, float3 tcs, uint slice, Texture2DArray tex, SamplerState samp, bool fourMoments ) |
|
|
|
{ |
|
|
|
#if UNITY_REVERSED_Z |
|
|
|
float depth = 1.0 - tcs.z; |
|
|
|
#else |
|
|
|
#endif |
|
|
|
float4 params = asfloat( shadowContext.payloads[payloadOffset] ); |
|
|
|
float lightLeakBias = params.x; |
|
|
|
float varianceBias = params.y; |
|
|
|
|
|
|
float momentBias = params.y; |
|
|
|
float depthBias = params.z; |
|
|
|
float bpp16 = params.w; |
|
|
|
#if UNITY_REVERSED_Z |
|
|
|
float depth = (1.0 - tcs.z) + depthBias; |
|
|
|
#else |
|
|
|
#endif |
|
|
|
payloadOffset++; |
|
|
|
|
|
|
|
float4 moments = SampleShadow_T2DA( shadowContext, texIdx, sampIdx, tcs.xy, slice ); |
|
|
|
|
|
|
float momentBias = params.y; |
|
|
|
float depthBias = params.z; |
|
|
|
float bpp16 = params.w; |
|
|
|
float depth = tcs.z + depthBias; |
|
|
|
#if UNITY_REVERSED_Z |
|
|
|
float depth = (1.0 - tcs.z) + depthBias; |
|
|
|
#else |
|
|
|
float depth = tcs.z + depthBias; |
|
|
|
#endif |
|
|
|
payloadOffset++; |
|
|
|
|
|
|
|
float4 moments = SAMPLE_TEXTURE2D_ARRAY_LOD( tex, samp, tcs.xy, slice, 0.0 ); |
|
|
|