Skip to content

Commit eb4c706

Browse files
Merge pull request #34 from Unity-Technologies/Refactor-lightloop
Refactor lightloop
2 parents 8d423a8 + c7367bc commit eb4c706

25 files changed

+1271
-1342
lines changed

Assets/ScriptableRenderLoop/HDRenderLoop/Debug/Resources/DebugViewTiles.shader

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,16 @@ Shader "Hidden/HDRenderLoop/DebugViewTiles"
101101
#endif
102102

103103
int n = 0;
104-
for(int category = 0; category < NR_LIGHT_CATEGORIES; category++)
104+
for (int category = 0; category < LIGHTCATEGORY_COUNT; category++)
105105
{
106106
uint mask = 1u << category;
107-
uint start;
108-
uint count;
109-
GetCountAndStart(coord, category, linearDepth, start, count);
110-
n += count;
107+
if (mask & _ViewTilesFlags)
108+
{
109+
uint start;
110+
uint count;
111+
GetCountAndStart(coord, category, linearDepth, start, count);
112+
n += count;
113+
}
111114
}
112115

113116
if (n > 0)

Assets/ScriptableRenderLoop/HDRenderLoop/Editor/HDRenderLoopInspector.cs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ private class Styles
2020

2121
public readonly GUIContent useForwardRenderingOnly = new GUIContent("Use Forward Rendering Only");
2222
public readonly GUIContent useDepthPrepass = new GUIContent("Use Depth Prepass");
23-
public readonly GUIContent useSinglePassLightLoop = new GUIContent("Use single Pass light loop");
2423

2524
public bool isDebugViewMaterialInit = false;
2625
public GUIContent[] debugViewMaterialStrings = null;
@@ -45,10 +44,12 @@ private class Styles
4544
public readonly GUIContent shadowsCascades = new GUIContent("Cascade values");
4645

4746
public readonly GUIContent tileLightLoopSettings = new GUIContent("Tile Light Loop settings");
48-
public readonly string[] tileLightLoopDebugTileFlagStrings = new string[] { "Direct Light", "Reflection Light", "Area Light"};
49-
public readonly GUIContent directIndirectSinglePass = new GUIContent("Enable direct and indirect lighting in single pass", "Toggle");
47+
public readonly string[] tileLightLoopDebugTileFlagStrings = new string[] { "Punctual Light", "Area Light", "Env Light"};
48+
public readonly GUIContent splitLightEvaluation = new GUIContent("Split light and reflection evaluation", "Toggle");
5049
public readonly GUIContent bigTilePrepass = new GUIContent("Enable big tile prepass", "Toggle");
5150
public readonly GUIContent clustered = new GUIContent("Enable clustered", "Toggle");
51+
public readonly GUIContent disableTileAndCluster = new GUIContent("Disable Tile/clustered", "Toggle");
52+
5253

5354

5455
public readonly GUIContent textureSettings = new GUIContent("texture Settings");
@@ -192,7 +193,6 @@ public override void OnInspectorGUI()
192193
debugParameters.displayTransparentObjects = EditorGUILayout.Toggle(styles.displayTransparentObjects, debugParameters.displayTransparentObjects);
193194
debugParameters.useForwardRenderingOnly = EditorGUILayout.Toggle(styles.useForwardRenderingOnly, debugParameters.useForwardRenderingOnly);
194195
debugParameters.useDepthPrepass = EditorGUILayout.Toggle(styles.useDepthPrepass, debugParameters.useDepthPrepass);
195-
debugParameters.useSinglePassLightLoop = EditorGUILayout.Toggle(styles.useSinglePassLightLoop, debugParameters.useSinglePassLightLoop);
196196

197197
if (EditorGUI.EndChangeCheck())
198198
{
@@ -265,16 +265,19 @@ public override void OnInspectorGUI()
265265

266266
EditorGUILayout.Space();
267267

268-
if (renderLoop.tilePassLightLoop != null)
268+
// TODO: we should call a virtual method or something similar to setup the UI, inspector should not know about it
269+
TilePass.LightLoop tilePass = renderLoop.lightLoop as TilePass.LightLoop;
270+
if (tilePass != null)
269271
{
270272
EditorGUILayout.LabelField(styles.tileLightLoopSettings);
271273
EditorGUI.indentLevel++;
272274
EditorGUI.BeginChangeCheck();
273275

274-
renderLoop.tilePassLightLoop.debugViewTilesFlags = EditorGUILayout.MaskField("DebugView Tiles", renderLoop.tilePassLightLoop.debugViewTilesFlags, styles.tileLightLoopDebugTileFlagStrings);
275-
renderLoop.tilePassLightLoop.enableDirectIndirectSinglePass = EditorGUILayout.Toggle(styles.directIndirectSinglePass, renderLoop.tilePassLightLoop.enableDirectIndirectSinglePass);
276-
renderLoop.tilePassLightLoop.enableBigTilePrepass = EditorGUILayout.Toggle(styles.bigTilePrepass, renderLoop.tilePassLightLoop.enableBigTilePrepass);
277-
renderLoop.tilePassLightLoop.enableClustered = EditorGUILayout.Toggle(styles.clustered, renderLoop.tilePassLightLoop.enableClustered);
276+
tilePass.debugViewTilesFlags = EditorGUILayout.MaskField("DebugView Tiles", tilePass.debugViewTilesFlags, styles.tileLightLoopDebugTileFlagStrings);
277+
tilePass.enableSplitLightEvaluation = EditorGUILayout.Toggle(styles.splitLightEvaluation, tilePass.enableSplitLightEvaluation);
278+
tilePass.enableBigTilePrepass = EditorGUILayout.Toggle(styles.bigTilePrepass, tilePass.enableBigTilePrepass);
279+
tilePass.enableClustered = EditorGUILayout.Toggle(styles.clustered, tilePass.enableClustered);
280+
tilePass.disableTileAndCluster = EditorGUILayout.Toggle(styles.disableTileAndCluster, tilePass.disableTileAndCluster);
278281

279282
if (EditorGUI.EndChangeCheck())
280283
{

Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.asset

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ MonoBehaviour:
2828
spotCookieSize: 128
2929
pointCookieSize: 512
3030
reflectionCubemapSize: 128
31+
m_Dirty: 0

Assets/ScriptableRenderLoop/HDRenderLoop/HDRenderLoop.asset.meta

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)