浏览代码
Merge pull request #273 from Unity-Technologies/Remove-lightloop-asset
Merge pull request #273 from Unity-Technologies/Remove-lightloop-asset
Remove lightloop asset/RenderPassXR_Sandbox
GitHub
8 年前
当前提交
fa72dec5
共有 54 个文件被更改,包括 1281 次插入 和 1392 次删除
-
125Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineInspector.cs
-
10Assets/ScriptableRenderPipeline/HDRenderPipeline/Editor/HDRenderPipelineMenuItems.cs
-
264Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
-
178Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassProducer.asset
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Editor/LitUI.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/SubsurfaceScatteringProfile.cs
-
2Assets/ScriptableRenderPipeline/HDRenderPipeline/SceneSettings/SceneSettings.cs
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Utilities.cs
-
22Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-bigtile.compute
-
48Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/scrbound.compute
-
1001Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild.compute
-
32Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-clustered.compute
-
248Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/shadeopaque.compute
-
55Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.asset
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.asset.meta
-
222Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.cs
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.cs.meta
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources.meta
-
20Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/DefaultCommonSettings.asset
-
24Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset.meta
-
40Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineResources.cs
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Resources.meta
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassResources.asset.meta
-
27Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassResources.asset
-
23Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassResources.cs
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop.cs.meta
-
7Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoopProducer.cs
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoopProducer.cs.meta
-
12Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TileLightLoopProducer.cs.meta
-
86Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TileLightLoopProducer.cs
-
45Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/LightLoop.cs
-
23Assets/ScriptableRenderPipeline/HDRenderPipeline/DefaultCommonSettings.asset
-
9Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.asset.meta
-
51Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.asset
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineResources.cs.meta
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/DefaultCommonSettings.asset.meta
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/DefaultHDMaterial.mat
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/DefaultHDMaterial.mat.meta
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild.compute.meta
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/scrbound.compute.meta
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-bigtile.compute.meta
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-clustered.compute.meta
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/shadeopaque.compute.meta
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/cleardispatchindirect.compute
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/cleardispatchindirect.compute.meta
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-bigtile.compute
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/scrbound.compute
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild.compute
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-clustered.compute
-
0/Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/shadeopaque.compute
1001
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild.compute
文件差异内容过多而无法显示
查看文件
文件差异内容过多而无法显示
查看文件
|
|||
#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 |
|||
} |
|||
|
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 0cf1dab834d4ec34195b920ea7bbf9ec, type: 3} |
|||
m_Name: HDRenderPipelineAsset |
|||
m_EditorClassIdentifier: |
|||
m_RenderPipelineResources: {fileID: 11400000, guid: 42086e81f4f0c724f96f7f09cc995354, |
|||
type: 2} |
|||
renderingSettings: |
|||
useForwardRenderingOnly: 0 |
|||
useDepthPrepass: 0 |
|||
sssSettings: |
|||
numProfiles: 1 |
|||
profiles: |
|||
- {fileID: 0} |
|||
tileSettings: |
|||
enableTileAndCluster: 1 |
|||
enableSplitLightEvaluation: 1 |
|||
enableComputeLightEvaluation: 0 |
|||
enableComputeFeatureVariants: 0 |
|||
enableClustered: 1 |
|||
enableFptlForOpaqueWhenClustered: 1 |
|||
enableBigTilePrepass: 1 |
|||
diffuseGlobalDimmer: 1 |
|||
specularGlobalDimmer: 1 |
|||
tileDebugByCategory: 0 |
|||
m_ShadowSettings: |
|||
enabled: 1 |
|||
shadowAtlasWidth: 4096 |
|||
shadowAtlasHeight: 4096 |
|||
maxShadowDistance: 1000 |
|||
directionalLightCascadeCount: 4 |
|||
directionalLightCascades: {x: 0.05, y: 0.2, z: 0.3} |
|||
directionalLightNearPlaneOffset: 5 |
|||
m_TextureSettings: |
|||
spotCookieSize: 128 |
|||
pointCookieSize: 512 |
|||
reflectionCubemapSize: 128 |
|||
m_CommonSettings: |
|||
m_ShadowMaxDistance: 1000 |
|||
m_ShadowCascadeCount: 4 |
|||
m_ShadowCascadeSplit0: 0.05 |
|||
m_ShadowCascadeSplit1: 0.2 |
|||
m_ShadowCascadeSplit2: 0.3 |
|||
m_ShadowNearPlaneOffset: 5 |
|||
m_SkySettings: {fileID: 0} |
|||
m_DefaultDiffuseMaterial: {fileID: 0} |
|||
m_DefaultShader: {fileID: 0} |
|
|||
fileFormatVersion: 2 |
|||
guid: 449281dd2b4fbee49b8397de0541ea3c |
|||
timeCreated: 1496147291 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
mainObjectFileID: 11400000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using UnityEngine.Rendering; |
|||
using System; |
|||
using System.Linq; |
|||
using UnityEngine.Experimental.PostProcessing; |
|||
using UnityEngine.Experimental.Rendering.HDPipeline.TilePass; |
|||
|
|||
#if UNITY_EDITOR
|
|||
using UnityEditor; |
|||
#endif
|
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
// This HDRenderPipeline assume linear lighting. Don't work with gamma.
|
|||
public class HDRenderPipelineAsset : RenderPipelineAsset |
|||
{ |
|||
#if UNITY_EDITOR
|
|||
const string k_HDRenderPipelinePath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipelineAsset.asset"; |
|||
|
|||
[MenuItem("RenderPipeline/HDRenderPipeline/Create Pipeline Asset")] |
|||
static void CreateHDRenderPipeline() |
|||
{ |
|||
var instance = CreateInstance<HDRenderPipelineAsset>(); |
|||
AssetDatabase.CreateAsset(instance, k_HDRenderPipelinePath); |
|||
|
|||
// If it exist, load renderPipelineResources
|
|||
instance.renderPipelineResources = AssetDatabase.LoadAssetAtPath<RenderPipelineResources>(RenderPipelineResources.renderPipelineResourcesPath); |
|||
} |
|||
|
|||
[UnityEditor.MenuItem("HDRenderPipeline/Add \"Additional Light Data\" (if not present)")] |
|||
static void AddAdditionalLightData() |
|||
{ |
|||
Light[] lights = FindObjectsOfType(typeof(Light)) as Light[]; |
|||
|
|||
foreach (Light light in lights) |
|||
{ |
|||
// Do not add a component if there already is one.
|
|||
if (light.GetComponent<AdditionalLightData>() == null) |
|||
{ |
|||
light.gameObject.AddComponent<AdditionalLightData>(); |
|||
} |
|||
} |
|||
} |
|||
#endif
|
|||
|
|||
private HDRenderPipelineAsset() |
|||
{ } |
|||
|
|||
protected override IRenderPipeline InternalCreatePipeline() |
|||
{ |
|||
return new HDRenderPipeline(this); |
|||
} |
|||
|
|||
[SerializeField] |
|||
private RenderPipelineResources m_RenderPipelineResources; |
|||
public RenderPipelineResources renderPipelineResources |
|||
{ |
|||
get { return m_RenderPipelineResources; } |
|||
set { m_RenderPipelineResources = value; } |
|||
} |
|||
|
|||
// NOTE: All those properties are public because of how HDRenderPipelineInspector retrieve those properties via serialization/reflection
|
|||
// Doing it this way allow to change parameters name and still retrieve correct serialized value
|
|||
|
|||
// Debugging (Not persistent)
|
|||
public DebugDisplaySettings debugDisplaySettings = new DebugDisplaySettings(); |
|||
|
|||
// Renderer Settings (per project)
|
|||
public RenderingSettings renderingSettings = new RenderingSettings(); |
|||
public SubsurfaceScatteringSettings sssSettings = new SubsurfaceScatteringSettings(); |
|||
public TileSettings tileSettings = new TileSettings(); |
|||
|
|||
// TODO: Following two settings need to be update to the serialization/reflection way like above
|
|||
[SerializeField] |
|||
ShadowSettings m_ShadowSettings = ShadowSettings.Default; |
|||
[SerializeField] |
|||
TextureSettings m_TextureSettings = TextureSettings.Default; |
|||
|
|||
public ShadowSettings shadowSettings |
|||
{ |
|||
get { return m_ShadowSettings; } |
|||
} |
|||
|
|||
public TextureSettings textureSettings |
|||
{ |
|||
get { return m_TextureSettings; } |
|||
set { m_TextureSettings = value; } |
|||
} |
|||
|
|||
// NOTE: Following settings are Asset so they need to be serialized as usual. no reflection/serialization here
|
|||
|
|||
// Renderer Settings (per "scene")
|
|||
[SerializeField] |
|||
private CommonSettings.Settings m_CommonSettings = CommonSettings.Settings.s_Defaultsettings; |
|||
[SerializeField] |
|||
private SkySettings m_SkySettings; |
|||
|
|||
public CommonSettings.Settings commonSettingsToUse |
|||
{ |
|||
get |
|||
{ |
|||
if (CommonSettingsSingleton.overrideSettings) |
|||
return CommonSettingsSingleton.overrideSettings.settings; |
|||
|
|||
return m_CommonSettings; |
|||
} |
|||
} |
|||
|
|||
public SkySettings skySettings |
|||
{ |
|||
get { return m_SkySettings; } |
|||
set { m_SkySettings = value; } |
|||
} |
|||
|
|||
public SkySettings skySettingsToUse |
|||
{ |
|||
get |
|||
{ |
|||
if (SkySettingsSingleton.overrideSettings) |
|||
return SkySettingsSingleton.overrideSettings; |
|||
|
|||
return m_SkySettings; |
|||
} |
|||
} |
|||
|
|||
[SerializeField] |
|||
Material m_DefaultDiffuseMaterial; |
|||
[SerializeField] |
|||
Shader m_DefaultShader; |
|||
|
|||
public Material DefaultDiffuseMaterial |
|||
{ |
|||
get { return m_DefaultDiffuseMaterial; } |
|||
private set { m_DefaultDiffuseMaterial = value; } |
|||
} |
|||
|
|||
public Shader DefaultShader |
|||
{ |
|||
get { return m_DefaultShader; } |
|||
private set { m_DefaultShader = value; } |
|||
} |
|||
|
|||
public override Shader GetDefaultShader() |
|||
{ |
|||
return m_DefaultShader; |
|||
} |
|||
|
|||
public override Material GetDefaultMaterial() |
|||
{ |
|||
return m_DefaultDiffuseMaterial; |
|||
} |
|||
|
|||
public override Material GetDefaultParticleMaterial() |
|||
{ |
|||
return null; |
|||
} |
|||
|
|||
public override Material GetDefaultLineMaterial() |
|||
{ |
|||
return null; |
|||
} |
|||
|
|||
public override Material GetDefaultTerrainMaterial() |
|||
{ |
|||
return null; |
|||
} |
|||
|
|||
public override Material GetDefaultUIMaterial() |
|||
{ |
|||
return null; |
|||
} |
|||
|
|||
public override Material GetDefaultUIOverdrawMaterial() |
|||
{ |
|||
return null; |
|||
} |
|||
|
|||
public override Material GetDefaultUIETC1SupportedMaterial() |
|||
{ |
|||
return null; |
|||
} |
|||
|
|||
public override Material GetDefault2DMaterial() |
|||
{ |
|||
return null; |
|||
} |
|||
|
|||
public void ApplyDebugDisplaySettings() |
|||
{ |
|||
m_ShadowSettings.enabled = debugDisplaySettings.lightingDebugSettings.enableShadows; |
|||
|
|||
LightingDebugSettings lightingDebugSettings = debugDisplaySettings.lightingDebugSettings; |
|||
Vector4 debugAlbedo = new Vector4(lightingDebugSettings.debugLightingAlbedo.r, lightingDebugSettings.debugLightingAlbedo.g, lightingDebugSettings.debugLightingAlbedo.b, 0.0f); |
|||
Vector4 debugSmoothness = new Vector4(lightingDebugSettings.overrideSmoothness ? 1.0f : 0.0f, lightingDebugSettings.overrideSmoothnessValue, 0.0f, 0.0f); |
|||
|
|||
Shader.SetGlobalInt("_DebugViewMaterial", (int)debugDisplaySettings.GetDebugMaterialIndex()); |
|||
Shader.SetGlobalInt("_DebugLightingMode", (int)debugDisplaySettings.GetDebugLightingMode()); |
|||
Shader.SetGlobalVector("_DebugLightingAlbedo", debugAlbedo); |
|||
Shader.SetGlobalVector("_DebugLightingSmoothness", debugSmoothness); |
|||
} |
|||
|
|||
public void UpdateCommonSettings() |
|||
{ |
|||
var commonSettings = commonSettingsToUse; |
|||
|
|||
m_ShadowSettings.directionalLightCascadeCount = commonSettings.shadowCascadeCount; |
|||
m_ShadowSettings.directionalLightCascades = new Vector3(commonSettings.shadowCascadeSplit0, commonSettings.shadowCascadeSplit1, commonSettings.shadowCascadeSplit2); |
|||
m_ShadowSettings.maxShadowDistance = commonSettings.shadowMaxDistance; |
|||
m_ShadowSettings.directionalLightNearPlaneOffset = commonSettings.shadowNearPlaneOffset; |
|||
} |
|||
|
|||
public void OnValidate() |
|||
{ |
|||
debugDisplaySettings.OnValidate(); |
|||
sssSettings.OnValidate(); |
|||
} |
|||
|
|||
void OnEnable() |
|||
{ |
|||
debugDisplaySettings.RegisterDebug(); |
|||
} |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 0cf1dab834d4ec34195b920ea7bbf9ec |
|||
timeCreated: 1496139874 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 2059a21bd962b3b4296d74ce1a6f7b9b |
|||
folderAsset: yes |
|||
timeCreated: 1496132665 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: bc357c46587fc9d4cb8f311794d7d2f3, type: 3} |
|||
m_Name: DefaultCommonSettings |
|||
m_EditorClassIdentifier: |
|||
m_Settings: |
|||
m_ShadowMaxDistance: 1000 |
|||
m_ShadowCascadeCount: 4 |
|||
m_ShadowCascadeSplit0: 0.05 |
|||
m_ShadowCascadeSplit1: 0.2 |
|||
m_ShadowCascadeSplit2: 0.3 |
|||
m_ShadowNearPlaneOffset: 5 |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 8b6f86e1523e69a4282e92d393be89a4, type: 3} |
|||
m_Name: HDRenderPipelineResources |
|||
m_EditorClassIdentifier: |
|||
clearDispatchIndirectShader: {fileID: 7200000, guid: fc1f553acb80a6446a32d33e403d0656, |
|||
type: 3} |
|||
buildScreenAABBShader: {fileID: 7200000, guid: 728dce960f8a9c44bbc3abb3b851d8f6, |
|||
type: 3} |
|||
buildPerTileLightListShader: {fileID: 7200000, guid: 65af3444cbf4b3747a4dead7ee00cfee, |
|||
type: 3} |
|||
buildPerBigTileLightListShader: {fileID: 7200000, guid: 5ee1f9d6e09abe045b2f5e0b784b9072, |
|||
type: 3} |
|||
buildPerVoxelLightListShader: {fileID: 7200000, guid: 0bb1b7e0ddcd5c44baf3ddc7456eb196, |
|||
type: 3} |
|||
shadeOpaqueShader: {fileID: 7200000, guid: 0b64f79746d2daf4198eaf6eab9af259, type: 3} |
|
|||
fileFormatVersion: 2 |
|||
guid: 42086e81f4f0c724f96f7f09cc995354 |
|||
timeCreated: 1496134738 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
mainObjectFileID: 11400000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class RenderPipelineResources : ScriptableObject |
|||
{ |
|||
#if UNITY_EDITOR
|
|||
public const string renderPipelineResourcesPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset"; |
|||
|
|||
public const string clearDispatchIndirectShaderPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/cleardispatchindirect.compute"; |
|||
public const string buildScreenAABBShaderPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/scrbound.compute"; |
|||
public const string buildPerTileLightListShaderPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild.compute"; |
|||
public const string buildPerBigTileLightListShaderPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-bigtile.compute"; |
|||
public const string buildPerVoxelLightListShaderPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/lightlistbuild-clustered.compute"; |
|||
public const string shadeOpaqueShaderPath = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/shadeopaque.compute"; |
|||
|
|||
[UnityEditor.MenuItem("RenderPipeline/HDRenderPipeline/Create Resources Asset")] |
|||
static void CreateRenderPipelineResources() |
|||
{ |
|||
var instance = CreateInstance<RenderPipelineResources>(); |
|||
|
|||
instance.clearDispatchIndirectShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>(clearDispatchIndirectShaderPath); |
|||
instance.buildScreenAABBShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>(buildScreenAABBShaderPath); |
|||
instance.buildPerTileLightListShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>(buildPerTileLightListShaderPath); |
|||
instance.buildPerBigTileLightListShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>(buildPerBigTileLightListShaderPath); |
|||
instance.buildPerVoxelLightListShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>(buildPerVoxelLightListShaderPath); |
|||
instance.shadeOpaqueShader = UnityEditor.AssetDatabase.LoadAssetAtPath<ComputeShader>(shadeOpaqueShaderPath); |
|||
|
|||
UnityEditor.AssetDatabase.CreateAsset(instance, renderPipelineResourcesPath); |
|||
UnityEditor.AssetDatabase.SaveAssets(); |
|||
UnityEditor.AssetDatabase.Refresh(); |
|||
} |
|||
#endif
|
|||
// Tile pass resources
|
|||
public ComputeShader clearDispatchIndirectShader = null; |
|||
public ComputeShader buildScreenAABBShader = null; |
|||
public ComputeShader buildPerTileLightListShader = null; // FPTL
|
|||
public ComputeShader buildPerBigTileLightListShader = null; |
|||
public ComputeShader buildPerVoxelLightListShader = null; // clustered
|
|||
public ComputeShader shadeOpaqueShader = null; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 10637537837597a41861afbe118b246a |
|||
folderAsset: yes |
|||
timeCreated: 1479306736 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 7f2998544b2ac3848822b80ec3e6c446 |
|||
timeCreated: 1485857936 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
mainObjectFileID: 11400000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: 8b6f86e1523e69a4282e92d393be89a4, type: 3} |
|||
m_Name: TilePassResources |
|||
m_EditorClassIdentifier: |
|||
buildScreenAABBShader: {fileID: 7200000, guid: 728dce960f8a9c44bbc3abb3b851d8f6, |
|||
type: 3} |
|||
buildPerTileLightListShader: {fileID: 7200000, guid: 65af3444cbf4b3747a4dead7ee00cfee, |
|||
type: 3} |
|||
buildPerBigTileLightListShader: {fileID: 7200000, guid: 5ee1f9d6e09abe045b2f5e0b784b9072, |
|||
type: 3} |
|||
buildPerVoxelLightListShader: {fileID: 7200000, guid: 0bb1b7e0ddcd5c44baf3ddc7456eb196, |
|||
type: 3} |
|||
clearDispatchIndirectShader: {fileID: 7200000, guid: fc1f553acb80a6446a32d33e403d0656, |
|||
type: 3} |
|||
shadeOpaqueShader: {fileID: 7200000, guid: 0b64f79746d2daf4198eaf6eab9af259, type: 3} |
|||
m_DebugViewMaterialGBuffer: {fileID: 4800000, guid: 439949ea1bfa91b4ba0d04269fcde33d, |
|||
type: 3} |
|||
m_InitPreFGD: {fileID: 4800000, guid: 123f13d52852ef547b2962de4bd9eaad, type: 3} |
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class TilePassResources : ScriptableObject |
|||
{ |
|||
#if UNITY_EDITOR
|
|||
public const string tilePassResources = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassResources.asset"; |
|||
|
|||
[UnityEditor.MenuItem("HDRenderPipeline/TilePass/CreateTilePassResources")] |
|||
static void CreateTilePassSetup() |
|||
{ |
|||
var instance = CreateInstance<TilePassResources>(); |
|||
UnityEditor.AssetDatabase.CreateAsset(instance, tilePassResources); |
|||
} |
|||
|
|||
#endif
|
|||
public ComputeShader buildScreenAABBShader = null; |
|||
public ComputeShader buildPerTileLightListShader = null; // FPTL
|
|||
public ComputeShader buildPerBigTileLightListShader = null; |
|||
public ComputeShader buildPerVoxelLightListShader = null; // clustered
|
|||
public ComputeShader clearDispatchIndirectShader = null; |
|||
public ComputeShader shadeOpaqueShader = null; |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: 1669ef5a164969c4c90cd3509b01123d |
|||
timeCreated: 1481066258 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public abstract class LightLoopProducer : ScriptableObject |
|||
{ |
|||
public abstract BaseLightLoop CreateLightLoop(); |
|||
} |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: dd4610bf13505b241bca4b8f5debfec4 |
|||
timeCreated: 1485446979 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 31c50a63970c0c843ab7cbf7d67d5b33 |
|||
timeCreated: 1485446978 |
|||
licenseType: Pro |
|||
MonoImporter: |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
using System; |
|||
#if UNITY_EDITOR
|
|||
using UnityEditor; |
|||
#endif
|
|||
using UnityEngine.Experimental.Rendering.HDPipeline.TilePass; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class TileLightLoopProducer : LightLoopProducer |
|||
{ |
|||
#if UNITY_EDITOR
|
|||
public const string TilePassProducer = "Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePassProducer.asset"; |
|||
|
|||
[UnityEditor.MenuItem("HDRenderPipeline/TilePass/Create TileLightLoopProducer")] |
|||
static void CreateTileLightLoopProducer() |
|||
{ |
|||
var instance = CreateInstance<TileLightLoopProducer>(); |
|||
UnityEditor.AssetDatabase.CreateAsset(instance, TilePassProducer); |
|||
|
|||
|
|||
instance.m_PassResources = AssetDatabase.LoadAssetAtPath<TilePassResources>(TilePassResources.tilePassResources); |
|||
} |
|||
|
|||
#endif
|
|||
[Serializable] |
|||
public class TileSettings |
|||
{ |
|||
public bool enableTileAndCluster; // For debug / test
|
|||
public bool enableSplitLightEvaluation; |
|||
public bool enableComputeLightEvaluation; |
|||
public bool enableComputeFeatureVariants; |
|||
|
|||
// clustered light list specific buffers and data begin
|
|||
public bool enableClustered; |
|||
public bool enableFptlForOpaqueWhenClustered; // still useful on opaques. Should be true by default to force tile on opaque.
|
|||
public bool enableBigTilePrepass; |
|||
|
|||
[Range(0.0f, 1.0f)] |
|||
public float diffuseGlobalDimmer = 1.0f; |
|||
[Range(0.0f, 1.0f)] |
|||
public float specularGlobalDimmer = 1.0f; |
|||
|
|||
public enum TileDebug : int { None = 0, Punctual = 1, Area = 2, AreaAndPunctual = 3, Projector = 4, ProjectorAndPunctual = 5, ProjectorAndArea = 6, ProjectorAndAreaAndPunctual = 7, |
|||
Environment = 8, EnvironmentAndPunctual = 9, EnvironmentAndArea = 10, EnvironemntAndAreaAndPunctual = 11, |
|||
EnvironmentAndProjector = 12, EnvironmentAndProjectorAndPunctual = 13, EnvironmentAndProjectorAndArea = 14, EnvironmentAndProjectorAndAreaAndPunctual = 15, |
|||
FeatureVariants = 16 }; //TODO: we should probably make this checkboxes
|
|||
public TileDebug tileDebugByCategory; |
|||
|
|||
public static TileSettings defaultSettings = new TileSettings |
|||
{ |
|||
enableTileAndCluster = true, |
|||
enableSplitLightEvaluation = true, |
|||
enableComputeLightEvaluation = false, |
|||
enableComputeFeatureVariants = false, |
|||
|
|||
tileDebugByCategory = TileDebug.None, |
|||
enableClustered = true, |
|||
enableFptlForOpaqueWhenClustered = true, |
|||
enableBigTilePrepass = true, |
|||
}; |
|||
} |
|||
|
|||
[SerializeField] |
|||
private TileSettings m_TileSettings = TileSettings.defaultSettings; |
|||
|
|||
public TileSettings tileSettings |
|||
{ |
|||
get { return m_TileSettings; } |
|||
set { m_TileSettings = value; } |
|||
} |
|||
|
|||
[SerializeField] |
|||
private TilePassResources m_PassResources; |
|||
|
|||
public TilePassResources passResources |
|||
{ |
|||
get { return m_PassResources; } |
|||
set { m_PassResources = value; } |
|||
} |
|||
|
|||
public override BaseLightLoop CreateLightLoop() |
|||
{ |
|||
return new LightLoop(this); |
|||
} |
|||
} |
|||
} |
|
|||
using UnityEngine; |
|||
using UnityEngine.Rendering; |
|||
|
|||
namespace UnityEngine.Experimental.Rendering.HDPipeline |
|||
{ |
|||
public class BaseLightLoop |
|||
{ |
|||
protected Light m_CurrentSunLight = null; |
|||
|
|||
// TODO: We should rather put the texture settings in LightLoop, but how do we serialize it ?
|
|||
public virtual void Build(TextureSettings textureSettings) {} |
|||
|
|||
public virtual void Cleanup() {} |
|||
|
|||
public virtual bool NeedResize() { return false; } |
|||
|
|||
public virtual void AllocResolutionDependentBuffers(int width, int height) {} |
|||
|
|||
public virtual void ReleaseResolutionDependentBuffers() {} |
|||
|
|||
public virtual void NewFrame() {} |
|||
|
|||
public virtual int GetCurrentShadowCount() { return 0; } |
|||
|
|||
public virtual void UpdateCullingParameters( ref CullingParameters cullingParams ) {} |
|||
public virtual void PrepareLightsForGPU(ShadowSettings shadowSettings, CullResults cullResults, Camera camera) {} |
|||
public virtual void RenderShadows(ScriptableRenderContext renderContext, CullResults cullResults) {} |
|||
|
|||
// TODO: this should not be part of the interface but for now make something working
|
|||
public virtual void BuildGPULightLists(Camera camera, ScriptableRenderContext renderContext, RenderTargetIdentifier cameraDepthBufferRT) {} |
|||
|
|||
public virtual void RenderDeferredLighting( HDCamera hdCamera, ScriptableRenderContext renderContext, |
|||
DebugDisplaySettings debugDisplaySettings, |
|||
RenderTargetIdentifier[] colorBuffers, RenderTargetIdentifier depthStencilBuffer, RenderTargetIdentifier depthStencilTexture, |
|||
bool outputSplitLightingForSSS) { } |
|||
|
|||
public virtual void RenderForward(Camera camera, ScriptableRenderContext renderContext, bool renderOpaque) {} |
|||
|
|||
public virtual void RenderLightingDebug(HDCamera hdCamera, ScriptableRenderContext renderContext, RenderTargetIdentifier colorBuffer) {} |
|||
|
|||
public Light GetCurrentSunLight() { return m_CurrentSunLight; } |
|||
|
|||
public virtual void RenderDebugOverlay(Camera camera, ScriptableRenderContext renderContext, DebugDisplaySettings debugDisplaySettings, ref float x, ref float y, float overlaySize, float width) { } |
|||
} |
|||
} |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: bc357c46587fc9d4cb8f311794d7d2f3, type: 3} |
|||
m_Name: DefaultCommonSettings |
|||
m_EditorClassIdentifier: |
|||
m_Settings: |
|||
m_ShadowMaxDistance: 1000 |
|||
m_ShadowCascadeCount: 4 |
|||
m_ShadowCascadeSplit0: 0.05 |
|||
m_ShadowCascadeSplit1: 0.2 |
|||
m_ShadowCascadeSplit2: 0.3 |
|||
m_SssProfileStdDev1: {r: 0.3, g: 0.3, b: 0.3, a: 0} |
|||
m_SssProfileStdDev2: {r: 1, g: 1, b: 1, a: 0} |
|||
m_SssProfileLerpWeight: 0.5 |
|||
m_SssBilateralScale: 0.1 |
|
|||
fileFormatVersion: 2 |
|||
guid: e185fecca3c73cd47a09f1092663ef32 |
|||
timeCreated: 1487689448 |
|||
licenseType: Pro |
|||
NativeFormatImporter: |
|||
mainObjectFileID: 11400000 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
%YAML 1.1 |
|||
%TAG !u! tag:unity3d.com,2011: |
|||
--- !u!114 &11400000 |
|||
MonoBehaviour: |
|||
m_ObjectHideFlags: 0 |
|||
m_PrefabParentObject: {fileID: 0} |
|||
m_PrefabInternal: {fileID: 0} |
|||
m_GameObject: {fileID: 0} |
|||
m_Enabled: 1 |
|||
m_EditorHideFlags: 0 |
|||
m_Script: {fileID: 11500000, guid: f365a473b136bef4797c7281a02cd510, type: 3} |
|||
m_Name: HDRenderPipeline |
|||
m_EditorClassIdentifier: |
|||
m_LightLoopProducer: {fileID: 11400000, guid: bf8cd9ae03ff7d54c89603e67be0bfc5, |
|||
type: 2} |
|||
renderingSettings: |
|||
useForwardRenderingOnly: 0 |
|||
useDepthPrepass: 0 |
|||
sssSettings: |
|||
numProfiles: 7 |
|||
profiles: |
|||
- {fileID: 11400000, guid: d6ee4403015766f4093158d69216c0bf, type: 2} |
|||
- {fileID: 11400000, guid: 906339bac2066fc4aa22a3652e1283ef, type: 2} |
|||
- {fileID: 0} |
|||
- {fileID: 0} |
|||
- {fileID: 0} |
|||
- {fileID: 0} |
|||
- {fileID: 0} |
|||
m_ShadowSettings: |
|||
enabled: 1 |
|||
shadowAtlasWidth: 4096 |
|||
shadowAtlasHeight: 4096 |
|||
maxShadowDistance: 400 |
|||
directionalLightCascadeCount: 4 |
|||
directionalLightCascades: {x: 0.05, y: 0.2, z: 0.3} |
|||
directionalLightNearPlaneOffset: 5 |
|||
m_TextureSettings: |
|||
spotCookieSize: 128 |
|||
pointCookieSize: 512 |
|||
reflectionCubemapSize: 128 |
|||
m_CommonSettings: |
|||
m_ShadowMaxDistance: 1000 |
|||
m_ShadowCascadeCount: 4 |
|||
m_ShadowCascadeSplit0: 0.05 |
|||
m_ShadowCascadeSplit1: 0.2 |
|||
m_ShadowCascadeSplit2: 0.3 |
|||
m_ShadowNearPlaneOffset: 5 |
|||
m_SkySettings: {fileID: 0} |
|||
m_DefaultDiffuseMaterial: {fileID: 2100000, guid: 73c176f402d2c2f4d929aa5da7585d17, |
|||
type: 2} |
|||
m_DefaultShader: {fileID: 4800000, guid: 6e4ae4064600d784cac1e41a9e6f2e59, type: 3} |
撰写
预览
正在加载...
取消
保存
Reference in new issue