浏览代码

Added checkbox for enabling Tile Debug Visualization

/main
runes 8 年前
当前提交
344748a4
共有 2 个文件被更改,包括 9 次插入1 次删除
  1. 5
      Assets/ScriptableRenderLoop/fptl/FptlLighting.cs
  2. 5
      Assets/ScriptableRenderLoop/fptl/Internal-DeferredShading.shader

5
Assets/ScriptableRenderLoop/fptl/FptlLighting.cs


// clustered light list specific buffers and data begin
public bool enableClustered = false;
public bool enableDrawLightBoundsDebug = false;
public bool enableDrawTileDebug = false;
const bool k_UseDepthBuffer = true;// // only has an impact when EnableClustered is true (requires a depth-prepass)
const bool disableFptlWhenClustered = false; // still useful on opaques
const int k_Log2NumClusters = 6; // accepted range is from 0 to 6. NumClusters is 1<<g_iLog2NumClusters

m_DeferredMaterial.EnableKeyword(bUseClusteredForDeferred ? "USE_CLUSTERED_LIGHTLIST" : "USE_FPTL_LIGHTLIST");
m_DeferredReflectionMaterial.EnableKeyword(bUseClusteredForDeferred ? "USE_CLUSTERED_LIGHTLIST" : "USE_FPTL_LIGHTLIST");
if (enableDrawTileDebug)
m_DeferredMaterial.EnableKeyword("ENABLE_DEBUG");
else
m_DeferredMaterial.DisableKeyword("ENABLE_DEBUG");
cmd.SetGlobalBuffer("g_vLightListGlobal", bUseClusteredForDeferred ? s_PerVoxelLightLists : s_LightList); // opaques list (unless MSAA possibly)

5
Assets/ScriptableRenderLoop/fptl/Internal-DeferredShading.shader


#pragma fragment frag
#pragma multi_compile USE_FPTL_LIGHTLIST USE_CLUSTERED_LIGHTLIST
#pragma multi_compile __ ENABLE_DEBUG
#include "UnityLightingCommon.cginc"

uint numLightsProcessed = 0;
float3 c = data.emission + ExecuteLightList(numLightsProcessed, pixCoord, vP, vPw, Vworld);
//c = OverlayHeatMap(pixCoord & 15, numLightsProcessed, c);
#if ENABLE_DEBUG
c = OverlayHeatMap(pixCoord & 15, numLightsProcessed, c);
#endif
return float4(c,1.0);
}

正在加载...
取消
保存