### HDRP Integration Setup Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt This section details the inspector-only setup for HDRP integration. Choose the appropriate injection point for desired occlusion and artifact handling. ```csharp // Setup (Inspector-only): // 1. Add a Custom Pass Volume GameObject to your scene // (GameObject > Volume > Custom Pass) // 2. Click "+" in the Custom Passes list and select "Gaussian Splat HDRP Pass" // 3. Choose injection point: // - "Before Transparencies" — splats occlude transparent objects correctly // - "After Post Process" — avoids HDRP auto-exposure artifacts (recommended) // Compile-time guard: add GS_ENABLE_HDRP to Scripting Define Symbols. ``` -------------------------------- ### URP Integration Setup Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt This section outlines the inspector-only setup for URP integration. Ensure compatibility mode is disabled and Unity version is 6 or newer. ```csharp // Setup (Inspector-only — no runtime API): // 1. Select your URP Renderer Asset (Project Settings > Graphics > Scriptable Render Pipeline Settings) // 2. Click "Add Renderer Feature" and choose "Gaussian Splat URP Feature" // 3. Ensure "Compatibility Mode" is DISABLED in URP settings (requires Render Graph API) // 4. Requires Unity 6000.0 or newer (#error enforced in source) // Compile-time guard: add GS_ENABLE_URP to your project's Scripting Define Symbols // to activate URP support (avoids compilation errors when URP package is absent). // Known URP limitations: // - MSAA is not supported // - Turning off HDR AND setting Intermediate Texture to "Auto" causes upside-down rendering ``` -------------------------------- ### HDRP Custom Pass Volume Setup for Gaussian Splatting Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Integrate Gaussian Splatting into HDRP by adding a Custom Pass Volume and the GaussianSplatHDRPPass. Set injection to "After Post Process" and define GS_ENABLE_HDRP in Scripting Define Symbols. ```text HDRP → Add a Custom Pass Volume to the scene. Add GaussianSplatHDRPPass to its Custom Passes list. Set injection to "After Post Process" for best results. Define GS_ENABLE_HDRP in Scripting Define Symbols. ``` -------------------------------- ### URP Renderer Asset Setup for Gaussian Splatting Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Add this feature to the URP Renderer Asset for URP integration. Requires Unity 6+ and defining GS_ENABLE_URP in Scripting Define Symbols. Compatibility Mode in URP settings should be disabled. ```text URP → Add GaussianSplatURPFeature to the URP Renderer Asset. Requires Unity 6+. Disable "Compatibility Mode" in URP settings. Define GS_ENABLE_URP in Scripting Define Symbols. ``` -------------------------------- ### Configure Gaussian Splat Renderer Runtime Settings Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Demonstrates how to configure basic render settings for the GaussianSplatRenderer component at runtime, including splat scale, opacity, SH order, and sorting frequency. ```csharp using GaussianSplatting.Runtime; using UnityEngine; public class SplatController : MonoBehaviour { [SerializeField] GaussianSplatRenderer m_Splat; void Start() { // Basic render settings m_Splat.m_SplatScale = 1.0f; // 0.1 – 2.0 m_Splat.m_OpacityScale = 1.0f; // 0.05 – 20.0 m_Splat.m_SHOrder = 3; // 0 = no SH, 3 = full order-3 m_Splat.m_SHOnly = false; // visualize SH contribution only m_Splat.m_SortNthFrame = 1; // sort every N frames (higher = cheaper) m_Splat.m_RenderOrder = 0; // higher renders "on top" // Switch render modes for debugging m_Splat.m_RenderMode = GaussianSplatRenderer.RenderMode.Splats; // normal // m_Splat.m_RenderMode = GaussianSplatRenderer.RenderMode.DebugPoints; // point cloud // m_Splat.m_RenderMode = GaussianSplatRenderer.RenderMode.DebugBoxes; // ellipsoid boxes // m_Splat.m_RenderMode = GaussianSplatRenderer.RenderMode.DebugChunkBounds; // chunk AABBs // Query state Debug.Log($ ``` -------------------------------- ### Create and Register GaussianCutouts Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Demonstrates creating both Box and Ellipsoid GaussianCutouts for masking splats. Remember to register cutouts with the GaussianSplatRenderer. ```csharp using GaussianSplatting.Runtime; using UnityEngine; // --- Create a Box cutout that removes a region --- GameObject cutoutGO = new GameObject("RemoveBox"); var cutout = cutoutGO.AddComponent(); cutout.m_Type = GaussianCutout.Type.Box; cutout.m_Invert = true; // hide splats INSIDE this box // Size and position via Transform cutoutGO.transform.position = new Vector3(0, 0, 2); cutoutGO.transform.localScale = new Vector3(1, 1, 0.5f); // half-extents // Register it with the renderer GaussianSplatRenderer renderer = FindObjectOfType(); var cutouts = new System.Collections.Generic.List(renderer.m_Cutouts ?? new GaussianCutout[0]); cutouts.Add(cutout); renderer.m_Cutouts = cutouts.ToArray(); // --- Create an Ellipsoid cutout to isolate a region of interest --- GameObject keepGO = new GameObject("KeepEllipsoid"); var keepCutout = keepGO.AddComponent(); keepCutout.m_Type = GaussianCutout.Type.Ellipsoid; keepCutout.m_Invert = false; // show splats INSIDE, hide everything outside keepGO.transform.position = Vector3.zero; keepGO.transform.localScale = Vector3.one * 2.0f; // radius = 2 units renderer.m_Cutouts = new[] { keepCutout }; ``` -------------------------------- ### Query Gaussian Splat Renderer State and Activate Camera Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Shows how to query the current state of the GaussianSplatRenderer, such as splat count and render readiness, and how to activate a stored camera position from the asset. ```csharp // Query state Debug.Log($ ``` -------------------------------- ### Open Gaussian Splat Asset Creator Window Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Programmatically opens the Gaussian Splat Asset Creator window. This tool is used to import and process .ply or .spz files into a Unity-compatible GaussianSplatAsset. ```csharp GaussianSplatting.Editor.GaussianSplatAssetCreator.Init(); ``` -------------------------------- ### Gaussian Splat Asset Creator Data Formats and Output Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Details the data quality presets for compression ratios and PSNR values, and lists the output files generated by the Gaussian Splat Asset Creator for a given asset. ```csharp // Open the creator window programmatically GaussianSplatting.Editor.GaussianSplatAssetCreator.Init(); // Quality presets and their compression ratios / PSNR: // DataQuality.VeryHigh → Float32 everything (~1.05x smaller) // DataQuality.High → Norm16 pos/scale, Float16x4 color, Norm11 SH (2.94x, 57.77 PSNR) // DataQuality.Medium → Norm11 pos/scale, Norm8x4 color, Norm6 SH (5.14x, 47.46 PSNR) // DataQuality.Low → Norm11/Norm6, Norm8x4, Cluster16k SH (14.01x, 35.17 PSNR) // DataQuality.VeryLow → Norm11/Norm6, BC7, Cluster4k SH (18.62x, 32.27 PSNR) // The creator searches for cameras.json in the input file's directory and all parent dirs. // Output files produced per asset (baseName derived from PLY/SPZ filename): // .asset ← GaussianSplatAsset ScriptableObject // _pos.bytes ← encoded positions // _oth.bytes ← encoded rotations + scales (+ SH indices if clustered) // _col.bytes ← color texture (DC0 + opacity, swizzle-tiled 2048-wide) // _shs.bytes ← spherical harmonics (per-splat or clustered table) // _chk.bytes ← chunk min/max bounds (absent for VeryHigh/unquantized) ``` -------------------------------- ### Inspect GaussianSplatAsset at Runtime Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Use this code to inspect properties of a loaded `GaussianSplatAsset` at runtime, such as splat count, format version, bounds, and data formats. It also shows how to calculate expected GPU data sizes and color texture dimensions. ```csharp using GaussianSplatting.Runtime; using UnityEngine; // Inspect a loaded asset at runtime GaussianSplatAsset asset = ...; // assigned via Inspector or Resources.Load Debug.Log($ ``` -------------------------------- ### Direct Use of GaussianSplatRenderSystem Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Use this snippet for direct integration within custom SRP passes. It manages active renderers, performs depth sorting, and issues GPU draw calls. ```csharp using GaussianSplatting.Runtime; using UnityEngine; using UnityEngine.Rendering; // Direct use (e.g. inside a custom SRP pass): var system = GaussianSplatRenderSystem.instance; // Gather active splats visible to a camera (returns false if nothing to render) if (system.GatherSplatsForCamera(Camera.main)) { CommandBuffer cmd = system.InitialClearCmdBuffer(Camera.main); // Allocate the splat accumulation RT cmd.GetTemporaryRT( GaussianSplatRenderer.Props.GaussianSplatRT, -1, -1, 0, FilterMode.Point, UnityEngine.Experimental.Rendering.GraphicsFormat.R16G16B16A16_SFloat); cmd.SetRenderTarget(GaussianSplatRenderer.Props.GaussianSplatRT, BuiltinRenderTextureType.CurrentActive); cmd.ClearRenderTarget(RTClearFlags.Color, Color.clear, 0, 0); // Sort every splat and emit draw calls; returns the composite material Material matComposite = system.SortAndRenderSplats(Camera.main, cmd); // Composite accumulated splat RT back onto camera target cmd.SetRenderTarget(BuiltinRenderTextureType.CameraTarget); cmd.DrawProcedural(Matrix4x4.identity, matComposite, 0, MeshTopology.Triangles, 3, 1); cmd.ReleaseTemporaryRT(GaussianSplatRenderer.Props.GaussianSplatRT); Graphics.ExecuteCommandBuffer(cmd); } // Manual registration (called automatically by GaussianSplatRenderer.OnEnable): // system.RegisterSplat(renderer); // system.UnregisterSplat(renderer); ``` -------------------------------- ### Monitor Gaussian Splat Renderer Editing State Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Demonstrates how to monitor the editing state of the GaussianSplatRenderer, including modification status, selected splats, and deleted splats, within the Update loop. ```csharp void Update() { // Check editing state Debug.Log($ ``` -------------------------------- ### Gaussian Splat Asset Data Format Enums Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Explains the different VectorFormat, ColorFormat, and SHFormat enums available in GaussianSplatAsset for optimizing memory and file size. Lower precision formats trade rendering quality for reduced GPU memory and asset size. ```csharp using GaussianSplatting.Runtime; // VectorFormat — used for positions and scales // Float32 → 12 bytes/splat (lossless) // Norm16 → 6 bytes/splat (quantized to 16 bits per axis) // Norm11 → 4 bytes/splat (11/10/11 bits, default Medium/Low preset) // Norm6 → 2 bytes/splat (6/5/5 bits, used for scale in Low/VeryLow) int posSize = GaussianSplatAsset.GetVectorSize(GaussianSplatAsset.VectorFormat.Norm11); // 4 // ColorFormat — stored as a swizzle-tiled 2048-wide texture (DC color + opacity) // Float32x4 → 16 bytes/texel (full precision) // Float16x4 → 8 bytes/texel // Norm8x4 → 4 bytes/texel (default Medium preset) // BC7 → 1 byte/texel (block compressed, requires EditorUtility.CompressTexture) int colSize = GaussianSplatAsset.GetColorSize(GaussianSplatAsset.ColorFormat.Norm8x4); // 4 // SHFormat — stores 15 float3 spherical-harmonic coefficients per splat // Float32 → 15*3*4 = 180 bytes/splat // Float16 → 15*3*2 = 90 bytes/splat // Norm11 → 15*4 = 60 bytes/splat // Norm6 → 15*2 = 30 bytes/splat (default Medium) // Cluster64k/32k/16k/8k/4k → shared table of N entries; splats store a 2-byte index // VeryLow preset uses Cluster4k (~3-10 min clustering for 6M splats) int shCount = GaussianSplatAsset.GetSHCount(GaussianSplatAsset.SHFormat.Cluster4k, splatCount: 1_000_000); // 4096 long shBytes = GaussianSplatAsset.CalcSHDataSize(1_000_000, GaussianSplatAsset.SHFormat.Cluster4k); // = 4096 * sizeof(SHTableItemFloat16) + 1_000_000 * 2 (index) ``` -------------------------------- ### Activate Camera View in Gaussian Splatting Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Moves the scene's main camera to a stored camera position and orientation from the asset. Useful for reproducing training viewpoints. Requires a GaussianSplatRenderer component. ```csharp using GaussianSplatting.Runtime; using UnityEngine; GaussianSplatRenderer splat = GetComponent(); // List available cameras if (splat.asset?.cameras != null) { for (int i = 0; i < splat.asset.cameras.Length; i++) { var c = splat.asset.cameras[i]; Debug.Log($ ``` -------------------------------- ### Gaussian Splat Renderer Component Usage Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Use this component to render Gaussian Splat assets in a Unity scene. Import PLY or SPZ files, create a GaussianSplatAsset, and assign it to the component. Adjust the transform for correct orientation. ```csharp using UnityEngine; public class GaussianSplatRenderer : MonoBehaviour { public GaussianSplatAsset splatAsset; public int m_RenderOrder; // ... other properties and methods } ``` -------------------------------- ### Gaussian Splat Renderer Quality Validation (Editor) Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt An editor-only utility for rendering reference scenes, computing PSNR/RMSE against known-good images, and logging/saving diff images when quality deviates. Used to verify renderer correctness. Accessible via 'Tools > Gaussian Splats > Debug'. ```csharp // Menu: Tools > Gaussian Splats > Debug > Validate Render against D3D12 // Menu: Tools > Gaussian Splats > Debug > Validate Render against SBIR // Expected assets at: Assets/GaussianAssets/bicycle-point_cloud-iteration_30000-point_cloud.asset // Assets/GaussianAssets/truck-point_cloud-iteration_30000-point_cloud.asset // Assets/GaussianAssets/garden-point_cloud-iteration_30000-point_cloud.asset // Reference images at: ../../docs/RefImages/{D3D12|SBIR}_{scene}{cameraIndex}.png // Typical PSNR output on RTX 3080 Ti: // SBIR: bicycle=43.76, truck=39.36, garden=43.50 // D3D12: matches reference exactly // If errorsCount > 50 or PSNR < 90, diff/ref/got PNG files are written alongside the project. // GaussianSplatting.Editor.GaussianSplatValidator.ValidateD3D12(); // callable from code ``` -------------------------------- ### Gaussian Splat Editing Tools Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Tools for in-engine editing of Gaussian splats. Includes components for moving, rotating, and scaling selections, and exporting modified PLY files. Operations are GPU-accelerated. ```csharp using UnityEngine; public class GaussianMoveTool : MonoBehaviour { } public class GaussianRotateTool : MonoBehaviour { } public class GaussianScaleTool : MonoBehaviour { } ``` -------------------------------- ### GaussianSplatRenderer.ActivateCamera Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Restores a captured camera view by moving the scene's `Camera.main` to a stored camera position and orientation. This is useful for reproducing exact viewpoints used during Gaussian Splat training. ```APIDOC ## GaussianSplatRenderer.ActivateCamera — Restore a captured camera view Moves the scene's `Camera.main` to a camera position/orientation stored inside the asset (parsed from `cameras.json` at import time). Useful for reproducing the exact viewpoints used during Gaussian Splat training. ```csharp using GaussianSplatting.Runtime; using UnityEngine; GaussianSplatRenderer splat = GetComponent(); // List available cameras if (splat.asset?.cameras != null) { for (int i = 0; i < splat.asset.cameras.Length; i++) { var c = splat.asset.cameras[i]; Debug.Log($"Camera {i}: pos={c.pos:F3}, fov={c.fov}"); } } // Snap main camera to training view #0 splat.ActivateCamera(0); // Snap to a different view each second IEnumerator CycleCameras() { for (int i = 0; splat.asset?.cameras != null && i < splat.asset.cameras.Length; i++) { splat.ActivateCamera(i); yield return new WaitForSeconds(1f); } } StartCoroutine(CycleCameras()); ``` ``` -------------------------------- ### GaussianCutout - Volume-based splat masking Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Defines an Ellipsoid or Box volume to mask splats in a GaussianSplatRenderer. It can either hide splats outside its volume (keep-inside mode) or hide splats inside it (remove-inside mode). Multiple cutouts are OR-combined. ```APIDOC ## GaussianCutout ### Description Defines an Ellipsoid or Box volume used to mask splats in a `GaussianSplatRenderer`. By default, a cutout hides splats *outside* its volume (keep-inside mode); with `m_Invert = true`, it hides splats *inside* it (remove-inside mode). Multiple cutouts are OR-combined. ### Usage Example ```csharp // Create a Box cutout that removes a region GameObject cutoutGO = new GameObject("RemoveBox"); var cutout = cutoutGO.AddComponent(); cutout.m_Type = GaussianCutout.Type.Box; cutout.m_Invert = true; // hide splats INSIDE this box // Size and position via Transform cutoutGO.transform.position = new Vector3(0, 0, 2); cutoutGO.transform.localScale = new Vector3(1, 1, 0.5f); // half-extents // Register it with the renderer GaussianSplatRenderer renderer = FindObjectOfType(); var cutouts = new System.Collections.Generic.List(renderer.m_Cutouts ?? new GaussianCutout[0]); cutouts.Add(cutout); renderer.m_Cutouts = cutouts.ToArray(); // Create an Ellipsoid cutout to isolate a region of interest GameObject keepGO = new GameObject("KeepEllipsoid"); var keepCutout = keepGO.AddComponent(); keepCutout.m_Type = GaussianCutout.Type.Ellipsoid; keepCutout.m_Invert = false; // show splats INSIDE, hide everything outside keepGO.transform.position = Vector3.zero; keepGO.transform.localScale = Vector3.one * 2.0f; // radius = 2 units renderer.m_Cutouts = new[] { keepCutout }; ``` ### Parameters - **m_Type** (GaussianCutout.Type): The shape of the cutout volume (Box or Ellipsoid). - **m_Invert** (bool): If true, hides splats inside the volume; otherwise, hides splats outside the volume. ``` -------------------------------- ### GaussianSplatRenderer - Splat Editing API Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Exposes a GPU-side editing API for rectangle selection, translation, rotation, scale, deletion, and copy operations. All operations execute immediately on the GPU. ```APIDOC ## Splat Editing API — GaussianSplatRenderer edit methods ### Description `GaussianSplatRenderer` exposes a GPU-side editing API for rectangle selection, translation, rotation, scale, deletion, and copy operations. All operations execute immediately on the GPU; **there is no Undo**. Revert by disabling and re-enabling the component. Use `VeryHigh` quality import for editing to avoid operating on already-quantized data. ### Selection Operations - **EditUpdateSelection(Vector2 rectMin, Vector2 rectMax, Camera camera, bool subtract = false)**: Rectangle-selects splats visible in a camera view (screen-space rect in pixels). `subtract = false` adds to selection (Shift+drag equivalent); `subtract = true` subtracts from selection (Ctrl+drag equivalent). - **EditSelectAll()**: Selects all splats (Ctrl+A). - **EditInvertSelection()**: Inverts the current selection (Ctrl+I). - **EditDeselectAll()**: Deselects all splats. ### Selection State Properties - **editSelectedSplats** (int): Number of currently selected splats. - **editDeletedSplats** (int): Number of splats marked for deletion. - **editCutSplats** (int): Number of splats marked as cut. - **editSelectedBounds** (Bounds): The bounding box of the currently selected splats. ### Transform Operations (on selected splats) - **EditStoreSelectionMouseDown()**: Stores the baseline state of the selection before a drag operation begins. - **EditStorePosMouseDown()**: Stores the baseline position before a drag operation. - **EditStoreOtherMouseDown()**: Stores other baseline states before a drag operation. - **EditTranslateSelection(Vector3 translation)**: Translates the selected splats in local space. - **EditRotateSelection(Vector3 localSpaceCenter, Matrix4x4 localToWorld, Matrix4x4 worldToLocal, Quaternion rotation)**: Rotates the selected splats around a specified center. - **EditScaleSelection(Vector3 localSpaceCenter, Matrix4x4 localToWorld, Matrix4x4 worldToLocal, Vector3 scale)**: Scales the selected splats from a specified center. ### Deletion and Export - **EditDeleteSelected()**: Permanently deletes the selected splats. - **editModified** (bool): Indicates if any modifications have been made to the splats. - **EditExportData(GraphicsBuffer exportBuf, bool bakeTransform = false)**: Exports the modified splat data to a `GraphicsBuffer`. `bakeTransform = true` exports in world-space. ### Merging Renderers - **Merge multiple GaussianSplatRenderer objects**: Select several `GaussianSplatRenderer` objects in the Editor and click "Merge" in the inspector. The merged result is editable and exportable. ``` -------------------------------- ### Transform Selected Splats Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Applies translation, rotation, and scaling to the currently selected splats. Ensure to store the selection state before initiating transformations. ```csharp // Store baseline state before drag begins splat.EditStoreSelectionMouseDown(); splat.EditStorePosMouseDown(); splat.EditStoreOtherMouseDown(); // Translate in local space splat.EditTranslateSelection(new Vector3(0.5f, 0, 0)); // Rotate around selection center var tr = splat.transform; splat.EditRotateSelection( localSpaceCenter: splat.editSelectedBounds.center, localToWorld: tr.localToWorldMatrix, worldToLocal: tr.worldToLocalMatrix, rotation: Quaternion.Euler(0, 45, 0) ); // Scale from selection center splat.EditScaleSelection( localSpaceCenter: splat.editSelectedBounds.center, localToWorld: tr.localToWorldMatrix, worldToLocal: tr.worldToLocalMatrix, scale: new Vector3(1.5f, 1.5f, 1.5f) ); ``` -------------------------------- ### GaussianSplatAsset Data Format Enums Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Explains the different data format enums available for `GaussianSplatAsset`, which affect GPU memory usage, asset file size, and rendering quality. These include formats for positions, scales, colors, and spherical harmonics. ```APIDOC ## GaussianSplatAsset Data Format Enums The asset stores splat data in four independently-selectable compressed formats. Choosing lower-precision formats significantly reduces GPU memory and asset file size, trading off rendering quality (measured in PSNR). ```csharp using GaussianSplatting.Runtime; // VectorFormat — used for positions and scales // Float32 → 12 bytes/splat (lossless) // Norm16 → 6 bytes/splat (quantized to 16 bits per axis) // Norm11 → 4 bytes/splat (11/10/11 bits, default Medium/Low preset) // Norm6 → 2 bytes/splat (6/5/5 bits, used for scale in Low/VeryLow) int posSize = GaussianSplatAsset.GetVectorSize(GaussianSplatAsset.VectorFormat.Norm11); // 4 // ColorFormat — stored as a swizzle-tiled 2048-wide texture (DC color + opacity) // Float32x4 → 16 bytes/texel (full precision) // Float16x4 → 8 bytes/texel // Norm8x4 → 4 bytes/texel (default Medium preset) // BC7 → 1 byte/texel (block compressed, requires EditorUtility.CompressTexture) int colSize = GaussianSplatAsset.GetColorSize(GaussianSplatAsset.ColorFormat.Norm8x4); // 4 // SHFormat — stores 15 float spherical-harmonic coefficients per splat // Float32 → 15*3*4 = 180 bytes/splat // Float16 → 15*3*2 = 90 bytes/splat // Norm11 → 15*4 = 60 bytes/splat // Norm6 → 15*2 = 30 bytes/splat (default Medium) // Cluster64k/32k/16k/8k/4k → shared table of N entries; splats store a 2-byte index // VeryLow preset uses Cluster4k (~3-10 min clustering for 6M splats) int shCount = GaussianSplatAsset.GetSHCount(GaussianSplatAsset.SHFormat.Cluster4k, splatCount: 1_000_000); // 4096 long shBytes = GaussianSplatAsset.CalcSHDataSize(1_000_000, GaussianSplatAsset.SHFormat.Cluster4k); // = 4096 * sizeof(SHTableItemFloat16) + 1_000_000 * 2 (index) ``` ``` -------------------------------- ### Manage Splat Selection Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Provides methods to select all, invert, or deselect all splats. Selection state is updated after any edit operation. ```csharp splat.EditSelectAll(); // Ctrl+A splat.EditInvertSelection(); // Ctrl+I splat.EditDeselectAll(); // Read back selection state (populated after any Edit* call) Debug.Log($ ``` -------------------------------- ### Select Splats using Screen-Space Rect Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Selects splats within a specified screen-space rectangle. Use `subtract = true` for Ctrl+drag behavior (removing from selection). ```csharp using GaussianSplatting.Runtime; using UnityEngine; GaussianSplatRenderer splat = FindObjectOfType(); // --- Selection --- // Rectangle-select splats visible in a camera view (screen-space rect in pixels) Vector2 rectMin = new Vector2(100, 100); Vector2 rectMax = new Vector2(400, 400); splat.EditUpdateSelection(rectMin, rectMax, Camera.main, subtract: false); // Shift+drag equivalent: subtract = false (add to selection) // Ctrl+drag equivalent: call with subtract = true ``` -------------------------------- ### GaussianSplatValidator.ValidateD3D12 Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt An editor-only utility for validating render quality. It renders reference scenes, computes PSNR/RMSE against known-good images, and logs or saves diff images when quality deviates. This function can be called directly from code to trigger the validation process. ```APIDOC ## GaussianSplatValidator — Render quality validation (Editor debug tool) `GaussianSplatValidator` is an editor-only utility (`Tools > Gaussian Splats > Debug`) that renders several reference scenes, computes PSNR/RMSE against known-good reference images, and logs or saves diff images when quality deviates. Used to verify correctness after renderer changes. ```csharp // Menu: Tools > Gaussian Splats > Debug > Validate Render against D3D12 // Menu: Tools > Gaussian Splats > Debug > Validate Render against SBIR // Expected assets at: Assets/GaussianAssets/bicycle-point_cloud-iteration_30000-point_cloud.asset // Assets/GaussianAssets/truck-point_cloud-iteration_30000-point_cloud.asset // Assets/GaussianAssets/garden-point_cloud-iteration_30000-point_cloud.asset // Reference images at: ../../docs/RefImages/{D3D12|SBIR}_{scene}{cameraIndex}.png // Typical PSNR output on RTX 3080 Ti: // SBIR: bicycle=43.76, truck=39.36, garden=43.50 // D3D12: matches reference exactly // If errorsCount > 50 or PSNR < 90, diff/ref/got PNG files are written alongside the project. // GaussianSplatting.Editor.GaussianSplatValidator.ValidateD3D12(); // callable from code ``` ``` -------------------------------- ### Delete and Export Splats Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Permanently deletes selected splats and provides functionality to export modified splat data to a buffer. The `editModified` flag indicates if any changes have been made. ```csharp // Delete selected splats permanently splat.EditDeleteSelected(); Debug.Log($ ``` -------------------------------- ### Export Modified Splat Data Source: https://context7.com/aras-p/unitygaussiansplatting/llms.txt Exports the modified splat data to a GraphicsBuffer. Set `bakeTransform` to true to export in world space. This is typically called internally by the editor for exporting modified PLY files. ```csharp // --- Export modified data to a raw float32 PLY-compatible buffer --- // (editor wrapper GaussianSplatRendererEditor calls this internally for "Export modified PLY") int floatsPerSplat = 62; // matches 3DGS PLY layout var exportBuf = new GraphicsBuffer(GraphicsBuffer.Target.Structured, splat.splatCount, floatsPerSplat * 4); bool ok = splat.EditExportData(exportBuf, bakeTransform: true); // bakeTransform = world-space export // read back exportBuf, write to PLY... exportBuf.Dispose(); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.