浏览代码

Merge branch 'shader-include-paths-2'

/main
Peter Bay Bastian 7 年前
当前提交
b7db3ef9
共有 67 个文件被更改,包括 256 次插入282 次删除
  1. 97
      ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Shadow.hlsl
  2. 2
      ScriptableRenderPipeline/Core/Shadow/Resources/DebugDisplayShadowMap.shader
  3. 4
      ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.shader
  4. 2
      ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugFullScreen.shader
  5. 4
      ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewMaterialGBuffer.shader
  6. 2
      ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewTiles.shader
  7. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader
  8. 14
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl
  9. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Deferred.compute
  10. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/DeferredDirectionalShadow.compute
  11. 9
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl
  12. 4
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl.meta
  13. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
  14. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-bigtile.compute
  15. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-clustered.compute
  16. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild.compute
  17. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/materialflags.compute
  18. 2
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/scrbound.compute
  19. 17
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Shadow.hlsl
  20. 4
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
  21. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitDataDisplacement.hlsl
  22. 8
      ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
  23. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
  24. 4
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
  25. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl
  26. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataDisplacement.hlsl
  27. 8
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader
  28. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CombineLighting.shader
  29. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CopyStencilBuffer.shader
  30. 4
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/PreIntegratedFGD.shader
  31. 4
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute
  32. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.shader
  33. 16
      ScriptableRenderPipeline/HDRenderPipeline/Material/Material.hlsl
  34. 2
      ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Unlit.shader
  35. 2
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/ApplyDistorsion.compute
  36. 2
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/CameraMotionVectors.shader
  37. 2
      ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/DepthDownsample.compute
  38. 2
      ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawSssProfile.shader
  39. 4
      ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawTransmittanceGraph.shader
  40. 2
      ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl
  41. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.hlsl
  42. 6
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Resources/SkyBlacksmith.shader
  43. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader
  44. 4
      ScriptableRenderPipeline/HDRenderPipeline/Sky/BuildProbabilityTables.compute
  45. 4
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ComputeGgxIblSampleData.compute
  46. 4
      ScriptableRenderPipeline/HDRenderPipeline/Sky/GGXConvolve.shader
  47. 6
      ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Resources/SkyHDRI.shader
  48. 2
      ScriptableRenderPipeline/HDRenderPipeline/Sky/OpaqueAtmosphericScattering.shader
  49. 6
      ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources/ProceduralSky.shader
  50. 2
      TestbedPipelines/Fptl/FptlLighting.cs
  51. 31
      TestbedPipelines/Fptl/LightingTemplate.hlsl
  52. 7
      TestbedPipelines/Fptl/ShadowContext.hlsl
  53. 13
      TestbedPipelines/Fptl/ShadowContext.hlsl.meta
  54. 2
      TestbedPipelines/OnTileDeferredPipeline/OnTileDeferredRenderPipeline.cs
  55. 30
      TestbedPipelines/OnTileDeferredPipeline/Shaders/LightingTemplate.hlsl
  56. 30
      TestbedPipelines/OnTileDeferredPipeline/Shaders/UnityStandardForwardMobile.cginc
  57. 2
      ScriptableRenderPipeline/Core/Editor/CoreShaderIncludePaths.cs.meta
  58. 19
      ScriptableRenderPipeline/Core/Editor/CoreShaderIncludePaths.cs
  59. 9
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Shadow.hlsl.meta
  60. 40
      TestbedPipelines/Fptl/Shadow.hlsl
  61. 3
      TestbedPipelines/Fptl/Shadow.hlsl.meta
  62. 8
      ScriptableRenderPipeline/Core/ShadowIncludes.hlsl.meta
  63. 25
      ScriptableRenderPipeline/Core/ShadowIncludes.hlsl
  64. 21
      ScriptableRenderPipeline/HDRenderPipeline/Editor/HDDefaultShaderIncludes.cs
  65. 9
      ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowDispatch.hlsl.meta
  66. 0
      /ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Shadow.hlsl
  67. 0
      /ScriptableRenderPipeline/Core/Editor/CoreShaderIncludePaths.cs.meta

97
ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Shadow.hlsl


#ifndef SHADOW_HLSL
#define SHADOW_HLSL
// First ShadowContext.hlsl must declare the specific ShadowContext struct and the loader that goes along with it.
// First ShadowContext.hlsl provides a macro SHADOWCONTEXT_DECLARE that must be used in order to define the specific ShadowContext struct and accompanying loader.
// Second there are two headers for shadow algorithms, whose signatures must match any of the Get...Attenuation function prototypes.
// The first header contains engine defaults, whereas the second header is empty by default. All project specific custom shadow algorithms should go in there or leave empty.
//
// Last there's a dispatcher include. By default the Get...Attenuation functions are rerouted to their default implementations. This can be overridden for each
// shadow type in the dispatcher source. For each overridden shadow type a specific define must be defined to prevent falling back to the default functions.
//
/* Required defines: (define these to the desired numbers - must be in sync with loading and resource setup from C#)
#define SHADOWCONTEXT_MAX_TEX2DARRAY 0
#define SHADOWCONTEXT_MAX_TEXCUBEARRAY 0
#define SHADOWCONTEXT_MAX_SAMPLER 0
#define SHADOWCONTEXT_MAX_COMPSAMPLER 0
*/
/* Default values for optional defines:
#define SHADOW_SUPPORTS_DYNAMIC_INDEXING 0 // Dynamic indexing only works on >= sm 5.1
#define SHADOW_OPTIMIZE_REGISTER_USAGE 0 // Redefine this as 1 in your ShadowContext.hlsl to optimize for register usage over instruction count
// #define SHADOW_DISPATCH_USE_CUSTOM_PUNCTUAL // Enable custom implementations of GetPunctualShadowAttenuation. If not defined, a default implementation will be used.
// #define SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL // Enable custom implementations of GetDirectionalShadowAttenuation. If not defined, a default implementation will be used.
*/
#define SHADOW_SUPPORTS_DYNAMIC_INDEXING 0 // only on >= sm 5.1
#define SHADOW_OPTIMIZE_REGISTER_USAGE 0 // redefine this as 1 in your ShadowContext.hlsl to optimize for register usage over instruction count
#ifndef SHADOW_SUPPORTS_DYNAMIC_INDEXING
#define SHADOW_SUPPORTS_DYNAMIC_INDEXING 0
#endif
#ifndef SHADOW_OPTIMIZE_REGISTER_USAGE
#define SHADOW_OPTIMIZE_REGISTER_USAGE 0
#endif
#include "../../../Core/Shadow/ShadowBase.cs.hlsl" // ShadowData definition, auto generated (don't modify)
#include "Shadow/ShadowBase.cs.hlsl" // ShadowData definition, auto generated (don't modify)
// Declares a shadow context struct with members and sampling code based on whether _...Slots > 0
#define SHADOWCONTEXT_DECLARE( _Tex2DArraySlots, _TexCubeArraySlots, _SamplerCompSlots, _SamplerSlots ) \
\
struct ShadowContext \
{ \
StructuredBuffer<ShadowData> shadowDatas; \
StructuredBuffer<int4> payloads; \
SHADOWCONTEXT_DECLARE_TEXTURES( _Tex2DArraySlots, _TexCubeArraySlots, _SamplerCompSlots, _SamplerSlots ) \
}; \
\
SHADOW_DEFINE_SAMPLING_FUNCS( _Tex2DArraySlots, _TexCubeArraySlots, _SamplerCompSlots, _SamplerSlots )
struct ShadowContext
{
StructuredBuffer<ShadowData> shadowDatas;
StructuredBuffer<int4> payloads;
SHADOWCONTEXT_DECLARE_TEXTURES( SHADOWCONTEXT_MAX_TEX2DARRAY, SHADOWCONTEXT_MAX_TEXCUBEARRAY, SHADOWCONTEXT_MAX_COMPSAMPLER, SHADOWCONTEXT_MAX_SAMPLER )
};
// Shadow context definition and initialization, i.e. resource binding (project header, must be kept in sync with C# runtime)
#define SHADOW_CONTEXT_INCLUDE
#include "../../ShadowIncludes.hlsl"
#undef SHADOW_CONTEXT_INCLUDE
SHADOW_DEFINE_SAMPLING_FUNCS( SHADOWCONTEXT_MAX_TEX2DARRAY, SHADOWCONTEXT_MAX_TEXCUBEARRAY, SHADOWCONTEXT_MAX_COMPSAMPLER, SHADOWCONTEXT_MAX_SAMPLER )
// helper function to extract shadowmap data from the ShadowData struct
void UnpackShadowmapId( uint shadowmapId, out uint texIdx, out uint sampIdx, out float slice )

shadowType = packedShadowType >> 10;
}
// wedge in the actual shadow sampling algorithms
// default dispatchers for the individual shadow types (with and without screenspace support)
// point/spot light shadows
float GetPunctualShadowAttenuationDefault( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float4 L )
{
return EvalShadow_PunctualDepth(shadowContext, positionWS, normalWS, shadowDataIndex, L);
}
float GetPunctualShadowAttenuationDefault( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float4 L, float2 unPositionSS )
{
return GetPunctualShadowAttenuationDefault( shadowContext, positionWS, normalWS, shadowDataIndex, L );
}
// directional light shadows
float GetDirectionalShadowAttenuationDefault( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L )
{
return EvalShadow_CascadedDepth_Blend( shadowContext, positionWS, normalWS, shadowDataIndex, L );
}
float GetDirectionalShadowAttenuationDefault( ShadowContext shadowContext, float3 positionWS, float3 normalWS, int shadowDataIndex, float3 L, float2 unPositionSS )
{
return GetDirectionalShadowAttenuationDefault( shadowContext, positionWS, normalWS, shadowDataIndex, L );
}
// include project specific shadow dispatcher. If this file is not empty, it MUST define which default shadows it's overriding
#define SHADOW_DISPATCH_INCLUDE
#include "../../ShadowIncludes.hlsl"
#undef SHADOW_DISPATCH_INCLUDE
// if shadow dispatch is empty we'll fall back to default shadow sampling implementations
return GetPunctualShadowAttenuationDefault( shadowContext, positionWS, normalWS, shadowDataIndex, L );
return EvalShadow_PunctualDepth(shadowContext, positionWS, normalWS, shadowDataIndex, L);
return GetPunctualShadowAttenuationDefault( shadowContext, positionWS, normalWS, shadowDataIndex, L, unPositionSS );
return GetPunctualShadowAttenuation( shadowContext, positionWS, normalWS, shadowDataIndex, L );
return GetDirectionalShadowAttenuationDefault( shadowContext, positionWS, normalWS, shadowDataIndex, L );
return EvalShadow_CascadedDepth_Blend( shadowContext, positionWS, normalWS, shadowDataIndex, L );
return GetDirectionalShadowAttenuationDefault( shadowContext, positionWS, normalWS, shadowDataIndex, L, unPositionSS );
return GetDirectionalShadowAttenuation( shadowContext, positionWS, normalWS, shadowDataIndex, L );
}
#endif

