Skip to content

Commit 1d3dfee

Browse files
author
ben.spencer
committed
Placeholder code for AI option in UI
1 parent 239edd5 commit 1d3dfee

File tree

5 files changed

+52
-16
lines changed

5 files changed

+52
-16
lines changed

Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/ProbeVolumeDenoiserSettingsDrawer.cs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ static class Styles
1616
public static readonly GUIContent nlmAlpha = new GUIContent("Alpha", "");
1717
public static readonly GUIContent nlmK = new GUIContent("K", "");
1818

19+
public static readonly GUIContent aiModelType = new GUIContent("Emphasis", "");
20+
1921
public static readonly GUIContent fineTuningTitle = new GUIContent("Fine Tuning", "");
2022
public static readonly GUIContent samplerBias = new GUIContent("Sampler Bias", "");
2123

@@ -24,8 +26,8 @@ static class Styles
2426
public static readonly GUIContent isolateCellIdx = new GUIContent("Cell index", "");
2527
public static readonly GUIContent showInvalidProbes = new GUIContent("Show Invalid Probes", "");
2628

27-
public static readonly string[] kernelFilterTypeOptions = new string[] { "Box", "Epanechnikov", "NLM" };
28-
29+
public static readonly string[] kernelFilterTypeOptions = new string[] { "Box", "Epanechnikov", "NLM", "AI" };
30+
public static readonly string[] aiModelTypeOptions = new string[] { "Noise removal", "Detail preservation" };
2931
}
3032

3133
// PropertyDrawer are not made to use GUILayout, so it will try to reserve a rect before calling OnGUI
@@ -49,17 +51,28 @@ public override void OnGUI(Rect position, SerializedProperty property, GUIConten
4951
var kernelFilterType = property.FindPropertyRelative("kernelFilterType");
5052
kernelFilterType.intValue = EditorGUILayout.Popup(Styles.kernelFilterType, kernelFilterType.intValue, Styles.kernelFilterTypeOptions);
5153

52-
var kernelSize = property.FindPropertyRelative("kernelSize");
53-
kernelSize.intValue = EditorGUILayout.IntSlider(Styles.kernelSize, kernelSize.intValue, 0, 5);
54+
if (kernelFilterType.intValue != (int)ProbeVolumeDenoiserSettings.KernelFilterType.kAI)
55+
{
56+
var kernelSize = property.FindPropertyRelative("kernelSize");
57+
kernelSize.intValue = EditorGUILayout.IntSlider(Styles.kernelSize, kernelSize.intValue, 0, 5);
5458

55-
var nlmM = property.FindPropertyRelative("nlmM");
56-
nlmM.intValue = EditorGUILayout.IntSlider(Styles.nlmM, nlmM.intValue, 0, 2);
59+
if (kernelFilterType.intValue == (int)ProbeVolumeDenoiserSettings.KernelFilterType.kNLM)
60+
{
61+
var nlmM = property.FindPropertyRelative("nlmM");
62+
nlmM.intValue = EditorGUILayout.IntSlider(Styles.nlmM, nlmM.intValue, 0, 2);
5763

58-
var nlmAlpha = property.FindPropertyRelative("nlmAlpha");
59-
nlmAlpha.floatValue = EditorGUILayout.Slider(Styles.nlmAlpha, nlmAlpha.floatValue, 0.0f, 3.0f);
64+
var nlmAlpha = property.FindPropertyRelative("nlmAlpha");
65+
nlmAlpha.floatValue = EditorGUILayout.Slider(Styles.nlmAlpha, nlmAlpha.floatValue, 0.0f, 3.0f);
6066

61-
var nlmK = property.FindPropertyRelative("nlmK");
62-
nlmK.floatValue = EditorGUILayout.Slider(Styles.nlmK, nlmK.floatValue, 0.0f, 3.0f);
67+
var nlmK = property.FindPropertyRelative("nlmK");
68+
nlmK.floatValue = EditorGUILayout.Slider(Styles.nlmK, nlmK.floatValue, 0.0f, 3.0f);
69+
}
70+
}
71+
else
72+
{
73+
var aiModelType = property.FindPropertyRelative("aiModelType");
74+
aiModelType.intValue = EditorGUILayout.Popup(Styles.aiModelType, aiModelType.intValue, Styles.aiModelTypeOptions);
75+
}
6376
}
6477
}
6578

Packages/com.unity.render-pipelines.core/Editor/Lighting/ProbeVolume/RawSphericalHarmonicsL2.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ void ToSphericalHarmonicsL2(ref SphericalHarmonicsL2 sh)
3535
SphericalHarmonicsL2Utils.SetCoefficient(ref sh, 7, L2_3);
3636
SphericalHarmonicsL2Utils.SetCoefficient(ref sh, 8, L2_4);
3737

38-
/*SphericalHarmonicsL2Utils.SetCoefficient(ref sh, 0, new Vector3(1.0f, 0.0f, 0.0f));
38+
/*SphericalHarmonicsL2Utils.SetCoefficient(ref sh, 0, new Vector3(0.0f, 0.0f, 0.0f));
3939
SphericalHarmonicsL2Utils.SetCoefficient(ref sh, 1, new Vector3(0.0f, 0.0f, 0.0f));
4040
SphericalHarmonicsL2Utils.SetCoefficient(ref sh, 2, new Vector3(0.0f, 0.0f, 0.0f));
4141
SphericalHarmonicsL2Utils.SetCoefficient(ref sh, 3, new Vector3(0.0f, 0.0f, 0.0f));
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
//
2+
// This file was automatically generated. Please don't edit by hand. Execute Editor command [ Edit > Rendering > Generate Shader Includes ] instead
3+
//
4+
5+
#ifndef RAWSPHERICALHARMONICSL2_CS_HLSL
6+
#define RAWSPHERICALHARMONICSL2_CS_HLSL
7+
// Generated from UnityEngine.Rendering.ProbeGIBaking+RawSphericalHarmonicsL2
8+
// PackingRules = Exact
9+
struct RawSphericalHarmonicsL2
10+
{
11+
float3 L0;
12+
float3 L1_0;
13+
float3 L1_1;
14+
float3 L1_2;
15+
float3 L2_0;
16+
float3 L2_1;
17+
float3 L2_2;
18+
float3 L2_3;
19+
float3 L2_4;
20+
};
21+
22+
23+
#endif

Packages/com.unity.render-pipelines.core/Runtime/Lighting/ProbeVolume/ProbeVolumeBakingProcessSettings.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ internal struct ProbeVolumeDenoiserSettings
103103
public enum KernelFilterType
104104
{
105105
kBox,
106-
kNLM
106+
kEpanechnikov,
107+
kNLM,
108+
kAI
107109
}
108110

109111
public bool enableDenoising;
@@ -112,6 +114,7 @@ public enum KernelFilterType
112114
public int nlmM;
113115
public float nlmAlpha;
114116
public float nlmK;
117+
public int aiModelType;
115118

116119
public float samplerBias;
117120

probe-denoiser.code-workspace

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
{
22
"folders": [
33
{
4-
"path": "Packages/com.unity.render-pipelines.high-definition"
5-
},
6-
{
7-
"path": "Packages/com.unity.render-pipelines.core"
4+
"path": "../APVDemo/[email protected]"
85
}
96
],
107
"settings": {}

0 commit comments

Comments
 (0)