浏览代码

added debug view for reflections in fptl SRL

/main
Filip Iliescu 8 年前
当前提交
e3544e2d
共有 2 个文件被更改,包括 17 次插入5 次删除
  1. 16
      Assets/ScriptableRenderLoop/fptl/FptlLighting.cs
  2. 6
      Assets/ScriptableRenderLoop/fptl/Internal-DeferredReflections.shader

16
Assets/ScriptableRenderLoop/fptl/FptlLighting.cs


public bool enableBigTilePrepass = true;
public bool enableDrawLightBoundsDebug = false;
public bool enableDrawTileDebug = false;
public bool enableReflectionProbeDebug = false;
public bool enableComputeLightEvaluation = false;
const bool k_UseDepthBuffer = true;// // only has an impact when EnableClustered is true (requires a depth-prepass)
const bool k_UseAsyncCompute = true; // should not use on mobile

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");
if (enableDrawTileDebug) {
m_DeferredMaterial.EnableKeyword ("ENABLE_DEBUG");
} else {
m_DeferredMaterial.DisableKeyword ("ENABLE_DEBUG");
}
if (enableReflectionProbeDebug) {
m_DeferredReflectionMaterial.EnableKeyword ("ENABLE_DEBUG");
} else {
m_DeferredReflectionMaterial.DisableKeyword ("ENABLE_DEBUG");
}
cmd.SetGlobalBuffer("g_vLightListGlobal", bUseClusteredForDeferred ? s_PerVoxelLightLists : s_LightList); // opaques list (unless MSAA possibly)

6
Assets/ScriptableRenderLoop/fptl/Internal-DeferredReflections.shader


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

uint numReflectionsProcessed = 0;
float3 c = ExecuteReflectionList(numReflectionsProcessed, pixCoord, vP, data.normalWorld, Vworld, data.smoothness);
//c = OverlayHeatMap(numLightsProcessed, c);
#if ENABLE_DEBUG
c = OverlayHeatMap(pixCoord & 15, numReflectionsProcessed, c);
#endif
return float4(c,1.0);
}

正在加载...
取消
保存