Skip to content

WIP: Stochastic transparency render mode + global render settings #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions package/Editor/GaussianSplatRendererEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,8 @@ public class GaussianSplatRendererEditor : UnityEditor.Editor
SerializedProperty m_PropSplatScale;
SerializedProperty m_PropOpacityScale;
SerializedProperty m_PropSHOrder;
SerializedProperty m_PropSHOnly;
SerializedProperty m_PropSortNthFrame;
SerializedProperty m_PropRenderMode;
SerializedProperty m_PropPointDisplaySize;
SerializedProperty m_PropCutouts;
SerializedProperty m_PropShaderSplats;
SerializedProperty m_PropShaderComposite;
SerializedProperty m_PropShaderDebugPoints;
SerializedProperty m_PropShaderDebugBoxes;
SerializedProperty m_PropCSSplatUtilities;

bool m_ResourcesExpanded = false;
int m_CameraIndex = 0;

bool m_ExportBakeTransform;
Expand Down Expand Up @@ -65,16 +55,7 @@ public void OnEnable()
m_PropSplatScale = serializedObject.FindProperty("m_SplatScale");
m_PropOpacityScale = serializedObject.FindProperty("m_OpacityScale");
m_PropSHOrder = serializedObject.FindProperty("m_SHOrder");
m_PropSHOnly = serializedObject.FindProperty("m_SHOnly");
m_PropSortNthFrame = serializedObject.FindProperty("m_SortNthFrame");
m_PropRenderMode = serializedObject.FindProperty("m_RenderMode");
m_PropPointDisplaySize = serializedObject.FindProperty("m_PointDisplaySize");
m_PropCutouts = serializedObject.FindProperty("m_Cutouts");
m_PropShaderSplats = serializedObject.FindProperty("m_ShaderSplats");
m_PropShaderComposite = serializedObject.FindProperty("m_ShaderComposite");
m_PropShaderDebugPoints = serializedObject.FindProperty("m_ShaderDebugPoints");
m_PropShaderDebugBoxes = serializedObject.FindProperty("m_ShaderDebugBoxes");
m_PropCSSplatUtilities = serializedObject.FindProperty("m_CSSplatUtilities");

s_AllEditors.Add(this);
}
Expand Down Expand Up @@ -109,25 +90,8 @@ public override void OnInspectorGUI()
EditorGUILayout.PropertyField(m_PropSplatScale);
EditorGUILayout.PropertyField(m_PropOpacityScale);
EditorGUILayout.PropertyField(m_PropSHOrder);
EditorGUILayout.PropertyField(m_PropSHOnly);
EditorGUILayout.PropertyField(m_PropSortNthFrame);

EditorGUILayout.Space();
GUILayout.Label("Debugging Tweaks", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_PropRenderMode);
if (m_PropRenderMode.intValue is (int)GaussianSplatRenderer.RenderMode.DebugPoints or (int)GaussianSplatRenderer.RenderMode.DebugPointIndices)
EditorGUILayout.PropertyField(m_PropPointDisplaySize);

EditorGUILayout.Space();
m_ResourcesExpanded = EditorGUILayout.Foldout(m_ResourcesExpanded, "Resources", true, EditorStyles.foldoutHeader);
if (m_ResourcesExpanded)
{
EditorGUILayout.PropertyField(m_PropShaderSplats);
EditorGUILayout.PropertyField(m_PropShaderComposite);
EditorGUILayout.PropertyField(m_PropShaderDebugPoints);
EditorGUILayout.PropertyField(m_PropShaderDebugBoxes);
EditorGUILayout.PropertyField(m_PropCSSplatUtilities);
}
bool validAndEnabled = gs && gs.enabled && gs.gameObject.activeInHierarchy && gs.HasValidAsset;
if (validAndEnabled && !gs.HasValidRenderSetup)
{
Expand Down
64 changes: 64 additions & 0 deletions package/Editor/GaussianSplatSettingsEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// SPDX-License-Identifier: MIT

using GaussianSplatting.Runtime;
using UnityEditor;
using UnityEngine;

namespace GaussianSplatting.Editor
{
[CustomEditor(typeof(GaussianSplatSettings))]
[CanEditMultipleObjects]
public class GaussianSplatSettingsEditor : UnityEditor.Editor
{
SerializedProperty m_Transparency;
SerializedProperty m_SortNthFrame;
SerializedProperty m_TemporalFilter;
SerializedProperty m_FrameInfluence;
SerializedProperty m_VarianceClampScale;
SerializedProperty m_RenderMode;
SerializedProperty m_PointDisplaySize;
SerializedProperty m_SHOnly;

public void OnEnable()
{
m_Transparency = serializedObject.FindProperty("m_Transparency");
m_SortNthFrame = serializedObject.FindProperty("m_SortNthFrame");
m_TemporalFilter = serializedObject.FindProperty("m_TemporalFilter");
m_FrameInfluence = serializedObject.FindProperty("m_FrameInfluence");
m_VarianceClampScale = serializedObject.FindProperty("m_VarianceClampScale");
m_RenderMode = serializedObject.FindProperty("m_RenderMode");
m_PointDisplaySize = serializedObject.FindProperty("m_PointDisplaySize");
m_SHOnly = serializedObject.FindProperty("m_SHOnly");
}

public override void OnInspectorGUI()
{
serializedObject.Update();

EditorGUILayout.Space();
EditorGUILayout.PropertyField(m_Transparency);
if (m_Transparency.intValue is (int) TransparencyMode.SortedBlended)
{
EditorGUILayout.PropertyField(m_SortNthFrame);
}
if (m_Transparency.intValue == (int) TransparencyMode.Stochastic)
{
EditorGUILayout.PropertyField(m_TemporalFilter);
if (m_TemporalFilter.intValue != (int)TemporalFilter.None)
{
EditorGUILayout.PropertyField(m_FrameInfluence);
EditorGUILayout.PropertyField(m_VarianceClampScale);
}
}

EditorGUILayout.Space();
GUILayout.Label("Debugging Tweaks", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(m_RenderMode);
if (m_RenderMode.intValue is (int)DebugRenderMode.DebugPoints or (int)DebugRenderMode.DebugPointIndices)
EditorGUILayout.PropertyField(m_PointDisplaySize);
EditorGUILayout.PropertyField(m_SHOnly);

serializedObject.ApplyModifiedProperties();
}
}
}
11 changes: 11 additions & 0 deletions package/Editor/GaussianSplatSettingsEditor.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package/Editor/GaussianSplatValidator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public static void ValidateD3D12()

static unsafe void ValidateImpl(string refPrefix)
{
var gaussians = Object.FindObjectOfType(typeof(GaussianSplatRenderer)) as GaussianSplatRenderer;
var gaussians = Object.FindAnyObjectByType<GaussianSplatRenderer>();
{
if (gaussians == null)
{
Expand Down
Loading