LCCManager: Core Manager
The core manager of the LCC Unity SDK, responsible for managing all Renderer instances, cameras, global rendering state, as well as edit operations (clipping / highlighting / tone), decal projection, snapping and interaction queries (raycast / collision). There should be only one LCCManager instance in the whole scene.
| Namespace | LCCCore |
| Base class | MonoBehaviour |
LCCManager has no public properties; all functionality is accessed through methods. The methods are grouped by purpose:
- Initialization and Configuration
- Runtime Rendering Control
- Lighting and Shadows
- Camera Management
- Clipping / Highlighting / Tone
- Decal Projection
- Snapping
- Raycasting and Collision Queries
- Visual Effects
- Instance Queries
Initialization and Configuration
The following methods are used to complete the pre-configuration of platform, render mode, capacity and so on before loading data. Most methods must be called before any Renderer.Load().
SetPlatformType
public void SetPlatformType(PlatformType _type)
Sets the SDK's target runtime platform, which affects the internal rendering strategy and resource allocation.
| Parameter | Type | Description |
|---|---|---|
_type | PlatformType | Target platform; see PlatformType |
Notes:
- Must be executed before any
GetRender()call.
Example:
lccManager.SetPlatformType(PlatformType.PC);
SwitchRenderPass
public void SwitchRenderPass(ActiveRenderMode _mode)
Sets the global rendering architecture mode. MultiRender uses a shared GPU buffer and can render up to 255 Renderers simultaneously; SingleRender lets the SDK automatically select the rendering path based on the data size.
| Parameter | Type | Description |
|---|---|---|
_mode | ActiveRenderMode | Render mode; see ActiveRenderMode |
Notes:
- Must be called before any
Renderer.Load(). - Only effective on PC / Mac platforms; mobile / VR platforms automatically adopt an adaptive strategy, and calling this method is rejected.
- The
MultiRendermode does not support HTTP data sources; useSingleRenderfor HTTP data. - Once any Renderer completes
Load(), the mode is locked and cannot be switched again.
Example:
lccManager.SwitchRenderPass(ActiveRenderMode.MultiRender);
GetRender (Overload 1: Bind Transform)
// Return value: Renderer, null on failure
public Renderer GetRender(Transform _transform)
Creates a new rendering instance and binds it to the specified Transform. After creation, Renderer.Load() must be called to load data.
| Parameter | Type | Description |
|---|---|---|
_transform | Transform | The Transform to which the rendering instance is attached |
Notes:
SetPlatformType()andSetMainCamera()must be called first.- Up to 255 Renderers are supported in
MultiRendermode.
Example:
var go = new GameObject("LCCScene");
var renderer = lccManager.GetRender(go.transform);
renderer.Load(filePath, null, () => Debug.Log("Loaded"));
GetRender (Overload 2: Create GameObject Automatically)
// Return value: Renderer, null on failure
public Renderer GetRender(out GameObject gameObject)
Automatically creates a GameObject named LCCRenderer and binds the rendering instance to its Transform.
| Parameter | Type | Description |
|---|---|---|
gameObject | out GameObject | Outputs the automatically created GameObject, null on failure |
Example:
var renderer = lccManager.GetRender(out GameObject go);
renderer.Load(filePath, null, () => Debug.Log("Loaded"));
SetMaxBufferSplat
public void SetMaxBufferSplat(int _count)
Sets the maximum capacity of the GPU buffer (Splat count). Allocated once and cannot be changed dynamically.
| Parameter | Type | Description |
|---|---|---|
_count | int | Maximum Splat count, unit: ten thousand (value × 10000 = actual count) |
Notes:
- Must be called before any
Renderer.Load(), andSetPlatformType()must be called first. - Larger capacity means higher video memory usage; set it as needed.
- Platform limits: PC / Mac / PCVR 45 million, Android / iOS 6 million, VR (Pico / Quest / PicoSwan / AVP / OpenXR) 2 million.
- Defaults: PC / Mac 30 million, Android / iOS 3 million, VR 1 million.
Example:
lccManager.SetMaxBufferSplat(3000); // 30 million points
SetFullRenderSplat
public void SetFullRenderSplat(int _count)
Sets the upper threshold for PC / Mac full rendering. When the data size is below this value, the full rendering path is used; otherwise the chunked rendering path is used.
| Parameter | Type | Description |
|---|---|---|
_count | int | Full rendering upper limit, unit: ten thousand, range [100, 4500] |
Notes:
- Supported only on PC / Mac / PCVR platforms.
- Must be called before any
Renderer.Load(), andSetPlatformType()must be called first.
Example:
lccManager.SetFullRenderSplat(2500); // 25 million points
SetMaxRenderSplats
public void SetMaxRenderSplats(int _count)
Sets the maximum number of Splats rendered per frame at runtime. Can be called dynamically after Load().
| Parameter | Type | Description |
|---|---|---|
_count | int | Maximum number of Splats rendered at runtime, unit: ten thousand |
Notes:
- Can be adjusted dynamically at runtime.
- Cannot exceed the capacity set by
SetMaxBufferSplat(); it is auto-clamped when exceeded. - No effect in full rendering mode.
Example:
lccManager.SetMaxRenderSplats(2500); // 25 million points
GetLoadRatio
// Return value: float, [0,1] current data loading progress
public float GetLoadRatio()
Queries the loading progress of the current scene data.
Notes:
- Always returns
1.0in full rendering mode. - In chunked rendering mode, returns the ratio of loaded nodes under the current view; the value changes in real time with camera movement and is not a monotonically increasing overall progress.
Example:
float ratio = lccManager.GetLoadRatio();
progressBar.value = ratio;
SetSelectionMode
public void SetSelectionMode(SelectionMode mode)
Sets the node selection strategy.
| Parameter | Type | Description |
|---|---|---|
mode | SelectionMode | Selection strategy; see SelectionMode |
Notes:
Auto(default): decided automatically based on the overall bounding box of the scene; when the scene's maximum dimension exceeds about 380 meters, it automatically upgrades toLarge.Normal: suitable for small and medium scenes.Large: suitable for very large scenes (over 1000 meters).- Takes effect immediately when switched.
Example:
lccManager.SetSelectionMode(SelectionMode.Auto);
Runtime Rendering Control
The following methods can be called dynamically at runtime to adjust rendering precision, display effects and rendering toggles.
SetDetailLevel
public void SetDetailLevel(float sse)
Sets the rendering precision level. A larger value means finer rendering and higher performance consumption.
| Parameter | Type | Description |
|---|---|---|
sse | float | Precision level, range [1, 100], auto-clamped when exceeded |
Notes:
- Uses logarithmic mapping: changes are sensitive in the low-value range and smooth in the high-value range.
- Can be adjusted dynamically at runtime.
- Only takes effect in
Normalselection mode.
Example:
lccManager.SetDetailLevel(50f); // Medium precision
SetStartLod
public void SetStartLod(int lod)
Sets the LOD expansion starting point (0-based). 0 is the finest, and a larger number means a coarser level.
| Parameter | Type | Description |
|---|---|---|
lod | int | LOD starting level, range [0, 10], auto-clamped when exceeded |
Notes:
- The actual effective upper limit is constrained by the total number of data levels.
Example:
lccManager.SetStartLod(0);
SetAutoFov
public void SetAutoFov(bool _auto)
Sets whether to automatically manage the rendering FOV. When enabled (default), the SDK locks a pixel focal length baseline at the first frame, then inverts the vertical FOV from the current viewport height each frame and writes it back to Camera.fieldOfView; when disabled, fieldOfView is controlled externally (SetFOV() or directly changing the camera).
| Parameter | Type | Description |
|---|---|---|
_auto | bool | Whether to use auto FOV |
Notes:
- Enabled by default.
- When enabled, it continuously rewrites the main camera's
Camera.fieldOfView, so callingSetFOV()is ignored. - When disabled,
SetFOV()must be called manually to set parameters.
Example:
lccManager.SetAutoFov(true);
SetFOV
public void SetFOV(int _width, int _height, float _verticalFov, float _aspect)
Manually sets the vertical FOV (in degrees). Directly rewrites the main camera's Camera.fieldOfView so that the FOV in the Inspector matches the FOV actually used for rendering. _width / _height / _aspect are legacy signature parameters; the actual projection uses the main camera's own viewport (use SetRecordMode() for offscreen output with a different size / FOV).
| Parameter | Type | Description |
|---|---|---|
_width | int | Pixel width |
_height | int | Pixel height |
_verticalFov | float | Vertical FOV (degrees) |
_aspect | float | Aspect ratio |
Notes:
SetAutoFov(false)must be called first, otherwise the per-frame auto-FOV inversion overwrites the manual value.- Vertical FOV is clamped to
[1, 179]degrees. - Calling it on VR / PCVR platforms, during recording, or under an orthographic camera is rejected (warns and returns).
Example:
lccManager.SetFOV(1920, 1080, 60f, 1.778f);
SetRenderEnable
public void SetRenderEnable(Renderer _renderer, bool _isEnable)
Controls the rendering toggle of the specified Renderer at runtime. When disabled, it does not participate in traversal and drawing.
| Parameter | Type | Description |
|---|---|---|
_renderer | Renderer | Target rendering instance |
_isEnable | bool | Whether to enable rendering |
Example:
lccManager.SetRenderEnable(renderer, false); // Hide
SetEnvironment
public void SetEnvironment(Renderer _renderer, bool _isRender)
Controls the environment data rendering of the specified Renderer. Environment data is a low-precision background point cloud used to fill distant views.
| Parameter | Type | Description |
|---|---|---|
_renderer | Renderer | Target rendering instance |
_isRender | bool | Whether to render environment data |
Notes:
- The data must contain environment nodes.
Example:
lccManager.SetEnvironment(renderer, true);
SetZDepth
public void SetZDepth(bool zwrite)
Toggles Z depth write and adjusts the render queue accordingly.
| Parameter | Type | Description |
|---|---|---|
zwrite | bool | Whether to enable Z depth write |
Example:
lccManager.SetZDepth(true);
SetAlpha
public void SetAlpha(float alpha)
Sets the global opacity.
| Parameter | Type | Description |
|---|---|---|
alpha | float | Global opacity, range [0, 1], auto-clamped when exceeded |
Example:
lccManager.SetAlpha(0.8f);
SetLightIntensity
public void SetLightIntensity(float intensity)
Sets the global light intensity.
| Parameter | Type | Description |
|---|---|---|
intensity | float | Light intensity, range [0, 1], auto-clamped when exceeded |
Example:
lccManager.SetLightIntensity(0.7f);
SetLowPassFilter
public void SetLowPassFilter(float _filter)
Sets the global low-pass filter strength, used to suppress high-frequency aliasing / noise.
| Parameter | Type | Description |
|---|---|---|
_filter | float | Low-pass filter strength, range [0, 1], auto-clamped when exceeded |
Example:
lccManager.SetLowPassFilter(0.3f);
SetLockFPS
public void SetLockFPS(bool _isLock)
Toggles frame rate locking (static / dynamic frame rate switching).
| Parameter | Type | Description |
|---|---|---|
_isLock | bool | Whether to lock the frame rate |
Example:
lccManager.SetLockFPS(true);
SetRenderLayer
public void SetRenderLayer(int _layer)
Sets the Unity Layer used by LCC rendering, for camera CullingMask visibility control.
| Parameter | Type | Description |
|---|---|---|
_layer | int | Unity rendering layer, range [0, 31] |
Notes:
- Can be adjusted dynamically at runtime.
Example:
lccManager.SetRenderLayer(8); // Use Layer 8
SetForceRefresh
public void SetForceRefresh()
Forces a rendering refresh. Clears the internal camera info cache so that the frustum, LOD and other parameters are recalculated on the next frame. Suitable for cases where externally changed camera parameters need to take effect immediately.
Example:
lccManager.SetForceRefresh();
SetMipMode
public void SetMipMode(MipMode _mipMode)
Switches the Mip rendering mode. Mip mode uses mipmap sampling (default), and Non_Mip mode disables mipmap.
| Parameter | Type | Description |
|---|---|---|
_mipMode | MipMode | Target mode; see MipMode |
Notes:
- Returns immediately if the current mode is the same as the passed mode.
- Takes effect immediately when switched.
Example:
lccManager.SetMipMode(MipMode.Non_Mip);
SetGraphicsAPI
public void SetGraphicsAPI(GraphicsDeviceType type)
Sets the graphics API type. HDR is enabled in DX11 mode.
| Parameter | Type | Description |
|---|---|---|
type | GraphicsDeviceType | Graphics API type (Unity built-in enum) |
Example:
lccManager.SetGraphicsAPI(GraphicsDeviceType.Direct3D11);
SetDebugMode
public void SetDebugMode(bool debug)
Toggles debug mode.
| Parameter | Type | Description |
|---|---|---|
debug | bool | Whether to enable debug mode |
Notes:
- Supported only on PC / Mac platforms.
Example:
lccManager.SetDebugMode(true);
SetEditorMode
public void SetEditorMode(bool _isEditor)
Toggles Editor mode.
| Parameter | Type | Description |
|---|---|---|
_isEditor | bool | Whether to enable Editor mode |
Notes:
- Supported only on PC / Mac platforms.
Example:
lccManager.SetEditorMode(true);
SetAECMode
public void SetAECMode(bool _aec)
Toggles AEC (Architecture / Engineering / Construction) mode.
| Parameter | Type | Description |
|---|---|---|
_aec | bool | Whether to enable AEC mode |
Notes:
- Supported only on PC / Mac platforms.
Example:
lccManager.SetAECMode(true);
SetSemantic
// Return value: bool, false=invalid parameter
public bool SetSemantic(bool enable, Vector4[] color = null)
Toggles semantic rendering mode. When enabled, a color array can be passed to define the display color of each semantic category.
| Parameter | Type | Description |
|---|---|---|
enable | bool | Whether to enable semantic rendering |
color | Vector4[] | Semantic color array, length must be 100, otherwise false is returned; pass null to use default colors |
Example:
Vector4[] colors = new Vector4[100];
colors[0] = new Vector4(1, 0, 0, 1); // Category 0 = red
lccManager.SetSemantic(true, colors);
SwitchRenderMode
public void SwitchRenderMode(RenderMode mode, Texture2D tex = null)
Switches between point cloud rendering and 3DGS rendering. An elevation color ramp texture can be provided in point cloud mode.
| Parameter | Type | Description |
|---|---|---|
mode | RenderMode | Rendering mode; see RenderMode |
tex | Texture2D | Elevation color ramp texture (optional) |
Notes:
- Supported only on PC / Mac platforms.
Example:
lccManager.SwitchRenderMode(RenderMode.PointCloud, elevationTex);
SetRecordMode
public void SetRecordMode(bool isRecord, Vector2 renderSize, float verticalFov)
Sets recording mode. In recording mode, a fixed resolution and FOV are used for rendering, suitable for HD video recording.
| Parameter | Type | Description |
|---|---|---|
isRecord | bool | Whether to use recording mode |
renderSize | Vector2 | Recording resolution |
verticalFov | float | Vertical FOV (degrees) |
Notes:
- Supported only on PC / Mac platforms.
- In recording mode, the camera focal length is fixed and does not change with the Camera component.
- After recording, call
SetRecordMode(false, ...)to restore.
Example:
lccManager.SetRecordMode(true, new Vector2(3840, 2160), 60f);
SetVRPerformance
public void SetVRPerformance(bool _enabled)
Sets the VR high-performance sorting mode. true uses GPU radix sorting (GpuSorter), and false falls back to CPU / BitonicSorter.
| Parameter | Type | Description |
|---|---|---|
_enabled | bool | Whether to enable GPU high-performance sorting |
Notes:
- Only affects the sorting path of VR headsets (Pico / Quest / PicoSwan / OpenXR); enabled by default.
- When there is no compute device (such as Mali), the sorting upstream automatically falls back to CPU, unaffected by this toggle.
Example:
lccManager.SetVRPerformance(true);
Lighting and Shadows
The following methods control shadow reception and custom point lights on 3DGS surfaces. Shadow-related methods must be called after the LCC scene finishes loading.
SetShadowReceive
public void SetShadowReceive(bool enable)
Toggles point cloud shadow reception. When enabled, shadows from Mesh objects in the scene can be cast onto 3DGS point cloud surfaces.
| Parameter | Type | Description |
|---|---|---|
enable | bool | Whether to receive shadows |
Notes:
- Disabled by default.
- Requires Mesh objects that cast shadows and a Directional Light in the scene.
Example:
lccManager.SetShadowReceive(true);
SetShadowColor
public void SetShadowColor(Color color)
Sets the color of the shadow area.
| Parameter | Type | Description |
|---|---|---|
color | Color | Shadow color (RGBA) |
Notes:
- Default
(0.3, 0.3, 0.3, 1). SetShadowReceive(true)must be enabled first.
Example:
lccManager.SetShadowColor(new Color(0.3f, 0.3f, 0.3f, 1f));
SetShadowStrength
public void SetShadowStrength(float strength)
Sets the shadow strength. 0 is no shadow, 1 is the strongest shadow.
| Parameter | Type | Description |
|---|---|---|
strength | float | Shadow strength, range [0, 1], auto-clamped when exceeded |
Notes:
- Default
1.0. SetShadowReceive(true)must be enabled first.
Example:
lccManager.SetShadowStrength(0.8f);
SetLights
// Return value: int, 0=success, -1=exceeded the maximum count limit
public int SetLights(List<PointLightData> lights)
Sets the custom point light list. Passing null or an empty list turns off custom lighting.
| Parameter | Type | Description |
|---|---|---|
lights | List<PointLightData> | Point light list; see PointLightData |
Notes:
PointLightData.lightType:0is a point light (direction / spotAngle ignored),1is a spot light (direction / spotAngle required).- Passing
nullor an empty list turns off custom lighting.
Example:
using Unity.Mathematics; // float3
var lights = new List<PointLightData>();
lights.Add(new PointLightData {
position = new float3(0, 5, 0),
lightType = 0, // 0=point light, 1=spot light
color = new float3(1, 1, 1),
intensity = 2f,
range = 10f
});
lccManager.SetLights(lights);
Camera Management
SetMainCamera
public void SetMainCamera(Camera _cam)
Sets the main rendering camera. LCC uses this camera for frustum culling, LOD selection, sorting and other operations.
| Parameter | Type | Description |
|---|---|---|
_cam | Camera | Main rendering camera; pass null to clear |
Notes:
- Must be set before
Renderer.Load(). - Supported only on PC / Mac platforms.
Example:
lccManager.SetMainCamera(Camera.main);
AddCamera
public void AddCamera(Camera _cam)
Adds a secondary camera. The secondary camera participates in rendering but does not affect LOD selection.
| Parameter | Type | Description |
|---|---|---|
_cam | Camera | Secondary camera |
Notes:
- Supported only on PC / Mac platforms.
- The main camera cannot be added as a secondary camera.
Example:
lccManager.AddCamera(secondCamera);
RemoveCamera
public void RemoveCamera(Camera _cam)
Removes an added secondary camera.
| Parameter | Type | Description |
|---|---|---|
_cam | Camera | The secondary camera to remove |
Notes:
- Supported only on PC / Mac platforms.
Example:
lccManager.RemoveCamera(secondCamera);
Clipping / Highlighting / Tone
Clipping, highlighting and tone are three kinds of edit operations, all of which support defining the affected region via 2D texture, 3D geometry or a mix of both. See Data2D, Data3D, DataMix and ToneMix.
SetClip (Plane Clipping)
// Return value: int, 0=success
public int SetClip(Vector3 planePoint, Vector3 planeNormal, bool inside = true)
Clips the point cloud with an infinite plane, keeping points on the normal side or the opposite side.
| Parameter | Type | Description |
|---|---|---|
planePoint | Vector3 | A point on the plane |
planeNormal | Vector3 | Plane normal |
inside | bool | true keeps the normal side |
Notes:
- Mutually exclusive with other clipping modes.
Example:
lccManager.SetClip(Vector3.zero, Vector3.up, true); // Keep above the ground
SetClip (2D Texture Clipping)
// Return value: int, 0=success, 1=empty list, 2=exceeded the maximum count
public int SetClip(List<Data2D> _2Ds)
Clips the point cloud using a 2D projected texture mask.
| Parameter | Type | Description |
|---|---|---|
_2Ds | List<Data2D> | 2D texture selection list |
Example:
var clips = new List<Data2D>();
clips.Add(new Data2D {
texture = maskTex,
mv = modelViewMatrix,
mvp = mvpMatrix,
mode = SelectMode.normal
});
lccManager.SetClip(clips);
SetClip (3D Geometry Clipping)
// Return value: int, 0=success, 1=empty list, 2=exceeded the maximum count, 3=zero valid geometry
public int SetClip(List<Data3D> _3Ds)
Clips the point cloud with 3D geometry, supporting boolean operations to combine multiple geometries.
| Parameter | Type | Description |
|---|---|---|
_3Ds | List<Data3D> | 3D geometry list |
Notes:
- At least one geometry with
operation == normalis required.
Example:
var clips = new List<Data3D>();
clips.Add(new Data3D {
type = ShapeType.box,
invMat = boxInverseMatrix,
operation = OperationMode.normal,
mode = SelectMode.normal
});
lccManager.SetClip(clips);
SetClip (Mixed-mode Clipping)
// Return value: int, 0=success, 1=empty list, 2=exceeded the maximum count
public int SetClip(List<DataMix> mix)
Defines the clipping region with a mix of 2D textures and 3D geometries. Each entry specifies its type via editType.
| Parameter | Type | Description |
|---|---|---|
mix | List<DataMix> | Mixed selection list (2D + 3D) |
Example:
var mix = new List<DataMix>();
mix.Add(new DataMix {
editType = EditType.Edit3D,
type = ShapeType.box,
invMat = matrix,
operation = OperationMode.normal,
mode = SelectMode.normal
});
lccManager.SetClip(mix);
QuitClipMode
public void QuitClipMode()
Exits clipping mode and restores the full point cloud display.
Example:
lccManager.QuitClipMode();
SetHighlight (2D Texture Highlighting)
// Return value: int, 0=success, 1=empty list, 2=exceeded the maximum count
public int SetHighlight(List<Data2D> _2Ds)
Highlights the point cloud using a 2D projected texture mask; the point cloud outside the highlighted region is dimmed.
| Parameter | Type | Description |
|---|---|---|
_2Ds | List<Data2D> | 2D texture selection list |
Notes:
- Mutually exclusive with 3D highlighting and mixed highlighting.
Example:
var highlights = new List<Data2D>();
highlights.Add(new Data2D {
texture = maskTex,
mv = modelViewMatrix,
mvp = mvpMatrix,
mode = SelectMode.normal
});
lccManager.SetHighlight(highlights);
SetHighlight (3D Geometry Highlighting)
// Return value: int, 0=success, 1=empty list, 2=exceeded the maximum count, 3=zero valid geometry
public int SetHighlight(List<Data3D> _3Ds)
Defines the highlighted region with 3D geometry, supporting boolean operations to combine.
| Parameter | Type | Description |
|---|---|---|
_3Ds | List<Data3D> | 3D geometry list |
Notes:
- At least one geometry with
operation == normalis required.
Example:
var highlights = new List<Data3D>();
highlights.Add(new Data3D {
type = ShapeType.box,
invMat = boxInverseMatrix,
operation = OperationMode.normal,
mode = SelectMode.normal
});
lccManager.SetHighlight(highlights);
SetHighlight (Mixed-mode Highlighting)
// Return value: int, 0=success, 1=empty list, 2=exceeded the maximum count
public int SetHighlight(List<DataMix> mix)
Defines the highlighted region with a mix of 2D textures and 3D geometries.
| Parameter | Type | Description |
|---|---|---|
mix | List<DataMix> | Mixed selection list |
Example:
var mix = new List<DataMix>();
mix.Add(new DataMix {
editType = EditType.Edit3D,
type = ShapeType.box,
invMat = matrix,
operation = OperationMode.normal,
mode = SelectMode.normal
});
lccManager.SetHighlight(mix);
QuitHighlightMode
public void QuitHighlightMode()
Exits highlighting mode and restores the normal point cloud display.
Example:
lccManager.QuitHighlightMode();
SetTone
// Return value: int, 0=success, 1=empty list, 2=exceeded the maximum count
public int SetTone(List<ToneMix> mix)
Applies tone adjustment to the selected region, supporting brightness, saturation, contrast and LUT filters. The tone region can be defined by 2D texture or 3D geometry.
| Parameter | Type | Description |
|---|---|---|
mix | List<ToneMix> | Tone mix list |
Notes:
brightness/saturation/contrastdefault to1.0.lutidis the LUT filter index;0means not used.
Example:
var tones = new List<ToneMix>();
tones.Add(new ToneMix {
editType = EditType.Edit3D,
type = ShapeType.box,
invMat = boxMatrix,
operation = OperationMode.normal,
mode = SelectMode.normal,
brightness = 1.2f,
saturation = 1.0f,
contrast = 1.1f,
lutid = 0
});
lccManager.SetTone(tones);
QuitToneMode
public void QuitToneMode()
Exits tone mode and restores the original point cloud color.
Example:
lccManager.QuitToneMode();
Decal Projection
Decal projection projects a texture onto 3DGS surfaces along the projector direction. The decal is world-fixed global state, consistent for all cameras. The typical workflow is: enable the decal → set the texture → set the projector pose. The following methods are supported only on PC / Mac platforms.
SetDecalEnabled
public void SetDecalEnabled(bool enable)
Toggles decal projection. SetDecalTexture() and SetDecalProjection() must be called separately to set the content and projector pose.
| Parameter | Type | Description |
|---|---|---|
enable | bool | Whether to enable decal projection |
Notes:
- Disabling does not clear the cached texture / parameters.
Example:
lccManager.SetDecalEnabled(true);
lccManager.SetDecalTexture(decalTex);
lccManager.SetDecalProjection(projectorPos, projectorRot, 60f, 1.778f, 0.1f, 20f);
SetDecalTexture
public void SetDecalTexture(Texture2D tex)
Sets the decal texture. RGB is the color, and A is the decal's own mask, which is multiplied with the global opacity and edge feathering.
| Parameter | Type | Description |
|---|---|---|
tex | Texture2D | Decal texture; passing null clears the reference |
Example:
lccManager.SetDecalTexture(logoTex);
SetDecalProjection
public void SetDecalProjection(Vector3 pos, Quaternion rot, float fov, float aspect, float near, float far)
Sets the pose and perspective parameters of the decal projector. The projector projects along its forward (+Z) direction, and points inside the frustum are covered by the decal.
| Parameter | Type | Description |
|---|---|---|
pos | Vector3 | Projector world position |
rot | Quaternion | Projector orientation |
fov | float | Vertical FOV (degrees), clamped to [1, 179] |
aspect | float | Aspect ratio, minimum 1e-4 |
near | float | Near clipping plane, minimum 1e-3 |
far | float | Far clipping plane, minimum near + 1e-3 |
Example:
lccManager.SetDecalProjection(new Vector3(0, 10, 0), Quaternion.Euler(90, 0, 0), 60f, 1.778f, 0.1f, 20f);
SetDecalOpacity
public void SetDecalOpacity(float opacity)
Sets the overall opacity of the decal.
| Parameter | Type | Description |
|---|---|---|
opacity | float | Overall decal opacity, range [0, 1], auto-clamped when exceeded |
Example:
lccManager.SetDecalOpacity(0.8f);
SetDecalEdgeFade
public void SetDecalEdgeFade(float edgeFade)
Sets the decal edge feathering width. 0 is a hard edge, and a larger value makes the edge transition softer.
| Parameter | Type | Description |
|---|---|---|
edgeFade | float | Edge feathering width (UV space ratio), range [0, 0.5), auto-clamped when exceeded |
Example:
lccManager.SetDecalEdgeFade(0.1f);
SetDecalOcclusion
public void SetDecalOcclusion(bool enable)
Toggles decal occlusion culling (based on the projector depth map). When enabled, occluded surfaces are not covered by the decal.
| Parameter | Type | Description |
|---|---|---|
enable | bool | Whether to enable decal occlusion culling |
Notes:
- PC / Mac platform only, and URP pipeline only.
SetDecalProjection()should have been called to set the projector before enabling.- Depends on the quality parameters configured by
SetDecalOcclusionSettings().
Example:
lccManager.SetDecalOcclusion(true);
SetDecalOcclusionSettings
public void SetDecalOcclusionSettings(DecalOcclusionSettings settings)
Sets all quality parameters of decal occlusion culling at once. See DecalOcclusionSettings.
| Parameter | Type | Description |
|---|---|---|
settings | DecalOcclusionSettings | Occlusion culling quality parameters |
Notes:
- Can be adjusted at any time; parameters take effect immediately.
Example:
lccManager.SetDecalOcclusionSettings(DecalOcclusionSettings.Default);
lccManager.SetDecalOcclusionSettings(new DecalOcclusionSettings {
opacityCutoff = 0.1f,
depthBias = 0.05f,
footprintMaxPx = 2,
resolution = 1024
});
Snapping
The snapping feature automatically searches for nearby edges / corners to align during raycasting, and is commonly used for precise interaction such as measurement and annotation. The following methods are supported only on PC / Mac platforms.
SetSnapEnabled
public void SetSnapEnabled(bool enable)
Toggles the snapping feature. When enabled, RaycastWithSnap() automatically searches for nearby edges / corners to snap to.
| Parameter | Type | Description |
|---|---|---|
enable | bool | Whether to enable snapping |
Notes:
- Disabled by default.
- No effect on mobile / VR, and a warning is output.
Example:
lccManager.SetSnapEnabled(true);
SetSnapRadius
public void SetSnapRadius(float pixels)
Sets the snapping search radius. Searches for the nearest edge / corner within this pixel range.
| Parameter | Type | Description |
|---|---|---|
pixels | float | Snapping search radius (pixels) |
Notes:
- Default 20 pixels.
- A larger value means a wider search range, but may snap to unintended targets.
Example:
lccManager.SetSnapRadius(30f);
SetEdgeThreshold
public void SetEdgeThreshold(float threshold)
Sets the edge detection threshold. A smaller value detects more edges.
| Parameter | Type | Description |
|---|---|---|
threshold | float | Edge detection threshold, recommended range [0.1, 0.8] |
Notes:
- Default
0.3. - A value too small produces a large amount of noise edges.
Example:
lccManager.SetEdgeThreshold(0.2f);
SetSnapPreviewEnabled
public void SetSnapPreviewEnabled(bool enable)
Toggles the snap preview feature. When enabled, the nearest snap target indicator is displayed in real time as the mouse moves.
| Parameter | Type | Description |
|---|---|---|
enable | bool | Whether to enable snap preview |
Notes:
SetSnapEnabled(true)must be called first.- Preview continuously consumes GPU resources (detection every frame).
Example:
lccManager.SetSnapPreviewEnabled(true);
UpdateSnapPreview
public void UpdateSnapPreview(Vector2 mousePos, Camera cam)
Updates the snap preview state. Called as the mouse moves to update the preview indicator position.
| Parameter | Type | Description |
|---|---|---|
mousePos | Vector2 | Current mouse screen coordinates |
cam | Camera | Camera |
Notes:
SetSnapPreviewEnabled(true)must be called first.- Recommended to call continuously in
Update.
Example:
void Update()
{
lccManager.UpdateSnapPreview(Input.mousePosition, Camera.main);
}
GetSnapPreviewState
// Return value: SnapPreviewState
public SnapPreviewState GetSnapPreviewState()
Gets the current snap preview state, including whether there is a snap target, the target type, the target screen position and the pixel distance to the mouse. See SnapPreviewState.
Notes:
SetSnapPreviewEnabled(true)andUpdateSnapPreview()must be called first.- Returns
default(SnapPreviewState)when there is no target. screenPosis in screen coordinates, not world coordinates; useRaycastWithSnap()to getHitResult.hitPosfor world coordinates.
Example:
var state = lccManager.GetSnapPreviewState();
if (state.hasTarget)
{
// state.snapType: Corner / Edge
// state.screenPos: screen coordinates of the snap target
// state.distanceToMouse: pixel distance
}
Raycasting and Collision Queries
Raycasting is used to pick points on 3DGS surfaces, and collision queries are used for physical interaction between characters / objects and the point cloud. The hit result is returned via HitResult.
Note:
The hit point world coordinate field of
HitResultis namedhitPos(notposition).
Raycast (Screen Coordinates)
// Return value: bool, true=hit
public bool Raycast(Vector3 mousePos, out HitResult _finalResult)
Emits a ray from screen coordinates to detect point cloud hits. The ray is generated using the main camera set by SetMainCamera().
| Parameter | Type | Description |
|---|---|---|
mousePos | Vector3 | Screen coordinates |
_finalResult | out HitResult | Hit result |
Notes:
SetMainCamera()must be called first to set the main camera.- Returns the hit point closest to the camera.
- Precision is affected by
SetRaycastDelta(), and the maximum distance is controlled bySetMaxRaycastDistance().
Example:
if (lccManager.Raycast(Input.mousePosition, out HitResult hit))
{
Debug.Log(hit.hitPos);
}
Raycast (Ray)
// Return value: bool, true=hit
public bool Raycast(Ray _ray, out HitResult _finalResult)
Performs raycasting with a custom Ray, iterating over all active Renderers and returning the closest hit.
| Parameter | Type | Description |
|---|---|---|
_ray | Ray | Ray |
_finalResult | out HitResult | Hit result |
Example:
Ray ray = new Ray(origin, direction);
if (lccManager.Raycast(ray, out HitResult hit))
{
Debug.Log(hit.hitPos);
}
RaycastMesh (Screen Coordinates)
// Return value: bool, true=hit
public bool RaycastMesh(Vector3 mousePos, out HitResult _finalResult, float _distance = 70.0f)
Emits a ray from screen coordinates to detect hits against the point cloud collision mesh. Uses Collider data for detection, which is faster than Raycast() but less precise.
| Parameter | Type | Description |
|---|---|---|
mousePos | Vector3 | Screen coordinates |
_finalResult | out HitResult | Hit result |
_distance | float | Maximum detection distance, default 70.0 |
Notes:
- The data must contain Collider nodes, and
Renderer.SetColliderEnable(true)must be called first.
Example:
if (lccManager.RaycastMesh(Input.mousePosition, out HitResult hit))
{
Debug.Log(hit.hitPos);
}
RaycastMesh (Ray + Bounds)
// Return value: bool, true=hit
public bool RaycastMesh(Ray ray, out HitResult result, out Bounds hitBounds, float maxDist = 70.0f)
Performs collision mesh detection with a custom Ray, returning the bounding box of the hit node as well.
| Parameter | Type | Description |
|---|---|---|
ray | Ray | Ray |
result | out HitResult | Hit result |
hitBounds | out Bounds | Bounding box of the hit node |
maxDist | float | Maximum detection distance, default 70.0 |
Notes:
- The data must contain Collider nodes.
Example:
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (lccManager.RaycastMesh(ray, out HitResult hit, out Bounds bounds))
{
Debug.Log(bounds.center);
}
RaycastWithSnap
// Return value: bool, true=hit
public bool RaycastWithSnap(Vector2 screenPos, Camera cam, out HitResult result)
Raycasting with snapping. First performs a normal raycast, then searches for edges / corners near the hit point to snap to.
| Parameter | Type | Description |
|---|---|---|
screenPos | Vector2 | Screen coordinates |
cam | Camera | Camera |
result | out HitResult | Hit result (including snap info) |
Notes:
SetSnapEnabled(true)must be called first.- PC / Mac platforms only; not available on mobile / VR.
- Snap priority: Corner > Edge > None.
HitResult.snapTypeis the snap type,HitResult.hitPosis the world coordinate after snapping, andHitResult.originalHitPosis the original hit point before snapping.
Example:
if (lccManager.RaycastWithSnap(mousePos, cam, out HitResult hit))
{
// hit.snapType: Corner / Edge / None
// hit.hitPos: world coordinate after snapping
// hit.originalHitPos: original hit point before snapping
}
SetRaycastDelta
public void SetRaycastDelta(float delta)
Sets the precision parameter of raycasting. A smaller value means higher precision but higher performance consumption.
| Parameter | Type | Description |
|---|---|---|
delta | float | Raycasting precision, range [0.1, 10.0], auto-clamped when exceeded |
Notes:
- Default
0.1. - Affects the detection precision of all
Raycast()methods.
Example:
lccManager.SetRaycastDelta(0.5f);
SetMaxRaycastDistance
public void SetMaxRaycastDistance(float _distance)
Sets the maximum detection distance of the Raycast() methods.
| Parameter | Type | Description |
|---|---|---|
_distance | float | Maximum raycast distance, range [10, 10000], auto-clamped when exceeded |
Notes:
- Affects the
Raycast(Vector3)/Raycast(Ray)overloads; does not affectRaycastMesh()(which has its own distance parameter).
Example:
lccManager.SetMaxRaycastDistance(500f);
IntersectsSphere
// Return value: bool, true=intersects
public bool IntersectsSphere(Sphere sphere)
// Return value: bool, true=intersects
public bool IntersectsSphere(Sphere sphere, out Vector3 delta)
Detects whether a sphere intersects the point cloud collider. The second overload additionally returns the penetration vector, which can be used for physical pushing out.
| Parameter | Type | Description |
|---|---|---|
sphere | Sphere | Sphere |
delta | out Vector3 | Penetration vector (push-out direction and distance) |
Notes:
- The data must contain Collider nodes, and
Renderer.SetColliderEnable(true)must be called first. - Iterates over all active Renderers.
Example:
var sphere = new Sphere(transform.position, 0.5f);
if (lccManager.IntersectsSphere(sphere, out Vector3 delta))
{
transform.position += delta;
}
IntersectsCapsule
// Return value: bool, true=intersects
public bool IntersectsCapsule(Capsule capsule)
// Return value: bool, true=intersects
public bool IntersectsCapsule(Capsule capsule, out Vector3 delta)
Detects whether a capsule intersects the point cloud collider, commonly used for character controller collision detection. The second overload returns the penetration vector.
| Parameter | Type | Description |
|---|---|---|
capsule | Capsule | Capsule |
delta | out Vector3 | Penetration vector |
Notes:
- The data must contain Collider nodes, and
Renderer.SetColliderEnable(true)must be called first.
Example:
var capsule = new Capsule(footPos, headPos, 0.3f);
if (lccManager.IntersectsCapsule(capsule, out Vector3 delta))
{
characterController.Move(delta);
}
Visual Effects
TriggerVFX
public void TriggerVFX(Vector3 vfxOriginW, int vfxid = 0)
Triggers a visual effect at the specified world coordinate, spreading outward from that coordinate.
| Parameter | Type | Description |
|---|---|---|
vfxOriginW | Vector3 | World coordinate origin of the effect |
vfxid | int | Effect ID, default 0 |
Notes:
- Must be called after the LCC scene finishes loading.
Example:
lccManager.TriggerVFX(hitPoint, 0);
Instance Queries
GetAllRenderers
// Return value: List<Renderer>, a copy of all registered Renderer instances
public List<Renderer> GetAllRenderers()
Gets the list of all currently registered Renderer instances (returns a copy).
Example:
var renderers = lccManager.GetAllRenderers();
foreach (var r in renderers) { /* ... */ }