浏览代码

Update shadow files

/main
sebastienlagarde 7 年前
当前提交
b09620e7
共有 4 个文件被更改,包括 55 次插入5 次删除
  1. 2
      TestbedPipelines/OnTileDeferredPipeline/Shaders/LightingTemplate.hlsl
  2. 9
      TestbedPipelines/OnTileDeferredPipeline/Shaders/ShadowContext.hlsl
  3. 40
      TestbedPipelines/OnTileDeferredPipeline/Shaders/Shadow.hlsl
  4. 9
      TestbedPipelines/OnTileDeferredPipeline/Shaders/Shadow.hlsl.meta

2
TestbedPipelines/OnTileDeferredPipeline/Shaders/LightingTemplate.hlsl


# error unsupported shader api
#endif
#include "CoreRP/ShaderLibrary/API/Validate.hlsl"
#include "../../Fptl/Shadow.hlsl"
#include "Shadow.hlsl"
UNITY_DECLARE_DEPTH_TEXTURE(_CameraGBufferZ);

9
TestbedPipelines/OnTileDeferredPipeline/Shaders/ShadowContext.hlsl


// This can be custom for each project and needs to be in sync with the ShadowMgr
#ifndef ONTILE_SHADOW_CONTEXT_HLSL
#define ONTILE_SHADOW_CONTEXT_HLSL
#define SHADOWCONTEXT_MAX_TEX2DARRAY 1
#define SHADOWCONTEXT_MAX_TEXCUBEARRAY 0

SHADOWCONTEXT_DECLARE( SHADOWCONTEXT_MAX_TEX2DARRAY, SHADOWCONTEXT_MAX_TEXCUBEARRAY, SHADOWCONTEXT_MAX_COMPSAMPLER, SHADOWCONTEXT_MAX_SAMPLER );
#include "CoreRP/ShaderLibrary/Shadow/Shadow.hlsl"
SAMPLER2D_SHADOW(sampler_ShadowmapExp_PCF);
SAMPLER_CMP(sampler_ShadowmapExp_PCF);
StructuredBuffer<ShadowData> _ShadowDatasExp;
StructuredBuffer<int4> _ShadowPayloads;

return sc;
}
#endif // ONTILE_SHADOW_CONTEXT_HLSL

40
TestbedPipelines/OnTileDeferredPipeline/Shaders/Shadow.hlsl


#ifndef FPTL_SHADOW_HLSL
#define FPTL_SHADOW_HLSL
#define SHADOW_DISPATCH_USE_CUSTOM_PUNCTUAL // Define this to provide custom implementations of GetPunctualShadowAttenuation
#define SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL // Define this to provide custom implementations of GetDirectionalShadowAttenuation
#include "ShadowContext.hlsl"
#ifdef SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL
float GetDirectionalShadowAttenuation( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L )
{
Texture2DArray tex = shadowContext.tex2DArray[0];
SamplerComparisonState compSamp = shadowContext.compSamplers[0];
uint algo = GPUSHADOWALGORITHM_PCF_9TAP;
return EvalShadow_CascadedDepth_Blend( shadowContext, algo, tex, compSamp, positionWS, normalWS, shadowDataIndex, L );
}
float GetDirectionalShadowAttenuation( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L, float2 unPositionSS )
{
return GetDirectionalShadowAttenuation( shadowContext, positionWS, normalWS, shadowDataIndex, L );
}
#endif
#ifdef SHADOW_DISPATCH_USE_CUSTOM_PUNCTUAL
float GetPunctualShadowAttenuation( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float4 L )
{
// example for choosing the same algo
Texture2DArray tex = shadowContext.tex2DArray[0];
SamplerComparisonState compSamp = shadowContext.compSamplers[0];
uint algo = GPUSHADOWALGORITHM_PCF_9TAP;
return EvalShadow_PunctualDepth( shadowContext, algo, tex, compSamp, positionWS, normalWS, shadowDataIndex, L );
}
float GetPunctualShadowAttenuation( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float4 L, float2 unPositionSS )
{
return GetPunctualShadowAttenuation( shadowContext, positionWS, normalWS, shadowDataIndex, L );
}
#endif
#endif // FPTL_SHADOW_HLSL

9
TestbedPipelines/OnTileDeferredPipeline/Shaders/Shadow.hlsl.meta


fileFormatVersion: 2
guid: f4991b12b26eeeb49ba0f3fbadeec148
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存