XGRIDSDocs
  • 简体中文
  • English
  • 繁體中文
  • 日本語
  • Deutsch
  • Español
  • Italiano
  • Français
  • Русский
  • Polski
  • Nederlands
  • 简体中文
  • English
  • 繁體中文
  • 日本語
  • Deutsch
  • Español
  • Italiano
  • Français
  • Русский
  • Polski
  • Nederlands
  • Lixel PortalCam Series

    • PortalCam P1

      • Product Overview
      • Basic Operation
      • Using the LCC Scan App
      • Maintenance and Care
      • FAQ
  • Lixel K Series

    • Lixel K1

      • Product Overview
      • Basic Operation
      • Device Activation and Connection
      • Scanning Workflow
      • Acquire Point Cloud Data with Absolute Coordinate
      • Map Fusion
      • Route Planning Suggestions for Typical Scenes
      • Precautions
      • FAQ
    • Lixel K2

      • Product Overview
      • Basic Operation
      • Device Activation and Connection
      • Scanning Workflow
      • Acquire Point Cloud Data with Absolute Coordinate
      • Map Fusion
      • Route Planning Suggestions for Typical Scenes
      • Precautions
      • FAQ
  • Lixel L Series

    • Lixel L2 Pro

      • Product Overview
      • Basic Operation
      • Device Activation and Connection
      • Scanning Workflow
      • Acquire Point Cloud Data with Absolute Coordinate
      • Measure Point
      • Appendix
      • FAQ
    • Lixel L3

      • Product Overview
      • Basic Device Functions
      • Device Activation and Connection
      • Data Capture
      • Capturing Absolute Coordinates
      • Appendix
  • Accessories

    • Stick Light

      • Installation Guide
      • Basic Operation
      • FAQ
  • Lixel Studio

    • Version and Copyright
    • Installation and Activation
    • Software Interface
    • File Operations
    • Project Processing
    • Tools
    • 2D Drawing
    • Applications
    • Settings
    • Device Connection
    • FAQ
  • Lixel CyberColor

    • LCC Studio

      • Getting Started
      • Version and Updates
      • Download and Installation
      • Interface Overview and Navigation
      • Before Reconstruction
      • Model Reconstruction
      • Single Model Reconstruction
      • Map Fusion
      • Aerial-Ground Fusion
      • Aerial Reconstruction
      • My Models
      • Other Features
      • Settings and Account
      • Converter
      • Video Reconstruction
      • FAQ
    • LCC Scene Editor

      • Version & Updates
      • Account & Login
      • Product Overview & Home
      • Editor Interface
      • Scene Navigation Modes
      • File
      • Settings
      • Edit Operations
      • Window
      • Global Toolbar
      • Assets & Properties
      • Left Toolbar
      • Viewpoints
      • Portal
      • Skybox
      • Annotations
      • Measurement
      • Flythrough
      • Scene Report
      • 3D Layout
      • Mini-Map
      • Preview Mode (Viewer)
      • Help
      • FAQ
      • Spawn Point
    • LCC Model Editor

      • Version and Updates
      • User Guide
      • Overview and Interface
      • File Operations
      • Selectors
      • Editing Models
      • Measurement
      • Color Grading
      • Asset Management
      • Settings and Help
      • FAQ
    • Capture Guide

      • Overview
      • Capture Devices Overview
      • General Capture Principles
      • Indoor Scene Capture
      • Outdoor Scene Capture
      • Large-Scale Capture (Map Fusion)
      • Aerial-Ground Map Fusion Capture
      • Object Capture
      • People Capture
      • Video Reconstruction Capture
      • HD Enhancement
      • Control Points (Lixel P1)
      • FAQ and Troubleshooting
    • LCC Studio Linux

      • Product Overview
      • Architecture Guide
      • Installation and Deployment Guide
      • Container Startup Parameters Guide
      • CodeMeter Offline Licensing Deployment Guide
      • API Reference
      • Appendix - Developer Data Guide
      • Appendix - Error Code List
      • Single-Machine Multi-GPU Cluster Deployment QuickStart
    • Best Practices

      • Merging Multiple Large 3DGS Models
    • Version History
  • Plugin & SDK

    • Unreal

      • Introduction
      • Quick Start - Windows
      • Quick Start - Linux
      • Quick Start - Quest3
      • Editions and Licensing
      • Rendering
      • Tiled Rasterization (Experimental)
      • Visual Settings
      • Normals and Lighting
      • Scene Editing
      • Performance Parameters
      • Performance Guide
      • Third-party and Engine Plugin Integration
      • Proxy Mesh
      • Loading Animation
      • Collision
      • Navigation System Support
      • Single Layer Water Support
      • Localization
      • FAQ
      • Troubleshooting
      • Logging and Diagnostics
      • Contact Us
      • Best Practices

        • Relighting 3DGS with a LixelStudio Mesh
      • API Reference

        • ALCCActorBase
        • ULCCComponentBase
        • ULCCComponent
        • ULCC2Component
        • SOG / SPZ / PLY Actors
        • ALCC2ProxyMesh
        • ALCCClippingVolume
        • ALCCSectionPlane
        • ALCCLoadVolume
        • ULCCUtilLibrary
        • Enums
        • Structs
      • Changelog

        • v3.4.0
        • v3.3.1
        • v3.0.0
        • v2.2.1
        • v1.0.0
        • v0.9.0
        • v0.8.0
        • v0.7.1
        • v0.6.1
        • v0.5.2
        • v0.4.1
        • v0.4.0
        • v0.3.0
        • v0.0.5
        • v0.0.4
        • v0.0.3
        • v0.0.2
        • v0.0.1
    • Unity

      • Unity SDK Introduction
      • Technical Features
      • Development Environment Requirements
      • PC Quick Start Guide
      • Project Settings Optimization Guide
      • Pico 4 Ultra Development Guide
      • Pico 4 Ultra PC Streaming Guide
      • Quest 3 Development Guide
      • Quest 3 PC Streaming Guide
      • OpenXR Development Guide
      • Pico 4 Ultra Business Streaming Guide
      • Glossary
      • FAQ
      • Contact Us
      • Feature Development Guide

        • Multi-Scene Mixed Rendering Development Guide
        • Shadow Receiving Development Guide
        • Real-Time Lighting Development Guide
        • Multi-Camera Rendering Development Guide
        • High-Resolution Image Rendering Development Guide
        • LCC and LCC2 Data Format Compatibility Development Guide
        • Loading Effect Development Guide
        • Mip Rendering Mode Switching Development Guide
        • Edge and Corner Snapping Development Guide
        • Projected Decal Development Guide
        • Video Projected Decal Development Guide
        • Highlight Development Guide
        • Real-Time Clipping Development Guide
        • Color Adjustment Development Guide
        • Getting Scene Mesh Data Development Guide
        • Editor Mode Development Guide
        • Render Performance Parameter Configuration Guide
        • Application and Data Co-packaging Development Guide
        • Collision System Development Guide
        • macOS Development Permission Issue Guide
        • iOS Device Compilation and Packaging Development Guide
      • API Reference

        • LCCManager
        • Renderer
        • Data Types
      • Changelog

        • v2.3.0
        • v2.2.10
        • v2.2.0
        • v2.1.19
        • v2.0.14
    • Web

      • Introduction
      • Rendering Performance Optimization Guide
      • Graphics Configuration
      • FAQ
      • API Reference

        • LCCRender::clearIndexDB
        • LCCRender::dispose
        • LCCRender::load
        • LCCRender::setCamera
        • LCCRender::unload
        • LCCRender::update
        • LCCObject::checkRenderNextFrame
        • LCCObject::clearRenderNextFrame
        • LCCObject::ecef2Prj
        • LCCObject::getBounds
        • LCCObject::getEnvInstancedMesh
        • LCCObject::getInstancedMesh
        • LCCObject::getLodInfos
        • LCCObject::getOriginPosition
        • LCCObject::getProjectionCoordinateSystemInfos
        • LCCObject::hasCollision
        • LCCObject::hasEnvironment
        • LCCObject::hasShcoef
        • LCCObject::intersectsCapsule
        • LCCObject::intersectsRayExt
        • LCCObject::intersectsRayFromOriginExt
        • LCCObject::intersectsSphere
        • LCCObject::lowerToBottom
        • LCCObject::prj2Ecef
        • LCCObject::raiseToTop
        • LCCObject::raycast
        • LCCObject::raycastFromOrigin
        • LCCObject::setAlpha
        • LCCObject::setClipBox
        • LCCObject::setClipPlane
        • LCCObject::setEndLod
        • LCCObject::setLodAutoLevelUp
        • LCCObject::setMaxDistance
        • LCCObject::setMaxNodeSplats
        • LCCObject::setMaxSplats
        • LCCObject::setOriginPosition
        • LCCObject::setPointsColor
        • LCCObject::setRenderState
        • LCCObject::setRotation
        • LCCObject::setScale
        • LCCObject::setSemantic
        • LCCObject::setSemanticColor
        • LCCObject::setSmooth
        • LCCObject::setStartLod
        • LCCObject::setTranslation
        • LCCObject::setVisible
        • LCCObject::togglePointsDisplayMode
        • LCCObject::useEnvironment
        • LCCObject::useShcoef
      • Changelog

        • v0.6.3
        • v0.6.2
        • v0.6.1
        • v0.6.0
        • v0.5.5
        • v0.5.4
        • v0.5.3
        • v0.5.2
        • v0.5.1
        • v0.5.0
        • v0.4.1
        • v0.4.0
        • v0.3.1
        • v0.3.0
        • v0.2.0
    • Lixel OpenAPI

      • Overview
      • Connection & Authentication
      • Message Model & Codec
      • Interface Catalog
      • Real-time Data
      • Project File Access
      • Error Codes
      • Python

        • Quick Start
        • Client Wrapper & Tools
        • FAQ
      • C++

        • Quick Start
        • Client & Examples
        • FAQ