2
ScriptableRenderPipeline/Core/Shadow/Resources/DebugDisplayShadowMap.shader


#pragma target 4.5
#pragma only_renderers d3d11 ps4 vulkan metal // TEMP: until we go further in dev
#include "../../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
float4 _TextureScaleBias;
float _TextureSlice;

4
ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplayLatlong.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/ImageBasedLighting.hlsl"
TEXTURECUBE(_InputCubemap);
SAMPLERCUBE(sampler_InputCubemap);

2
ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugFullScreen.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "../Debug/DebugDisplay.cs.hlsl"
#include "../ShaderVariables.hlsl"

4
ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewMaterialGBuffer.shader


#pragma multi_compile _ SHADOWS_SHADOWMASK
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/Color.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Color.hlsl"
// CAUTION: In case deferred lighting need to support various lighting model statically, we will require to do multicompile with different define like UNITY_MATERIAL_LIT
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl

2
ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugViewTiles.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
// Note: We have fix as guidelines that we have only one deferred material (with control of GBuffer enabled). Mean a users that add a new
// deferred material must replace the old one here. If in the future we want to support multiple layout (cause a lot of consistency problem),

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "../Debug/DebugDisplay.hlsl"
// Note: We have fix as guidelines that we have only one deferred material (with control of GBuffer enabled). Mean a users that add a new

14
ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl


#ifndef UNITY_LIGHTING_INCLUDED
#define UNITY_LIGHTING_INCLUDED
#include "../../Core/ShaderLibrary/CommonLighting.hlsl"
#include "../../Core/ShaderLibrary/CommonShadow.hlsl"
#include "../../Core/ShaderLibrary/Sampling.hlsl"
#include "../../Core/ShaderLibrary/AreaLighting.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
#include "ShaderLibrary/CommonLighting.hlsl"
#include "ShaderLibrary/CommonShadow.hlsl"
#include "ShaderLibrary/Sampling.hlsl"
#include "ShaderLibrary/AreaLighting.hlsl"
#include "ShaderLibrary/ImageBasedLighting.hlsl"
// The light loop (or lighting architecture) is in charge to:
// - Define light list

#include "../Lighting/LightDefinition.cs.hlsl"
#include "../Lighting/LightUtilities.hlsl"
#define SHADOW_TILEPASS
#include "../../Core/ShaderLibrary/Shadow/Shadow.hlsl"
#undef SHADOW_TILEPASS
#include "TilePass/Shadow.hlsl"
#if defined(LIGHTLOOP_SINGLE_PASS) || defined(LIGHTLOOP_TILE_PASS)
#include "../Lighting/TilePass/TilePass.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Deferred.compute


// Include
//-------------------------------------------------------------------------------------
#include "../../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "../../Debug/DebugDisplay.hlsl"
// Note: We have fix as guidelines that we have only one deferred material (with control of GBuffer enabled). Mean a users that add a new

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/DeferredDirectionalShadow.compute


// Each #kernel tells which function to compile; you can have many kernels
#pragma kernel DeferredDirectionalShadow
#include "../../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "../../ShaderVariables.hlsl"
#include "../../Lighting/Lighting.hlsl"

9
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl


// This can be custom for each project and needs to be in sync with the ShadowMgr
#ifndef TILEPASS_SHADOW_CONTEXT_HLSL
#define TILEPASS_SHADOW_CONTEXT_HLSL
#undef SHADOW_OPTIMIZE_REGISTER_USAGE
SHADOWCONTEXT_DECLARE( SHADOWCONTEXT_MAX_TEX2DARRAY, SHADOWCONTEXT_MAX_TEXCUBEARRAY, SHADOWCONTEXT_MAX_COMPSAMPLER, SHADOWCONTEXT_MAX_SAMPLER );
#include "ShaderLibrary/Shadow/Shadow.hlsl"
TEXTURE2D_ARRAY(_ShadowmapExp_VSM_0);
SAMPLER2D(sampler_ShadowmapExp_VSM_0);

return sc;
}
#endif // TILEPASS_SHADOW_CONTEXT_HLSL

4
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowContext.hlsl.meta


fileFormatVersion: 2
guid: b0e81431fe3a7604fb9f9dd2a96bd7e0
timeCreated: 1491321445
licenseType: Pro
externalObjects: {}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs


scInit.resourceBinder = binder;
m_ShadowMgr = new ShadowManager(shadowSettings, ref scInit, m_Shadowmaps);
// set global overrides - these need to match the override specified in ShadowDispatch.hlsl
// set global overrides - these need to match the override specified in TilePass/Shadow.hlsl
bool useGlobalOverrides = true;
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Point , ShadowAlgorithm.PCF, ShadowVariant.V4, ShadowPrecision.High, useGlobalOverrides );
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Spot , ShadowAlgorithm.PCF, ShadowVariant.V4, ShadowPrecision.High, useGlobalOverrides );

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-bigtile.compute


#pragma kernel BigTileLightListGen
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "ShaderLibrary/common.hlsl"
#include "TilePass.cs.hlsl"
#include "LightingConvexHullUtils.hlsl"
#include "SortingComputeUtils.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-clustered.compute


#pragma kernel TileLightListGen_DepthRT_MSAA_SrcBigTile LIGHTLISTGEN=TileLightListGen_DepthRT_MSAA_SrcBigTile ENABLE_DEPTH_TEXTURE_BACKPLANE MSAA_ENABLED USE_TWO_PASS_TILED_LIGHTING
#pragma kernel ClearAtomic
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "ShaderLibrary/common.hlsl"
#include "ShaderBase.hlsl"
#include "TilePass.cs.hlsl"
#include "LightingConvexHullUtils.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild.compute


//#pragma #pragma enable_d3d11_debug_symbols
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "ShaderLibrary/common.hlsl"
#include "ShaderBase.hlsl"
#include "TilePass.cs.hlsl"
#include "LightingConvexHullUtils.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/materialflags.compute


// #pragma enable_d3d11_debug_symbols
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "ShaderLibrary/common.hlsl"
#include "ShaderBase.hlsl"
#include "TilePass.cs.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/scrbound.compute


#pragma kernel ScreenBoundsAABB
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "ShaderLibrary/common.hlsl"
#include "TilePass.cs.hlsl"
uniform int g_isOrthographic;

17
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Shadow.hlsl


// This file is empty by default.
// Project specific file to override the default shadow sampling routines.
// We need to define which dispatchers we're overriding, otherwise the compiler will pick default implementations which will lead to compilation errors.
// Check Shadow.hlsl right below where this header is included for the individual defines.
#ifndef TILEPASS_SHADOW_HLSL
#define TILEPASS_SHADOW_HLSL
#define SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL
#define SHADOW_DISPATCH_USE_CUSTOM_PUNCTUAL
#include "ShadowContext.hlsl"
// This is an example of how to override the default dynamic resource dispatcher
// by hardcoding the resources used and calling the shadow sampling routines that take an explicit texture and sampler.

#define SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL // enables hardcoded resources and algorithm for directional lights
#define SHADOW_DISPATCH_USE_CUSTOM_PUNCTUAL // enables hardcoded resources and algorithm for punctual lights
//#define SHADOW_DISPATCH_USE_SEPARATE_CASCADE_ALGOS // enables separate cascade sampling variants for each cascade
//#define SHADOW_DISPATCH_USE_SEPARATE_PUNC_ALGOS // enables separate resources and algorithms for spot and point lights

return EvalShadow_SpotDepth( shadowContext, algo, tex, compSamp, positionWS, normalWS, shadowDataIndex, L );
}
#else
// example for choosing the same algo
// example for choosing the same algo
Texture2DArray tex = shadowContext.tex2DArray[SHADOW_DISPATCH_PUNC_TEX];
SamplerComparisonState compSamp = shadowContext.compSamplers[SHADOW_DISPATCH_PUNC_SMP];
uint algo = SHADOW_DISPATCH_PUNC_ALG;

#ifdef SHADOW_DISPATCH_USE_SEPARATE_PUNC_ALGOS
#undef SHADOW_DISPATCH_USE_SEPARATE_PUNC_ALGOS
#endif
#endif // TILEPASS_SHADOW_HLSL

4
ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/Wind.hlsl"
#include "ShaderLibrary/common.hlsl"
#include "ShaderLibrary/Wind.hlsl"
#include "../../ShaderPass/FragInputs.hlsl"
#include "../../ShaderPass/ShaderPass.cs.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitDataDisplacement.hlsl


return BlendLayeredScalar(height0, height1, height2, height3, weights);
}
#include "../../../Core/ShaderLibrary/PerPixelDisplacement.hlsl"
#include "ShaderLibrary/PerPixelDisplacement.hlsl"
#endif // defined(_PIXEL_DISPLACEMENT) && LAYERS_HEIGHTMAP_ENABLE

