浏览代码
Merge branch 'master' into Branch_Batching2
Merge branch 'master' into Branch_Batching2
# Conflicts: # Assets/TestScenes/HDTest/NewBatcherTest.meta/Branch_batcher
Arnaud Carre
8 年前
当前提交
f27d26c4
共有 534 个文件被更改,包括 3188 次插入 和 1770 次删除
-
5.gitmodules
-
117Assets/ScriptableRenderPipeline/AdditionalLightData.cs
-
262Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs
-
13Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs.hlsl
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.hlsl
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Debug/Resources/DebugViewTiles.shader
-
222Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
-
40Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
-
11Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.asset
-
170Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
-
16Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightDefinition.cs
-
40Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightDefinition.cs.hlsl
-
10Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop.cs
-
4Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Lighting.hlsl
-
5Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TileLightLoopProducer.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/FeatureFlags.hlsl
-
248Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources/shadeopaque.compute
-
487Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
-
120Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.hlsl
-
26Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassLoop.hlsl
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLit.shader
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/LayeredLit/LayeredLitTessellation.shader
-
26Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/BaseLitUI.cs
-
40Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/LitUI.cs
-
47Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs
-
54Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.cs.hlsl
-
342Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
-
16Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.shader
-
4Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitData.hlsl
-
15Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitDataInternal.hlsl
-
10Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitProperties.hlsl
-
16Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/LitTessellation.shader
-
11Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Resources/CombineSubsurfaceScattering.shader
-
190Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/SubsurfaceScatteringProfile.cs
-
33Assets/ScriptableRenderPipeline/HDRenderPipeline/SSSProfile/FoliageSSSProfile.asset
-
7Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SceneSettings.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassForward.hlsl
-
15Assets/ScriptableRenderPipeline/HDRenderPipeline/ShaderPass/ShaderPassLightTransport.hlsl
-
1Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkyRenderer.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/ProceduralSkySettings.cs
-
13Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/ProceduralSky/Resources/SkyProcedural.shader
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Sky/SkyManager.cs
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Utilities.cs
-
36Assets/ScriptableRenderPipeline/HDRenderPipeline/Wind/3DNoise.psd.meta
-
129Assets/ScriptableRenderPipeline/ShaderLibrary/AreaLighting.hlsl
-
25Assets/ScriptableRenderPipeline/ShaderLibrary/CommonLighting.hlsl
-
2Assets/ScriptableRenderPipeline/ShaderLibrary/ImageBasedLighting.hlsl
-
76Assets/ScriptableRenderPipeline/ShaderLibrary/Packing.hlsl
-
103Assets/ScriptableRenderPipeline/common/Camera/CameraSwitcher.cs
-
5Assets/ScriptableRenderPipeline/common/CubeToSpherical.shader
-
93Assets/ScriptableRenderPipeline/common/Debugging/DebugItemDrawer.cs
-
16Assets/ScriptableRenderPipeline/common/Debugging/DebugMenuItemUI.cs
-
62Assets/ScriptableRenderPipeline/common/Debugging/Debugging.cs
-
6Assets/ScriptableRenderPipeline/common/Debugging/Editor/DebugMenuEditor.cs
-
21Assets/ScriptableRenderPipeline/common/TextureCache.cs
-
258Assets/ScriptableRenderPipeline/fptl/FptlLighting.cs
-
161Assets/ScriptableRenderPipeline/fptl/LightingTemplate.hlsl
-
2Assets/ScriptableRenderPipeline/fptl/RegularForwardLightingUtils.hlsl
-
30Assets/TestScenes/HDTest/GraphicTest/Common/Dragon/DragonStatue.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Blue.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Green.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_Red.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Lit_White.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_0.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_1.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_2.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_3.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_4.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_5.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_6.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_7.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_8.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth0_9.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smooth1_1.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_0.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_1.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_2.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_3.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_4.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_5.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_6.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_7.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_8.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric0_9.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Common/Material/Mat_smoothdielectric1_0.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Rock.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood triplanar.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Parallax Occlusion Mapping/Material/POM - Wood.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Tessellation/Material/Tessellation - Rock.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Tessellation/Material/Tessellation - Wood.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Triplanar/Material/Wood triplanar.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedFlip.mat
-
7Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedFlipSSS.mat
-
13Assets/TestScenes/HDTest/GraphicTest/Two Sided/Material/GroundLeaf_DoubleSidedMirror.mat
-
2Assets/TestScenes/HDTest/GraphicTest/Two Sided/Prefabs/Materials.meta
-
770Assets/TestScenes/HDTest/HDRenderLoopTest.unity
-
2Assets/TestScenes/HDTest/LayeredLitTest/Mesh/Materials.meta
-
13Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/CubeTransparent.mat
-
13Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s00.mat
-
13Assets/TestScenes/HDTest/Material/HDRenderLoopMaterials/GGX Test/GGX_a00_s01.mat
|
|||
[submodule "Assets/TestScenes/Big"] |
|||
path = Assets/TestScenes/Big |
|||
url = https://github.com/Unity-Technologies/ScriptableRenderLoopScenes |
|||
|
|||
[submodule "Assets/ScriptableRenderPipeline/PostProcessing"] |
|||
path = Assets/ScriptableRenderPipeline/PostProcessing |
|||
url = https://github.com/Unity-Technologies/PostProcessing |
|||
branch = v2 |
|
|||
#pragma kernel ShadeOpaque_Direct_Fptl SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Fptl USE_FPTL_LIGHTLIST |
|||
#pragma kernel ShadeOpaque_Direct_Fptl_DebugDisplay SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Fptl_DebugDisplay USE_FPTL_LIGHTLIST DEBUG_DISPLAY |
|||
#pragma kernel ShadeOpaque_Direct_Clustered SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Clustered USE_CLUSTERED_LIGHTLIST |
|||
#pragma kernel ShadeOpaque_Direct_Clustered_DebugDisplay SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Clustered_DebugDisplay USE_CLUSTERED_LIGHTLIST DEBUG_DISPLAY |
|||
|
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant0 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant0 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=0 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant1 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant1 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=1 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant2 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant2 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=2 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant3 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant3 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=3 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant4 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant4 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=4 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant5 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant5 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=5 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant6 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant6 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=6 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant7 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant7 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=7 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant8 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant8 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=8 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant9 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant9 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=9 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant10 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant10 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=10 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant11 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant11 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=11 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant12 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant12 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=12 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant13 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant13 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=13 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant14 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant14 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=14 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant15 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant15 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=15 |
|||
|
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant0 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant0 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=0 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant1 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant1 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=1 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant2 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant2 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=2 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant3 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant3 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=3 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant4 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant4 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=4 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant5 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant5 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=5 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant6 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant6 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=6 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant7 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant7 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=7 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant8 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant8 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=8 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant9 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant9 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=9 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant10 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant10 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=10 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant11 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant11 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=11 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant12 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant12 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=12 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant13 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant13 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=13 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant14 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant14 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=14 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant15 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant15 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=15 |
|||
|
|||
#pragma #pragma enable_d3d11_debug_symbols |
|||
|
|||
// Split lighting is required for the SSS pass. |
|||
// Not currently possible since we need to access the stencil buffer from the compute shader. |
|||
// #pragma multi_compile _ OUTPUT_SPLIT_LIGHTING |
|||
|
|||
#define LIGHTLOOP_TILE_PASS 1 |
|||
#define LIGHTLOOP_TILE_DIRECT 1 |
|||
#define LIGHTLOOP_TILE_INDIRECT 1 |
|||
#define LIGHTLOOP_TILE_ALL 1 |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// Include |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
#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 |
|||
// deferred material must replace the old one here. If in the future we want to support multiple layout (cause a lot of consistency problem), |
|||
// the deferred shader will require to use multicompile. |
|||
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl |
|||
#include "../../../ShaderConfig.cs.hlsl" |
|||
#include "../../../ShaderVariables.hlsl" |
|||
#include "../../../Lighting/Lighting.hlsl" // This include Material.hlsl |
|||
#include "../../../Lighting/TilePass/FeatureFlags.hlsl" |
|||
//------------------------------------------------------------------------------------- |
|||
// variable declaration |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
DECLARE_GBUFFER_TEXTURE(_GBufferTexture); |
|||
|
|||
#ifdef OUTPUT_SPLIT_LIGHTING |
|||
RWTexture2D<float4> specularLightingUAV; |
|||
RWTexture2D<float3> diffuseLightingUAV; |
|||
#else |
|||
RWTexture2D<float4> combinedLightingUAV; |
|||
#endif |
|||
|
|||
#if USE_INDIRECT |
|||
uint g_TileListOffset; |
|||
StructuredBuffer<uint> g_TileList; |
|||
// Indirect |
|||
[numthreads(16, 16, 1)] |
|||
void SHADE_OPAQUE_ENTRY(uint2 groupThreadId : SV_GroupThreadID, uint groupId : SV_GroupID) |
|||
{ |
|||
uint tileIndex = g_TileList[g_TileListOffset + groupId]; |
|||
uint2 tileCoord = uint2(tileIndex & 0xFFFF, tileIndex >> 16); |
|||
uint2 pixelCoord = tileCoord * GetTileSize() + groupThreadId; |
|||
|
|||
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, tileCoord); |
|||
uint featureFlags = TileVariantToFeatureFlags(VARIANT); |
|||
#else |
|||
// Direct |
|||
[numthreads(16, 16, 1)] |
|||
void SHADE_OPAQUE_ENTRY(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupId : SV_GroupID) |
|||
{ |
|||
uint2 pixelCoord = dispatchThreadId; |
|||
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, groupId); |
|||
uint featureFlags = 0xFFFFFFFF; |
|||
#endif |
|||
|
|||
float depth = LOAD_TEXTURE2D(_MainDepthTexture, posInput.unPositionSS).x; |
|||
UpdatePositionInput(depth, _InvViewProjMatrix, _ViewProjMatrix, posInput); |
|||
float3 V = GetWorldSpaceNormalizeViewDir(posInput.positionWS); |
|||
|
|||
FETCH_GBUFFER(gbuffer, _GBufferTexture, posInput.unPositionSS); |
|||
BSDFData bsdfData; |
|||
float3 bakeDiffuseLighting; |
|||
DECODE_FROM_GBUFFER(gbuffer, featureFlags, bsdfData, bakeDiffuseLighting); |
|||
|
|||
PreLightData preLightData = GetPreLightData(V, posInput, bsdfData); |
|||
|
|||
float3 diffuseLighting; |
|||
float3 specularLighting; |
|||
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, featureFlags, diffuseLighting, specularLighting); |
|||
|
|||
#ifdef OUTPUT_SPLIT_LIGHTING |
|||
specularLightingUAV[pixelCoord] = float4(specularLighting, 1.0); |
|||
diffuseLightingUAV[pixelCoord] = diffuseLighting; |
|||
#else |
|||
combinedLightingUAV[pixelCoord] = float4(diffuseLighting + specularLighting, 1.0); |
|||
#endif |
|||
} |
|||
|
|||
#pragma kernel ShadeOpaque_Direct_Fptl SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Fptl USE_FPTL_LIGHTLIST |
|||
#pragma kernel ShadeOpaque_Direct_Fptl_DebugDisplay SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Fptl_DebugDisplay USE_FPTL_LIGHTLIST DEBUG_DISPLAY |
|||
#pragma kernel ShadeOpaque_Direct_Clustered SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Clustered USE_CLUSTERED_LIGHTLIST |
|||
#pragma kernel ShadeOpaque_Direct_Clustered_DebugDisplay SHADE_OPAQUE_ENTRY=ShadeOpaque_Direct_Clustered_DebugDisplay USE_CLUSTERED_LIGHTLIST DEBUG_DISPLAY |
|||
|
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant0 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant0 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=0 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant1 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant1 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=1 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant2 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant2 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=2 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant3 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant3 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=3 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant4 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant4 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=4 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant5 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant5 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=5 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant6 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant6 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=6 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant7 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant7 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=7 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant8 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant8 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=8 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant9 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant9 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=9 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant10 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant10 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=10 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant11 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant11 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=11 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant12 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant12 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=12 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant13 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant13 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=13 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant14 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant14 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=14 |
|||
#pragma kernel ShadeOpaque_Indirect_Fptl_Variant15 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Fptl_Variant15 USE_FPTL_LIGHTLIST USE_INDIRECT VARIANT=15 |
|||
|
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant0 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant0 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=0 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant1 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant1 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=1 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant2 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant2 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=2 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant3 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant3 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=3 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant4 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant4 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=4 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant5 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant5 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=5 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant6 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant6 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=6 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant7 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant7 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=7 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant8 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant8 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=8 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant9 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant9 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=9 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant10 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant10 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=10 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant11 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant11 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=11 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant12 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant12 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=12 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant13 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant13 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=13 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant14 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant14 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=14 |
|||
#pragma kernel ShadeOpaque_Indirect_Clustered_Variant15 SHADE_OPAQUE_ENTRY=ShadeOpaque_Indirect_Clustered_Variant15 USE_CLUSTERED_LIGHTLIST USE_INDIRECT VARIANT=15 |
|||
|
|||
#pragma #pragma enable_d3d11_debug_symbols |
|||
|
|||
// Split lighting is required for the SSS pass. |
|||
// Not currently possible since we need to access the stencil buffer from the compute shader. |
|||
// #pragma multi_compile _ OUTPUT_SPLIT_LIGHTING |
|||
|
|||
#define LIGHTLOOP_TILE_PASS 1 |
|||
#define LIGHTLOOP_TILE_DIRECT 1 |
|||
#define LIGHTLOOP_TILE_INDIRECT 1 |
|||
#define LIGHTLOOP_TILE_ALL 1 |
|||
|
|||
//------------------------------------------------------------------------------------- |
|||
// Include |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
#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 |
|||
// deferred material must replace the old one here. If in the future we want to support multiple layout (cause a lot of consistency problem), |
|||
// the deferred shader will require to use multicompile. |
|||
#define UNITY_MATERIAL_LIT // Need to be define before including Material.hlsl |
|||
#include "../../../ShaderConfig.cs.hlsl" |
|||
#include "../../../ShaderVariables.hlsl" |
|||
#include "../../../Lighting/Lighting.hlsl" // This include Material.hlsl |
|||
#include "../../../Lighting/TilePass/FeatureFlags.hlsl" |
|||
//------------------------------------------------------------------------------------- |
|||
// variable declaration |
|||
//------------------------------------------------------------------------------------- |
|||
|
|||
DECLARE_GBUFFER_TEXTURE(_GBufferTexture); |
|||
|
|||
#ifdef OUTPUT_SPLIT_LIGHTING |
|||
RWTexture2D<float4> specularLightingUAV; |
|||
RWTexture2D<float3> diffuseLightingUAV; |
|||
#else |
|||
RWTexture2D<float4> combinedLightingUAV; |
|||
#endif |
|||
|
|||
#if USE_INDIRECT |
|||
uint g_TileListOffset; |
|||
StructuredBuffer<uint> g_TileList; |
|||
// Indirect |
|||
[numthreads(16, 16, 1)] |
|||
void SHADE_OPAQUE_ENTRY(uint2 groupThreadId : SV_GroupThreadID, uint groupId : SV_GroupID) |
|||
{ |
|||
uint tileIndex = g_TileList[g_TileListOffset + groupId]; |
|||
uint2 tileCoord = uint2(tileIndex & 0xFFFF, tileIndex >> 16); |
|||
uint2 pixelCoord = tileCoord * GetTileSize() + groupThreadId; |
|||
|
|||
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, tileCoord); |
|||
uint featureFlags = TileVariantToFeatureFlags(VARIANT); |
|||
#else |
|||
// Direct |
|||
[numthreads(16, 16, 1)] |
|||
void SHADE_OPAQUE_ENTRY(uint2 dispatchThreadId : SV_DispatchThreadID, uint2 groupId : SV_GroupID) |
|||
{ |
|||
uint2 pixelCoord = dispatchThreadId; |
|||
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, groupId); |
|||
uint featureFlags = 0xFFFFFFFF; |
|||
#endif |
|||
|
|||
float depth = LOAD_TEXTURE2D(_MainDepthTexture, posInput.unPositionSS).x; |
|||
UpdatePositionInput(depth, _InvViewProjMatrix, _ViewProjMatrix, posInput); |
|||
float3 V = GetWorldSpaceNormalizeViewDir(posInput.positionWS); |
|||
|
|||
FETCH_GBUFFER(gbuffer, _GBufferTexture, posInput.unPositionSS); |
|||
BSDFData bsdfData; |
|||
float3 bakeDiffuseLighting; |
|||
DECODE_FROM_GBUFFER(gbuffer, featureFlags, bsdfData, bakeDiffuseLighting); |
|||
|
|||
PreLightData preLightData = GetPreLightData(V, posInput, bsdfData); |
|||
|
|||
float3 diffuseLighting; |
|||
float3 specularLighting; |
|||
LightLoop(V, posInput, preLightData, bsdfData, bakeDiffuseLighting, featureFlags, diffuseLighting, specularLighting); |
|||
|
|||
#ifdef OUTPUT_SPLIT_LIGHTING |
|||
specularLightingUAV[pixelCoord] = float4(specularLighting, 1.0); |
|||
diffuseLightingUAV[pixelCoord] = diffuseLighting; |
|||
#else |
|||
combinedLightingUAV[pixelCoord] = float4(diffuseLighting + specularLighting, 1.0); |
|||
#endif |
|||
} |
|||
|
770
Assets/TestScenes/HDTest/HDRenderLoopTest.unity
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
部分文件因为文件数量过多而无法显示
撰写
预览
正在加载...
取消
保存
Reference in new issue