LCC and LCC2 Data Format Compatibility Development Guide

The LCC2 data format provides better data compression and LOD mechanisms. The original LCC format will gradually be replaced by LCC2, and the original LCC SDK (v1.x) will gradually stop being maintained. Because the old and new data formats differ greatly, the new LCC SDK (v2.x) is not backward compatible with the LCC format. Data compatibility can be achieved in the following two ways:

  1. Use the official converter (LccConverter) exe/dll to convert the LCC data format to LCC2, then use it in the SDK;
  2. Implement LCC and LCC2 data format compatibility at the application layer.

This guide mainly describes the flow and steps of implementing data format compatibility at the application layer, that is, importing two versions of the SDK into the same Unity project at the same time and automatically selecting the corresponding version for rendering and processing based on the data format.

Step 1: Unity version and project settings

The Unity version and project settings are the same as when using the SDK independently; no additional configuration is required. See PC Quick Start Guide and Project Settings Optimization Guide.

Step 2: Import the two SDK versions

Import SDK v1.4.8 and later (v1.4.32 is recommended) and SDK v2.0.1 and later through Unity UPM. After importing, the v1.x version will be displayed as Legacy. The two SDK versions can coexist without affecting each other.

Note:

  • SDK v1.4.32 can be downloaded from GitHub: https://github.com/xgrids/LCC-Unity-SDK/releases
  • SDK v1.4.32's namespace is LCCCore_Legacy and its manager component is LCCManager_Legacy; v2.x's namespace is LCCCore and its manager component is LCCManager.

Step 3: Configure the scene

Create an empty object in the scene named LCCController, and attach both the LCCManager_Legacy and LCCManager components to it.

Attach the LCCManager_Legacy and LCCManager components to the LCCController object

Attach both the LCCManager_Legacy and LCCManager components to the LCCController object

Note:

The Transform settings of the LCCController GameObject (Rotation.x = -90, Scale.x = -1) align it with the LCC data coordinate system. For details on coordinate system alignment, see "LCC Data Coordinate System" in Unity SDK Introduction.

Step 4: Write the MultiSDKController script

Create a new C# script named MultiSDKController.cs with the following code:

using LCCCore;
using LCCCore_Legacy;
using System.IO;
using UnityEngine;

public class MultiSDKController : MonoBehaviour
{
    public LCCManager_Legacy m_managerLegacy;          // for LCC SDK v1.4.8 and earlier
    public LCCManager m_manager;                       // for LCC SDK v2.0.0 and later
    public string m_FilePath;                          // LCC file path
    private LCCCore_Legacy.Renderer m_rendererLegacy;  // for LCC SDK v1.4.8 and earlier
    private LCCCore.Renderer m_renderer;               // for LCC SDK v2.0.0 and later
    private DataType m_dataType;                       // data type, used to determine which SDK to use

    void Start()
    {
        string extension = Path.GetExtension(m_FilePath);
        if (extension == ".lcc")
        {
            m_manager.Enable = false; // disable the v2.0.0+ manager
            m_dataType = DataType.LCC;
            m_rendererLegacy = m_managerLegacy.GetRender(this.transform);
            m_rendererLegacy.Load(m_FilePath, LCCCore_Legacy.PlatformType.PC, onLoadCallback);
        }
        else if (extension == ".lcc2")
        {
            m_managerLegacy.Enable = false; // disable the v1.4.8 and earlier manager
            m_dataType = DataType.LCC2;
            m_renderer = m_manager.GetRender(this.transform);
            m_renderer.Load(m_FilePath, LCCCore.PlatformType.PC, onLoadCallback);
        }
    }

