浏览代码

HDRenderPipeline: A bit more cleanup and minor fix

/RenderPassXR_Sandbox
sebastienlagarde 7 年前
当前提交
eb67ed8f
共有 4 个文件被更改,包括 16 次插入7 次删除
  1. 2
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader
  2. 14
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Deferred.compute
  3. 4
      Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl
  4. 3
      Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset

2
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/Deferred.shader


Outputs Frag(Varyings input)
{
// This need to stay in sync with deferred.compute
// input.positionCS is SV_Position
PositionInputs posInput = GetPositionInput(input.positionCS.xy, _ScreenSize.zw, uint2(input.positionCS.xy) / GetTileSize());
float depth = LOAD_TEXTURE2D(_MainDepthTexture, posInput.unPositionSS).x;

14
Assets/ScriptableRenderPipeline/HDRenderPipeline/Lighting/TilePass/Deferred.compute


RWTexture2D<float3> diffuseLightingUAV;
RWTexture2D<float4> specularLightingUAV;
CBUFFER_START(UnityShadeOpaque)
CBUFFER_START(UnityDeferredCompute)
StructuredBuffer<uint> g_TileList;
StructuredBuffer<uint> g_TileList;
// Indirect
[numthreads(16, 16, 1)]
void SHADE_OPAQUE_ENTRY(uint2 groupThreadId : SV_GroupThreadID, uint groupId : SV_GroupID)

uint2 pixelCoord = tileCoord * GetTileSize() + groupThreadId;
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, tileCoord);
uint2 tileCoord = groupId;
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, groupId);
// This need to stay in sync with deferred.shader
PositionInputs posInput = GetPositionInput(pixelCoord.xy, _ScreenSize.zw, tileCoord);
float depth = LOAD_TEXTURE2D(_MainDepthTexture, posInput.unPositionSS).x;

4
Assets/ScriptableRenderPipeline/HDRenderPipeline/Material/Lit/Lit.hlsl


(packedGBuffer1 & 0x0000FFFF),
(packedGBuffer1 & 0xFFFF0000) >> 16);
uint packedGBuffer3 = PackR11G11B10f(outGBuffer3.xyz);
uint packedGBuffer3 = PackToR11G11B10f(outGBuffer3.xyz);
outGBufferU1 = uint4( PackFloatToUInt(outGBuffer2.x, 8, 0) | PackFloatToUInt(outGBuffer2.y, 8, 8),
PackFloatToUInt(outGBuffer2.z, 8, 0) | PackFloatToUInt(outGBuffer2.w, 8, 8),

inGBuffer2.w = UnpackUIntToFloat(inGBufferU1.y, 8, 8);
uint packedGBuffer3 = inGBufferU1.z | inGBufferU1.w << 16;
inGBuffer3.xyz = UnpackR11G11B10f(packedGBuffer1);
inGBuffer3.xyz = UnpackFromR11G11B10f(packedGBuffer1);
inGBuffer3.w = 0.0;
#endif

3
Assets/ScriptableRenderPipeline/HDRenderPipeline/RenderPipelineResources/HDRenderPipelineResources.asset


type: 3}
buildMaterialFlagsShader: {fileID: 7200000, guid: fb3eda953cd6e634e877fb777be2cd08,
type: 3}
shadeOpaqueShader: {fileID: 7200000, guid: 0b64f79746d2daf4198eaf6eab9af259, type: 3}
deferredComputeShader: {fileID: 7200000, guid: 0b64f79746d2daf4198eaf6eab9af259,
type: 3}
cameraMotionVectors: {fileID: 4800000, guid: 035941b63024d1943af48811c1db20d9, type: 3}
blitCubemap: {fileID: 4800000, guid: d05913e251bed7a4992c921c62e1b647, type: 3}
buildProbabilityTables: {fileID: 7200000, guid: b9f26cf340afe9145a699753531b2a4c,

正在加载...
取消
保存