8
ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/Wind.hlsl"
#include "../../../Core/ShaderLibrary/GeometricTools.hlsl"
#include "../../../Core/ShaderLibrary/tessellation.hlsl"
#include "ShaderLibrary/common.hlsl"
#include "ShaderLibrary/Wind.hlsl"
#include "ShaderLibrary/GeometricTools.hlsl"
#include "ShaderLibrary/tessellation.hlsl"
#include "../../ShaderPass/FragInputs.hlsl"
#include "../../ShaderPass/ShaderPass.cs.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


// Define refraction keyword helpers
#define HAS_REFRACTION (defined(_REFRACTION_PLANE) || defined(_REFRACTION_SPHERE))
#if HAS_REFRACTION
# include "../../../Core/ShaderLibrary/Refraction.hlsl"
# include "ShaderLibrary/Refraction.hlsl"
# if defined(_REFRACTION_PLANE)
# define REFRACTION_MODEL(V, posInputs, bsdfData) RefractionModelPlane(V, posInputs.positionWS, bsdfData.normalWS, bsdfData.ior, bsdfData.thickness)

4
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../Core/ShaderLibrary/Common.hlsl"
#include "../../../Core/ShaderLibrary/Wind.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Wind.hlsl"
#include "../../ShaderPass/FragInputs.hlsl"
#include "../../ShaderPass/ShaderPass.cs.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl


#include "../../../Core/ShaderLibrary/SampleUVMapping.hlsl"
#include "ShaderLibrary/SampleUVMapping.hlsl"
#include "../MaterialUtilities.hlsl"
//-------------------------------------------------------------------------------------

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataDisplacement.hlsl


return SAMPLE_TEXTURE2D_LOD(_HeightMap, sampler_HeightMap, param.uv + texOffsetCurrent, lod).r;
}
#include "../../../Core/ShaderLibrary/PerPixelDisplacement.hlsl"
#include "ShaderLibrary/PerPixelDisplacement.hlsl"
void ApplyDisplacementTileScale(inout float height)
{

8
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "../../../Core/ShaderLibrary/Wind.hlsl"
#include "../../../Core/ShaderLibrary/GeometricTools.hlsl"
#include "../../../Core/ShaderLibrary/tessellation.hlsl"
#include "ShaderLibrary/common.hlsl"
#include "ShaderLibrary/Wind.hlsl"
#include "ShaderLibrary/GeometricTools.hlsl"
#include "ShaderLibrary/tessellation.hlsl"
#include "../../ShaderPass/FragInputs.hlsl"
#include "../../ShaderPass/ShaderPass.cs.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CombineLighting.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
TEXTURE2D(_IrradianceSource);

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CopyStencilBuffer.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../../../Core/ShaderLibrary/Packing.hlsl"
#include "ShaderLibrary/Packing.hlsl"
#include "../../../ShaderVariables.hlsl"
#include "../../../Lighting/LightDefinition.cs.hlsl"

4
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/PreIntegratedFGD.shader


#pragma target 4.5
#pragma only_renderers d3d11 ps4 vulkan metal // TEMP: until we go further in dev
#include "../../../../Core/ShaderLibrary/Common.hlsl"
#include "../../../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/ImageBasedLighting.hlsl"
#include "../../../ShaderVariables.hlsl"
struct Attributes

4
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.compute


// Included headers
//--------------------------------------------------------------------------------------------------
#include "../../../../Core/ShaderLibrary/Packing.hlsl"
#include "../../../../Core/ShaderLibrary/SpaceFillingCurves.hlsl"
#include "ShaderLibrary/Packing.hlsl"
#include "ShaderLibrary/SpaceFillingCurves.hlsl"
#include "../../../ShaderVariables.hlsl"
#define UNITY_MATERIAL_LIT
#include "../../../Material/Material.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/SubsurfaceScattering.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "../../../ShaderVariables.hlsl"
#define UNITY_MATERIAL_LIT // Needs to be defined before including Material.hlsl
#include "../../../Material/Material.hlsl"

16
ScriptableRenderPipeline/HDRenderPipeline/Material/Material.hlsl


#ifndef UNITY_MATERIAL_INCLUDED
#define UNITY_MATERIAL_INCLUDED
#include "../../Core/ShaderLibrary/Color.hlsl"
#include "../../Core/ShaderLibrary/Packing.hlsl"
#include "../../Core/ShaderLibrary/BSDF.hlsl"
#include "../../Core/ShaderLibrary/Debug.hlsl"
#include "../../Core/ShaderLibrary/GeometricTools.hlsl"
#include "../../Core/ShaderLibrary/CommonMaterial.hlsl"
#include "../../Core/ShaderLibrary/EntityLighting.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
#include "ShaderLibrary/Color.hlsl"
#include "ShaderLibrary/Packing.hlsl"
#include "ShaderLibrary/BSDF.hlsl"
#include "ShaderLibrary/Debug.hlsl"
#include "ShaderLibrary/GeometricTools.hlsl"
#include "ShaderLibrary/CommonMaterial.hlsl"
#include "ShaderLibrary/EntityLighting.hlsl"
#include "ShaderLibrary/ImageBasedLighting.hlsl"
#include "../Sky/AtmosphericScattering/AtmosphericScattering.hlsl"
// Guidelines for Material Keyword.

2
ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Unlit.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../Core/ShaderLibrary/common.hlsl"
#include "ShaderLibrary/common.hlsl"
#include "../../ShaderVariables.hlsl"
#include "../../ShaderPass/FragInputs.hlsl"
#include "../../ShaderPass/ShaderPass.cs.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/ApplyDistorsion.compute


#include "../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "../Material/Builtin/BuiltinData.hlsl"
TEXTURE2D(_DistortionTexture);

2
ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/CameraMotionVectors.shader


#pragma target 4.5
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "../ShaderVariables.hlsl"
#include "../ShaderPass/FragInputs.hlsl"
#include "../ShaderPass/VaryingMesh.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/DepthDownsample.compute


#include "../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
Texture2D<float> _Source;
RWTexture2D<float> _Result;

2
ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawSssProfile.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
#define USE_LEGACY_UNITY_MATRIX_VARIABLES
#include "../../ShaderVariables.hlsl"
#ifdef SSS_MODEL_BASIC

4
ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/Resources/DrawTransmittanceGraph.shader


// Include
//-------------------------------------------------------------------------------------
#include "../../../Core/ShaderLibrary/Common.hlsl"
#include "../../../Core/ShaderLibrary/CommonMaterial.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/CommonMaterial.hlsl"
#define USE_LEGACY_UNITY_MATRIX_VARIABLES
#include "../../ShaderVariables.hlsl"

2
ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl


#error SHADERPASS_is_not_correctly_define
#endif
#include "../../Core/ShaderLibrary/Color.hlsl"
#include "ShaderLibrary/Color.hlsl"
CBUFFER_START(UnityMetaPass)
// x = use uv1 as raster position

2
ScriptableRenderPipeline/HDRenderPipeline/Sky/AtmosphericScattering/AtmosphericScattering.hlsl


#ifndef UNITY_ATMOSPHERIC_SCATTERING_INCLUDED
#define UNITY_ATMOSPHERIC_SCATTERING_INCLUDED
#include "../../../Core/ShaderLibrary/VolumeRendering.hlsl"
#include "ShaderLibrary/VolumeRendering.hlsl"
#include "AtmosphericScattering.cs.hlsl"
#include "../SkyVariables.hlsl"

6
ScriptableRenderPipeline/HDRenderPipeline/Sky/BlacksmithlSky/Resources/SkyBlacksmith.shader


#pragma multi_compile _ ATMOSPHERICS_DEBUG
#pragma multi_compile _ PERFORM_SKY_OCCLUSION_TEST
#include "../../../../Core/ShaderLibrary/Color.hlsl"
#include "../../../../Core/ShaderLibrary/Common.hlsl"
#include "../../../../Core/ShaderLibrary/CommonLighting.hlsl"
#include "ShaderLibrary/Color.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/CommonLighting.hlsl"
#include "../../../ShaderVariables.hlsl"
TEXTURECUBE(_Cubemap);

2
ScriptableRenderPipeline/HDRenderPipeline/Sky/BlitCubemap.shader


#pragma fragment frag
#pragma target 4.5
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
TEXTURECUBE(_MainTex);
SAMPLERCUBE(sampler_MainTex);

4
ScriptableRenderPipeline/HDRenderPipeline/Sky/BuildProbabilityTables.compute


// Ref: PBRT v3, 13.6.7 "Piecewise-Constant 2D Distributions".
// Note that we use the equiareal sphere-to-square mapping instead of the latitude-longitude one.
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/ImageBasedLighting.hlsl"
/* --- Input --- */

4
ScriptableRenderPipeline/HDRenderPipeline/Sky/ComputeGgxIblSampleData.compute


// Precomputes data for IntegrateLD(). See that function for a detailed description.
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/ImageBasedLighting.hlsl"
#ifdef SHADER_API_MOBILE
#define MAX_IBL_SAMPLE_CNT 34

4
ScriptableRenderPipeline/HDRenderPipeline/Sky/GGXConvolve.shader


#pragma vertex Vert
#pragma fragment Frag
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "../../Core/ShaderLibrary/ImageBasedLighting.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/ImageBasedLighting.hlsl"
#include "SkyManager.cs.hlsl"
TEXTURECUBE(_MainTex);

6
ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Resources/SkyHDRI.shader


#pragma target 4.5
#pragma only_renderers d3d11 ps4 vulkan metal // TEMP: until we go further in dev
#include "../../../../Core/ShaderLibrary/Color.hlsl"
#include "../../../../Core/ShaderLibrary/Common.hlsl"
#include "../../../../Core/ShaderLibrary/CommonLighting.hlsl"
#include "ShaderLibrary/Color.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/CommonLighting.hlsl"
TEXTURECUBE(_Cubemap);
SAMPLERCUBE(sampler_Cubemap);

2
ScriptableRenderPipeline/HDRenderPipeline/Sky/OpaqueAtmosphericScattering.shader


#pragma enable_d3d11_debug_symbols
#include "../../Core/ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "../ShaderVariables.hlsl"
#include "AtmosphericScattering/AtmosphericScattering.hlsl"

6
ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources/ProceduralSky.shader


#pragma multi_compile _ _ENABLE_SUN_DISK
#include "../../../../Core/ShaderLibrary/Color.hlsl"
#include "../../../../Core/ShaderLibrary/Common.hlsl"
#include "../../../../Core/ShaderLibrary/CommonLighting.hlsl"
#include "ShaderLibrary/Color.hlsl"
#include "ShaderLibrary/Common.hlsl"
#include "ShaderLibrary/CommonLighting.hlsl"
float4 _SkyParam; // x exposure, y multiplier, z rotation
float4x4 _PixelCoordToViewDirWS; // Actually just 3x3, but Unity can only set 4x4

2
TestbedPipelines/Fptl/FptlLighting.cs


scInit.resourceBinder = binder;
m_ShadowMgr = new ShadowManager(shadowSettings, ref scInit, m_Shadowmaps);
// set global overrides - these need to match the override specified in ShadowDispatch.hlsl
// set global overrides - these need to match the override specified in Fptl/Shadow.hlsl
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Point , ShadowAlgorithm.PCF, ShadowVariant.V1, ShadowPrecision.High, true );
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Spot , ShadowAlgorithm.PCF, ShadowVariant.V1, ShadowPrecision.High, true );
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Directional , ShadowAlgorithm.PCF, ShadowVariant.V1, ShadowPrecision.High, true );

31
TestbedPipelines/Fptl/LightingTemplate.hlsl


#define CUBEMAPFACE_POSITIVE_Z 4
#define CUBEMAPFACE_NEGATIVE_Z 5
#define SHADOW_FPTL
# if defined(SHADER_API_D3D11)
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11.hlsl"
# elif defined(SHADER_API_PSSL)
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/API/PSSL.hlsl"
# elif defined(SHADER_API_XBOXONE)
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11.hlsl"
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11_1.hlsl"
# elif defined(SHADER_API_METAL)
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/API/Metal.hlsl"
# else
# error unsupported shader api
# endif
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/API/Validate.hlsl"
# include "../../ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Shadow.hlsl"
#undef SHADOW_FPTL
#if defined(SHADER_API_D3D11)
# include "ShaderLibrary/API/D3D11.hlsl"
#elif defined(SHADER_API_PSSL)
# include "ShaderLibrary/API/PSSL.hlsl"
#elif defined(SHADER_API_XBOXONE)
# include "ShaderLibrary/API/D3D11.hlsl"
# include "ShaderLibrary/API/D3D11_1.hlsl"
#elif defined(SHADER_API_METAL)
# include "ShaderLibrary/API/Metal.hlsl"
#else
# error unsupported shader api
#endif
#include "ShaderLibrary/API/Validate.hlsl"
#include "Shadow.hlsl"
CBUFFER_START(ShadowLightData)

7
TestbedPipelines/Fptl/ShadowContext.hlsl


// This can be custom for each project and needs to be in sync with the ShadowMgr
#ifndef FPTL_SHADOW_CONTEXT_HLSL
#define FPTL_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 "ShaderLibrary/Shadow/Shadow.hlsl"
TEXTURE2D_ARRAY(_ShadowmapExp_PCF);
SAMPLER2D_SHADOW(sampler_ShadowmapExp_PCF);

return sc;
}
#endif // FPTL_SHADOW_CONTEXT_HLSL

13
TestbedPipelines/Fptl/ShadowContext.hlsl.meta


fileFormatVersion: 2
guid: 30016f0dcc663b14483b62ccf2e8a7ce
timeCreated: 1503477804
licenseType: Pro
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 7c02f6444b51404e99b1158f7f152678
timeCreated: 1511273566

2
TestbedPipelines/OnTileDeferredPipeline/OnTileDeferredRenderPipeline.cs


scInit.resourceBinder = binder;
m_ShadowMgr = new ShadowManager(shadowSettings, ref scInit, m_Shadowmaps);
// set global overrides - these need to match the override specified in ShadowDispatch.hlsl
// set global overrides - these need to match the override specified in Fptl/Shadow.hlsl
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Point , ShadowAlgorithm.PCF, ShadowVariant.V1, ShadowPrecision.High, true );
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Spot , ShadowAlgorithm.PCF, ShadowVariant.V1, ShadowPrecision.High, true );
m_ShadowMgr.SetGlobalShadowOverride( GPUShadowType.Directional , ShadowAlgorithm.PCF, ShadowVariant.V1, ShadowPrecision.High, true );

30
TestbedPipelines/OnTileDeferredPipeline/Shaders/LightingTemplate.hlsl


#define BOX_LIGHT (2)
#define DIRECTIONAL_LIGHT (3)
#define SHADOW_FPTL
# if defined(SHADER_API_D3D11)
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11.hlsl"
# elif defined(SHADER_API_PSSL)
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/PSSL.hlsl"
# elif defined(SHADER_API_XBOXONE)
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11.hlsl"
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11_1.hlsl"
# elif defined(SHADER_API_METAL)
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/Metal.hlsl"
# else
# error unsupported shader api
# endif
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/Validate.hlsl"
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Shadow.hlsl"
#undef SHADOW_FPTL
#if defined(SHADER_API_D3D11)
# include "ShaderLibrary/API/D3D11.hlsl"
#elif defined(SHADER_API_PSSL)
# include "ShaderLibrary/API/PSSL.hlsl"
#elif defined(SHADER_API_XBOXONE)
# include "ShaderLibrary/API/D3D11.hlsl"
# include "ShaderLibrary/API/D3D11_1.hlsl"
#elif defined(SHADER_API_METAL)
# include "ShaderLibrary/API/Metal.hlsl"
#else
# error unsupported shader api
#endif
#include "ShaderLibrary/API/Validate.hlsl"
#include "../../Fptl/Shadow.hlsl"
UNITY_DECLARE_DEPTH_TEXTURE(_CameraGBufferZ);

30
TestbedPipelines/OnTileDeferredPipeline/Shaders/UnityStandardForwardMobile.cginc


#define CUBEMAPFACE_POSITIVE_Z 4
#define CUBEMAPFACE_NEGATIVE_Z 5
#define SHADOW_FPTL
# if defined(SHADER_API_D3D11)
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11.hlsl"
# elif defined(SHADER_API_PSSL)
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/PSSL.hlsl"
# elif defined(SHADER_API_XBOXONE)
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11.hlsl"
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/D3D11_1.hlsl"
# elif defined(SHADER_API_METAL)
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/Metal.hlsl"
# else
# error unsupported shader api
# endif
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/API/Validate.hlsl"
# include "../../../ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/Shadow.hlsl"
#undef SHADOW_FPTL
#if defined(SHADER_API_D3D11)
# include "ShaderLibrary/API/D3D11.hlsl"
#elif defined(SHADER_API_PSSL)
# include "ShaderLibrary/API/PSSL.hlsl"
#elif defined(SHADER_API_XBOXONE)
# include "ShaderLibrary/API/D3D11.hlsl"
# include "ShaderLibrary/API/D3D11_1.hlsl"
#elif defined(SHADER_API_METAL)
# include "ShaderLibrary/API/Metal.hlsl"
#else
# error unsupported shader api
#endif
#include "ShaderLibrary/API/Validate.hlsl"
#include "../../Fptl/Shadow.hlsl"
struct VertexOutputForwardNew
{

2
ScriptableRenderPipeline/Core/Editor/CoreShaderIncludePaths.cs.meta


fileFormatVersion: 2
guid: e303d56aac48c1f4280b30146e9d0a63
guid: b40d30371f67ce54e89386dc076a895a
MonoImporter:
externalObjects: {}
serializedVersion: 2

19
ScriptableRenderPipeline/Core/Editor/CoreShaderIncludePaths.cs


using System.Linq;
using UnityEngine;
using System.IO;
namespace UnityEditor.Experimental.Rendering
{
static class CoreShaderIncludePaths
{
[ShaderIncludePath]
public static string[] GetPaths()
{
return new[]
{
"Assets/ScriptableRenderPipeline/ScriptableRenderPipeline/Core",
Path.GetFullPath("Packages/com.unity.render-pipelines.core")
};
}
}
}

9
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Shadow.hlsl.meta


fileFormatVersion: 2
guid: a17db9285d434b8aafe02c6d8af3353c
ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:

40
TestbedPipelines/Fptl/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

3
TestbedPipelines/Fptl/Shadow.hlsl.meta


fileFormatVersion: 2
guid: d042b3cf919f4d7d815e9923fa3f1c65
timeCreated: 1511268424

8
ScriptableRenderPipeline/Core/ShadowIncludes.hlsl.meta


fileFormatVersion: 2
guid: cbc2765f95de56a47a8f39f5f1badd58
timeCreated: 1491314187
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

25
ScriptableRenderPipeline/Core/ShadowIncludes.hlsl


// 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

21
ScriptableRenderPipeline/HDRenderPipeline/Editor/HDDefaultShaderIncludes.cs


using UnityEditor.Experimental.Rendering.HDPipeline;
namespace UnityEditor
{
internal static class HDDefaultShaderIncludes
{
static string s_RenderPipelinePath
{
get { return HDEditorUtils.GetScriptableRenderPipelinePath(); }
}
[ShaderIncludePath]
public static string[] GetPaths()
{
return new[]
{
s_RenderPipelinePath
};
}
}
}

9
ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowDispatch.hlsl.meta


fileFormatVersion: 2
guid: e7e55b7306a2b2f43886918882a8935a
timeCreated: 1491321445
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/ShadowDispatch.hlsl → /ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Shadow.hlsl

/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDDefaultShaderIncludes.cs.meta → /ScriptableRenderPipeline/Core/Editor/CoreShaderIncludePaths.cs.meta

正在加载...
取消
保存