    private void onLoadCallback()
    {
        Debug.Log("data loaded !!!");
    }

    // Method call example: determine which SDK renderer to operate on by data type
    public void onRenderPointClick()
    {
        if (m_dataType == DataType.LCC)
            m_rendererLegacy.SwitchRenderMode(LCCCore_Legacy.RenderMode.PointCloud);
        else if (m_dataType == DataType.LCC2)
            m_renderer.SwitchRenderMode(LCCCore.RenderMode.PointCloud);
    }

    void OnDestroy()
    {
        if (m_dataType == DataType.LCC)
            m_rendererLegacy?.Dispose();
        else if (m_dataType == DataType.LCC2)
            m_renderer?.Dispose();
    }

    public enum DataType { LCC, LCC2 }
}

Note:

  • The script file name must match the class name (MultiSDKController.cs corresponds to class MultiSDKController), otherwise it cannot be attached to a GameObject.
  • The two versions have different namespaces (LCCCore and LCCCore_Legacy). When using same-named types such as Renderer, PlatformType, and RenderMode, you need to prefix them with the namespace to distinguish them.
  • The example determines the data format by the file extension (.lcc / .lcc2) and selects the corresponding SDK version.

Step 5: Attach the script and set properties

  1. Attach the MultiSDKController.cs script to the LCCController object in the scene as well.
  2. In the Inspector window, drag the LCCManager and LCCManager_Legacy components onto the corresponding script properties.
  3. Fill in the LCC / LCC2 file path in the script's File Path property.
Attach the MultiSDKController script and set its properties

Attach the MultiSDKController script and set its properties in the Inspector

Now when you run the code, the corresponding SDK version is automatically used for rendering based on the LCC data format, achieving data format compatibility.

Key Steps

The key steps for implementing LCC and LCC2 data format compatibility at the application layer:

  1. Import both the v1.x (Legacy) and v2.x SDK versions through UPM; the two can coexist.
  2. Attach both the LCCManager_Legacy and LCCManager manager components to the same object.
  3. Select the corresponding version's manager to create a renderer and load data based on the data format (file extension .lcc / .lcc2).
  4. After determining which version to use, disable the other version's manager (Manager.Enable = false).
  5. When switching data or destroying, unload the currently rendered data via Renderer.Dispose().

Data Format Compatibility Notes

  • Simultaneous rendering of LCC and LCC2 is not supported. Therefore, when switching data, you need to unload the currently rendered data first (call Renderer.Dispose()), otherwise it may cause memory and video memory leaks.

  • Disable the unused Manager. After determining which SDK version to use, it is best to disable the Manager object of the other SDK version (Manager.Enable = false), otherwise it may cause some ineffective performance overhead.

  • The API interfaces are consistent, but you must call the correct Renderer. The API interfaces of the two SDK versions are exactly the same (in v2.x many APIs have been moved to the Manager class; see the API manual), but you must ensure you call the correct version's Renderer (m_rendererLegacy or m_renderer). In addition, v2.0.0 and later no longer support color adjustment and clipping data saving, and some other APIs are also deprecated; please check the developer documentation for the corresponding version.

Related APIs

This solution mainly involves the manager and renderer APIs of the two SDK versions. The following uses v2.x (LCCCore) as an example; v1.x (LCCCore_Legacy) has the same interface with only a different namespace.

LCCManager.Enable

// Property
public bool Enable { get; set; }

The manager's enable switch. Setting it to false disables that SDK version's manager, avoiding ineffective performance overhead from working simultaneously with the other version.

Usage example:

// When using LCC2 data, disable the Legacy manager
m_managerLegacy.Enable = false;

Notes:

  • After determining which version to use, it is recommended to disable the other version's manager.

GetRender

// Return value: Renderer → render instance, null on failure
public Renderer GetRender(Transform _transform)

Creates a render instance and binds it to the specified Transform.

ParameterTypeDescription
_transformTransformThe Transform the render instance is attached to

Usage example:

m_renderer = m_manager.GetRender(this.transform);

Notes:

  • Must be created through the corresponding version's manager to ensure the renderer matches the data format.

Renderer.Dispose

// Return value: void
public void Dispose()

Destroys the render instance and releases all GPU resources and memory. The instance cannot be used again after destruction.

Usage example:

m_renderer?.Dispose();

Notes:

  • Before switching data, you must unload the current data first, otherwise it may cause memory and video memory leaks.
  • After calling, it automatically notifies the Manager to remove the reference.
  • It is recommended to call it when the object is destroyed (OnDestroy).