Skip to content

Commit 4713eb7

Browse files
committed
2 parents 342a8cd + 707b68d commit 4713eb7

36 files changed

+1336
-1380
lines changed

Assets/BasicRenderLoopTutorial/BasicRenderLoop.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ public override void Render(Camera[] cameras, RenderLoop loop)
6060

6161
// Draw opaque objects using BasicPass shader pass
6262
var settings = new DrawRendererSettings (cull, camera, shaderPassBasic);
63-
settings.sorting.sortOptions = SortOptions.SortByMaterialThenMesh;
63+
settings.sorting.flags = SortFlags.CommonOpaque;
6464
settings.inputFilter.SetQueuesOpaque ();
6565
loop.DrawRenderers (ref settings);
6666

6767
// Draw skybox
6868
loop.DrawSkybox (camera);
6969

7070
// Draw transparent objects using BasicPass shader pass
71-
settings.sorting.sortOptions = SortOptions.BackToFront; // sort back to front
71+
settings.sorting.flags = SortFlags.CommonTransparent;
7272
settings.inputFilter.SetQueuesTransparent ();
7373
loop.DrawRenderers (ref settings);
7474

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: 22 additions & 10 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,24 +265,36 @@ 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.enableBigTilePrepass = EditorGUILayout.Toggle(styles.bigTilePrepass, tilePass.enableBigTilePrepass);
277+
tilePass.enableClustered = EditorGUILayout.Toggle(styles.clustered, tilePass.enableClustered);
278278

279279
if (EditorGUI.EndChangeCheck())
280280
{
281281
EditorUtility.SetDirty(renderLoop); // Repaint
282282

283-
// If something is chanage on tilePassLightLoop we need to force a OnValidate() OnHDRenderLoop, else change Rebuild() will not be call
283+
// If something is chanage regarding tile/cluster rendering we need to force a OnValidate() OnHDRenderLoop, else change Rebuild() will not be call
284284
renderLoop.OnValidate();
285285
}
286+
287+
EditorGUI.BeginChangeCheck();
288+
289+
tilePass.debugViewTilesFlags = EditorGUILayout.MaskField("DebugView Tiles", tilePass.debugViewTilesFlags, styles.tileLightLoopDebugTileFlagStrings);
290+
tilePass.enableSplitLightEvaluation = EditorGUILayout.Toggle(styles.splitLightEvaluation, tilePass.enableSplitLightEvaluation);
291+
tilePass.disableTileAndCluster = EditorGUILayout.Toggle(styles.disableTileAndCluster, tilePass.disableTileAndCluster);
292+
293+
if (EditorGUI.EndChangeCheck())
294+
{
295+
EditorUtility.SetDirty(renderLoop); // Repaint
296+
UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
297+
}
286298
EditorGUI.indentLevel--;
287299
}
288300
}

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)