浏览代码

Address the PR feedback

/main
Evgenii Golubev 7 年前
当前提交
be59f96a
共有 5 个文件被更改,包括 14 次插入15 次删除
  1. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/Deferred.shader
  2. 20
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/Deferred.compute
  3. 3
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl
  4. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassForward.hlsl
  5. 2
      ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderVariables.hlsl

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


Outputs outputs;
#ifdef OUTPUT_SPLIT_LIGHTING
if (PixelHasSubsurfaceScattering(bsdfData))
if (_EnableSubsurfaceScattering != 0 && PixelHasSubsurfaceScattering(bsdfData))
{
outputs.specularLighting = float4(specularLighting, 1.0);
outputs.diffuseLighting = TagLightingForSSS(diffuseLighting);

20
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Lighting/LightLoop/Deferred.compute


StructuredBuffer<uint> g_TileList;
// Indirect
[numthreads(16, 16, 1)]
[numthreads(TILE_SIZE_FPTL, TILE_SIZE_FPTL, 1)]
uint tileIndex = g_TileList[g_TileListOffset + groupId];
uint2 tileCoord = uint2(tileIndex & 0xFFFF, tileIndex >> 16);
uint2 pixelCoord = tileCoord * GetTileSize() + groupThreadId;
uint tileIndex = g_TileList[g_TileListOffset + groupId];
uint2 tileCoord = uint2(tileIndex & ((1 << TILE_SIZE_FPTL) - 1), tileIndex >> TILE_SIZE_FPTL);
uint2 pixelCoord = tileCoord * GetTileSize() + groupThreadId;
uint numTilesX = (screenWidth + 15) / 16;
uint numTilesX = (screenWidth + (TILE_SIZE_FPTL) - 1) / TILE_SIZE_FPTL;
[numthreads(16, 16, 1)]
[numthreads(TILE_SIZE_FPTL, TILE_SIZE_FPTL, 1)]
uint2 tileCoord = (16 * groupId) / GetTileSize();
uint2 pixelCoord = dispatchThreadId;
uint featureFlags = UINT_MAX;
uint2 tileCoord = (TILE_SIZE_FPTL * groupId) / GetTileSize();
uint2 pixelCoord = dispatchThreadId;
uint featureFlags = UINT_MAX;
#endif

float3 specularLighting;
LightLoop(V, posInput, preLightData, bsdfData, bakeLightingData, featureFlags, diffuseLighting, specularLighting);
if (PixelHasSubsurfaceScattering(bsdfData))
if (_EnableSubsurfaceScattering != 0 && PixelHasSubsurfaceScattering(bsdfData))
{
specularLightingUAV[pixelCoord] = float4(specularLighting, 1.0);
diffuseLightingUAV[pixelCoord] = TagLightingForSSS(diffuseLighting);

3
ScriptableRenderPipeline/HDRenderPipeline/HDRP/Material/Lit/Lit.hlsl


bool PixelHasSubsurfaceScattering(BSDFData bsdfData)
{
return (_EnableSubsurfaceScattering * bsdfData.subsurfaceMask != 0) &&
HasFeatureFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING);
return bsdfData.subsurfaceMask != 0 && HasFeatureFlag(bsdfData.materialFeatures, MATERIALFEATUREFLAGS_LIT_SUBSURFACE_SCATTERING);
}
//-----------------------------------------------------------------------------

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderPass/ShaderPassForward.hlsl


LightLoop(V, posInput, preLightData, bsdfData, bakeLightingData, featureFlags, diffuseLighting, specularLighting);
#ifdef OUTPUT_SPLIT_LIGHTING
if (PixelHasSubsurfaceScattering(bsdfData))
if (_EnableSubsurfaceScattering != 0 && PixelHasSubsurfaceScattering(bsdfData))
{
outColor = float4(specularLighting, 1.0);
outDiffuseLighting = float4(TagLightingForSSS(diffuseLighting), 1.0);

2
ScriptableRenderPipeline/HDRenderPipeline/HDRP/ShaderVariables.hlsl


float4 unity_ShadowColor;
float2 _TaaFrameRotation; // {x = sin(_TaaFrameIndex * PI/2), y = cos(_TaaFrameIndex * PI/2), z = unused}
uint _TaaFrameIndex; // [0, 7]
uint _Align128;
uint _Align128; // Pad for 128-bit alignment
// Volumetric lighting. Should be a struct in 'UnityPerFrame'.
// Unfortunately, structures inside constant buffers are not supported by Unity.
float3 _GlobalFog_Scattering;

正在加载...
取消
保存