runes
8 年前
当前提交
cb7bce50
共有 381 个文件被更改,包括 3770 次插入 和 3678 次删除
-
2Assets/ScriptableRenderPipeline.meta
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline.meta
-
16Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/HDRenderPipelineDebug.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor.meta
-
106Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
-
62Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
-
16Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.asset
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.asset.meta
-
313Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs.meta
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting.meta
-
5Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop.cs
-
3Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Resources.meta
-
22Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Resources/Deferred.shader
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass.meta
-
253Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
-
15Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl
-
17Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassLoop.hlsl
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassProducer.asset.meta
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Material.meta
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit.meta
-
294Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/Editor/LayeredLitUI.cs
-
59Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
-
55Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit.meta
-
585Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/BaseLitUI.cs
-
175Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/LitUI.cs
-
8Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs
-
8Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs.hlsl
-
166Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
-
42Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
-
361Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl
-
155Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataInternal.hlsl
-
68Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitProperties.hlsl
-
3Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.hlsl
-
40Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CombineSubsurfaceScattering.shader
-
1Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitDepthPass.hlsl
-
1Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitDistortionPass.hlsl
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitSharePass.hlsl
-
1Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/ShaderPass/LitVelocityPass.hlsl
-
34Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/MaterialUtilities.hlsl
-
284Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/BaseUnlitUI.cs
-
58Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Editor/UnlitUI.cs
-
10Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/Unlit.shader
-
6Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Unlit/UnlitProperties.hlsl
-
48Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/Editor/PostProcessingEditor.cs
-
17Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/PostProcessing.Settings.cs
-
151Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/PostProcessing.cs
-
26Assets/ScriptableRenderPipeline/HDRenderPipeline/PostProcess/Resources/FinalPass.shader
-
438Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SubsurfaceScatteringParameters.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass.meta
-
20Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/FragInputs.hlsl
-
34Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/VaryingMesh.hlsl
-
46Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderVariables.hlsl
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow.meta
-
135Assets/ScriptableRenderPipeline/HDRenderPipeline/Shadow/Shadow.hlsl
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky.meta
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Editor/HDRISkyEditor.cs
-
6Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/HDRISkyRenderer.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/HDRISky/Resources/SkyHDRI.shader
-
26Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs
-
1Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources/SkyProcedural.shader
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkySettings.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/Resources.meta
-
44Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyRenderer.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkySettings.cs
-
7Assets/ScriptableRenderPipeline/HDRenderPipeline/Utilities.cs
-
1Assets/ScriptableRenderPipeline/ShaderLibrary/API/D3D11.hlsl
-
1Assets/ScriptableRenderPipeline/ShaderLibrary/API/Metal.hlsl
-
1Assets/ScriptableRenderPipeline/ShaderLibrary/API/PSSL.hlsl
-
4Assets/ScriptableRenderPipeline/ShaderLibrary/Common.hlsl
-
8Assets/ScriptableRenderPipeline/ShaderLibrary/CommonLighting.hlsl
-
29Assets/ScriptableRenderPipeline/ShaderLibrary/CommonMaterial.hlsl
-
6Assets/ScriptableRenderPipeline/fptl/FptlLighting.cs
-
122Assets/TestScenes/FPTL/Materials/Custom_NewSurfaceShader.mat
-
206Assets/TestScenes/FPTL/Materials/gray.mat
-
35Assets/TestScenes/HDTest/CascadedShadowsTest.unity
-
20Assets/TestScenes/HDTest/CascadedShadowsTest/Lit_Gray.mat
-
27Assets/TestScenes/HDTest/GlobalIlluminationTest/Material/Chrome.mat
-
24Assets/TestScenes/HDTest/GlobalIlluminationTest/Material/Lit_Green.mat
-
25Assets/TestScenes/HDTest/GlobalIlluminationTest/Material/Lit_Grey.mat
-
23Assets/TestScenes/HDTest/GlobalIlluminationTest/Material/Lit_Red.mat
-
2Assets/TestScenes/HDTest/GlobalIlluminationTest/TestRealtime.cs
-
4Assets/TestScenes/HDTest/GraphicTest/Common/Dragon/DragonStatue.mat
-
25Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Blue.mat
-
25Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Green.mat
-
23Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Red.mat
-
23Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_White.mat
-
280Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_0.mat
-
280Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_1.mat
-
280Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_2.mat
-
280Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_3.mat
-
280Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_4.mat
-
280Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_5.mat
-
280Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_6.mat
-
280Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_7.mat
-
280Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_8.mat
|
|||
// TODO: |
|||
// - How to support a Gather sampling with such abstraction ? |
|||
// - What's belong to shadow and what's belong to renderloop ? (shadowmap size depends on the usage of atlas or not) |
|||
// - Is PunctualShadowData fixed or customizable ? Who is the owner ? Should it be pass to GetPunctualShadowAttenuation ? Sure it should... |
|||
// - Could be return by GetShadowTextureCoordinate() and pass to GetPunctualShadowAttenuation(). But in this case, who control the atlas application ? |
|||
// TODO: |
|||
// Caution: formula doesn't work as we are texture atlas... |
|||
// if (max3(abs(NDC.x), abs(NDC.y), 1.0 - texCoordXYZ.z) <= 1.0) return 1.0; |
|||
#ifndef SHADOW_HLSL |
|||
#define SHADOW_HLSL |
|||
// |
|||
// Shadow master include header. |
|||
// |
|||
// There are four relevant files for shadows. |
|||
// First ShadowContext.hlsl must declare the specific ShadowContext struct and the loader that goes along with it. |
|||
// ShadowContext loading and resource setup from C# must be in sync. |
|||
// |
|||
// 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. |
|||
// |
|||
|
|||
|
|||
//#define SHADOWS_USE_SHADOWCTXT |
|||
|
|||
#ifdef SHADOWS_USE_SHADOWCTXT |
|||
#define SHADOW_SUPPORTS_DYNAMIC_INDEXING 0 // only on >= sm 5.1 |
|||
|
|||
// TODO: Remove this once we've moved over to the new system. Also delete the undef at the bottom again. |
|||
#define ShadowData ShadowDataExp |
|||
|
|||
#include "ShadowBase.cs.hlsl" // ShadowData definition, auto generated (don't modify) |
|||
#include "ShadowTexFetch.hlsl" // Resource sampling definitions (don't modify) |
|||
|
|||
#define SHADOWCONTEXT_DECLARE( _Tex2DArraySlots, _TexCubeArraySlots, _SamplerCompSlots, _SamplerSlots ) \ |
|||
\ |
|||
struct ShadowContext \ |
|||
{ \ |
|||
StructuredBuffer<ShadowData> shadowDatas; \ |
|||
StructuredBuffer<int4> payloads; \ |
|||
Texture2DArray tex2DArray[_Tex2DArraySlots]; \ |
|||
TextureCubeArray texCubeArray[_TexCubeArraySlots]; \ |
|||
SamplerComparisonState compSamplers[_SamplerCompSlots]; \ |
|||
SamplerState samplers[_SamplerSlots]; \ |
|||
}; \ |
|||
\ |
|||
SHADOW_DEFINE_SAMPLING_FUNCS( _Tex2DArraySlots, _TexCubeArraySlots, _SamplerCompSlots, _SamplerSlots ) |
|||
|
|||
// Shadow context definition and initialization, i.e. resource binding (project header, must be kept in sync with C# runtime) |
|||
#include "ShadowContext.hlsl" |
|||
|
|||
// helper function to extract shadowmap data from the ShadowData struct |
|||
void unpackShadowmapId( uint shadowmapId, out uint texIdx, out uint sampIdx, out float slice ) |
|||
{ |
|||
texIdx = (shadowmapId >> 24) & 0xff; |
|||
sampIdx = (shadowmapId >> 16) & 0xff; |
|||
slice = (float)(shadowmapId & 0xffff); |
|||
} |
|||
void unpackShadowmapId( uint shadowmapId, out uint texIdx, out uint sampIdx ) |
|||
{ |
|||
texIdx = (shadowmapId >> 24) & 0xff; |
|||
sampIdx = (shadowmapId >> 16) & 0xff; |
|||
} |
|||
void unpackShadowmapId( uint shadowmapId, out float slice ) |
|||
{ |
|||
slice = (float)(shadowmapId & 0xffff); |
|||
} |
|||
|
|||
|
|||
|
|||
// shadow sampling prototypes |
|||
float GetPunctualShadowAttenuation( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L ); |
|||
float GetPunctualShadowAttenuation( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L, float2 unPositionSS ); |
|||
// shadow sampling prototypes with screenspace info |
|||
float GetDirectionalShadowAttenuation( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L ); |
|||
float GetDirectionalShadowAttenuation( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L, float2 unPositionSS ); |
|||
|
|||
|
|||
// wedge in the actual shadow sampling algorithms |
|||
#include "ShadowSampling.hlsl" // sampling patterns |
|||
#include "ShadowAlgorithms.hlsl" // engine default algorithms (don't modify) |
|||
#include "ShadowAlgorithmsCustom.hlsl" // project specific custom algorithms (project can modify this) |
|||
|
|||
|
|||
// default dispatchers for the individual shadow types (with and without screenspace support) |
|||
// point/spot light shadows |
|||
float GetPunctualShadowAttenuationDefault( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L ) |
|||
{ |
|||
return EvalShadow_PunctualDepth(shadowContext, positionWS, shadowDataIndex, L); |
|||
} |
|||
float GetPunctualShadowAttenuationDefault( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L, float2 unPositionSS ) |
|||
{ |
|||
return GetPunctualShadowAttenuationDefault( shadowContext, positionWS, shadowDataIndex, L ); |
|||
} |
|||
// directional light shadows |
|||
float GetDirectionalShadowAttenuationDefault( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L ) |
|||
{ |
|||
return EvalShadow_CascadedDepth( shadowContext, positionWS, shadowDataIndex, L ); |
|||
} |
|||
float GetDirectionalShadowAttenuationDefault( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L, float2 unPositionSS ) |
|||
{ |
|||
return GetDirectionalShadowAttenuationDefault( shadowContext, positionWS, shadowDataIndex, L ); |
|||
} |
|||
|
|||
// include project specific shadow dispatcher. If this file is not empty, it MUST define which default shadows it's overriding |
|||
#include "ShadowDispatch.hlsl" |
|||
|
|||
// if shadow dispatch is empty we'll fall back to default shadow sampling implementations |
|||
#ifndef SHADOW_DISPATCH_USE_CUSTOM_PUNCTUAL |
|||
float GetPunctualShadowAttenuation( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L ) |
|||
{ |
|||
return GetPunctualShadowAttenuationDefault( shadowContext, positionWS, shadowDataIndex, L ); |
|||
} |
|||
float GetPunctualShadowAttenuation( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L, float2 unPositionSS ) |
|||
{ |
|||
return GetPunctualShadowAttenuationDefault( shadowContext, positionWS, shadowDataIndex, L, unPositionSS ); |
|||
} |
|||
#endif |
|||
#ifndef SHADOW_DISPATCH_USE_CUSTOM_DIRECTIONAL |
|||
float GetDirectionalShadowAttenuation( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L ) |
|||
{ |
|||
return GetDirectionalShadowAttenuationDefault( shadowContext, positionWS, shadowDataIndex, L ); |
|||
} |
|||
float GetDirectionalShadowAttenuation( ShadowContext shadowContext, float3 positionWS, int shadowDataIndex, float3 L, float2 unPositionSS ) |
|||
{ |
|||
return GetDirectionalShadowAttenuationDefault( shadowContext, positionWS, shadowDataIndex, L, unPositionSS ); |
|||
} |
|||
#endif |
|||
#undef ShadowData // TODO: Remove this once we've moved over to the new system. Also delete the define at the top again. |
|||
|
|||
#endif // SHADOWS_USE_SHADOWCTXT |
|||
|
|||
#endif // SHADOW_HLSL |
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue