浏览代码
Re-factor Shadow.hlsl in core such that the user of the library is including things instead. This is required for package usage, as Core package cannot depend on anything outside itself.
/shader-library-include-paths
Re-factor Shadow.hlsl in core such that the user of the library is including things instead. This is required for package usage, as Core package cannot depend on anything outside itself.
/shader-library-include-paths
Peter Bay Bastian
7 年前
当前提交
0d71d873
共有 20 个文件被更改,包括 167 次插入 和 186 次删除
-
104ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Shadow.hlsl
-
4ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl
-
9ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl
-
4ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl.meta
-
2ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
-
21ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Shadow.hlsl
-
2TestbedPipelines/Fptl/FptlLighting.cs
-
31TestbedPipelines/Fptl/LightingTemplate.hlsl
-
7TestbedPipelines/Fptl/ShadowContext.hlsl
-
13TestbedPipelines/Fptl/ShadowContext.hlsl.meta
-
2TestbedPipelines/OnTileDeferredPipeline/OnTileDeferredRenderPipeline.cs
-
30TestbedPipelines/OnTileDeferredPipeline/Shaders/LightingTemplate.hlsl
-
30TestbedPipelines/OnTileDeferredPipeline/Shaders/UnityStandardForwardMobile.cginc
-
9ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Shadow.hlsl.meta
-
40TestbedPipelines/Fptl/Shadow.hlsl
-
3TestbedPipelines/Fptl/Shadow.hlsl.meta
-
8ScriptableRenderPipeline/Core/ShadowIncludes.hlsl.meta
-
25ScriptableRenderPipeline/Core/ShadowIncludes.hlsl
-
9ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowDispatch.hlsl.meta
-
0/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Shadow.hlsl
|
|||
fileFormatVersion: 2 |
|||
guid: b0e81431fe3a7604fb9f9dd2a96bd7e0 |
|||
timeCreated: 1491321445 |
|||
licenseType: Pro |
|||
externalObjects: {} |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 30016f0dcc663b14483b62ccf2e8a7ce |
|||
timeCreated: 1503477804 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|||
fileFormatVersion: 2 |
|||
guid: 7c02f6444b51404e99b1158f7f152678 |
|||
timeCreated: 1511273566 |
|
|||
fileFormatVersion: 2 |
|||
guid: a17db9285d434b8aafe02c6d8af3353c |
|||
ShaderImporter: |
|||
externalObjects: {} |
|||
defaultTextures: [] |
|||
nonModifiableTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
#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 |
|
|||
fileFormatVersion: 2 |
|||
guid: d042b3cf919f4d7d815e9923fa3f1c65 |
|||
timeCreated: 1511268424 |
|
|||
fileFormatVersion: 2 |
|||
guid: cbc2765f95de56a47a8f39f5f1badd58 |
|||
timeCreated: 1491314187 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// This file is inlined by ShaderLibrary/Shadow/Shadow.hlsl twice. |
|||
// Each time either SHADOW_CONTEXT_INCLUDE or SHADOW_DISPATCH_INCLUDE is defined. |
|||
// In the case of SHADOW_CONTEXT_INCLUDE a valid path must be given to a file that contains |
|||
// the code to initialize a shadow context. |
|||
// SHADOW_DISPATCH_INCLUDE is optional. |
|||
|
|||
#ifdef SHADOW_CONTEXT_INCLUDE |
|||
# ifdef SHADOW_TILEPASS |
|||
# include "../HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl" |
|||
# elif defined( SHADOW_FPTL ) |
|||
# include "../../TestbedPipelines/fptl/ShadowContext.hlsl" |
|||
# else |
|||
# error "No valid path to the shadow context has been given." |
|||
# endif |
|||
#endif |
|||
|
|||
#ifdef SHADOW_DISPATCH_INCLUDE |
|||
# ifdef SHADOW_TILEPASS |
|||
# include "../HDRenderPipeline/Lighting/TilePass/ShadowDispatch.hlsl" |
|||
# elif defined( SHADOW_FPTL ) |
|||
# include "../../TestbedPipelines/fptl/ShadowDispatch.hlsl" |
|||
# else |
|||
// It's ok not to have a dispatcher include as it only acts as an override |
|||
# endif |
|||
#endif |
|
|||
fileFormatVersion: 2 |
|||
guid: e7e55b7306a2b2f43886918882a8935a |
|||
timeCreated: 1491321445 |
|||
licenseType: Pro |
|||
ShaderImporter: |
|||
defaultTextures: [] |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue