浏览代码
Split directional shadow resolution in a different pass to reduce VGPR pressure during tile lighting.
/main
Split directional shadow resolution in a different pass to reduce VGPR pressure during tile lighting.
/main
Julien Ignace
7 年前
当前提交
d4b9dd15
共有 16 个文件被更改,包括 258 次插入 和 52 次删除
-
96SampleScenes/HDTest/ShadowsTest.unity
-
41ScriptableRenderPipeline/Core/ShaderLibrary/Shadow/ShadowAlgorithms.hlsl
-
11ScriptableRenderPipeline/Core/Shadow/Shadow.cs
-
1ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs
-
13ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugDisplay.cs.hlsl
-
5ScriptableRenderPipeline/HDRenderPipeline/Debug/DebugFullScreen.shader
-
28ScriptableRenderPipeline/HDRenderPipeline/HDRenderPipeline.cs
-
4ScriptableRenderPipeline/HDRenderPipeline/HDShaderIDs.cs
-
55ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/TilePass.cs
-
2ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
-
2ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset
-
2ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/RenderPipelineResources.cs
-
2ScriptableRenderPipeline/HDRenderPipeline/ShaderVariables.hlsl
-
10SampleScenes/HDTest/ShadowsTest.meta
-
28ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/DeferredDirectionalShadow.compute
-
10ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/DeferredDirectionalShadow.compute.meta
|
|||
fileFormatVersion: 2 |
|||
guid: 37b64947bf0ad024fb931d24f17a52b7 |
|||
folderAsset: yes |
|||
timeCreated: 1504864302 |
|||
licenseType: Pro |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
// Each #kernel tells which function to compile; you can have many kernels |
|||
#pragma kernel DeferredDirectionalShadow |
|||
|
|||
#include "../../../Core/ShaderLibrary/Common.hlsl" |
|||
#include "../../ShaderVariables.hlsl" |
|||
#include "../../Lighting/Lighting.hlsl" |
|||
|
|||
RWTexture2D<float4> _DeferredShadowTextureUAV; |
|||
float _DirectionalShadowIndex; |
|||
|
|||
#define DEFERRED_SHADOW_TILE_SIZE 16 |
|||
|
|||
[numthreads(DEFERRED_SHADOW_TILE_SIZE, DEFERRED_SHADOW_TILE_SIZE, 1)] |
|||
void DeferredDirectionalShadow(uint2 groupThreadId : SV_GroupThreadID, uint2 groupId : SV_GroupID) |
|||
{ |
|||
uint2 pixelCoord = groupId * DEFERRED_SHADOW_TILE_SIZE + groupThreadId; |
|||
uint2 tileCoord = groupId; |
|||
|
|||
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, tileCoord); |
|||
|
|||
float depth = LOAD_TEXTURE2D(_MainDepthTexture, posInput.unPositionSS).x; |
|||
UpdatePositionInput(depth, _InvViewProjMatrix, _ViewProjMatrix, posInput); |
|||
|
|||
ShadowContext shadowContext = InitShadowContext(); |
|||
float shadow = GetDirectionalShadowAttenuation(shadowContext, posInput.positionWS, float3(0.0, 0.0, 0.0), (uint)_DirectionalShadowIndex, float3(0.0, 0.0, 0.0)); |
|||
|
|||
_DeferredShadowTextureUAV[pixelCoord] = float4(shadow.xxx, 0.0); |
|||
} |
|
|||
fileFormatVersion: 2 |
|||
guid: fbde6fae193b2a94e9fd97c163c204f4 |
|||
timeCreated: 1505129983 |
|||
licenseType: Pro |
|||
ComputeShaderImporter: |
|||
externalObjects: {} |
|||
currentAPIMask: 8196 |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue