Skip to content

CVR LTCGI Adapter

Interface component for setting up and controlling LTCGI in your world.

The component guides you through the LTCGI setup.

  1. Pick any GameObject, click Add Component, and search for CVR LTCGI Adapter under Chillout VR. You should see:
    1-ltcgi-package-missing.png
  2. Click Import LTCGI via UPM to download and install the LTCGI package.
    Note 1: If it is already installed, skip this step.
    Note 2: If installation fails (for example because git is not installed), use the Download Unity 2021 LTCGI UnityPackage button instead.
  3. Once LTCGI is installed, the inspector looks like:
    2-ltcgi-controller-missing.png
  4. Click Create LTCGI Controller to add the LTCGI Controller component to the same GameObject.
  5. The finished setup looks like:
    3-ltcgi-controller-added.png
  6. Configure the LTCGI Controller (for example by assigning the Video Player Texture) and any other settings you want.

Two methods can be invoked from UnityEvents to control LTCGI at runtime when targeting the CVR LTCGI Adapter component. This is optional — LTCGI works without calling them — but gives advanced users extra control.

MethodDescription
SetGlobalState(bool state)Globally enables or disables LTCGI.
For best performance, also swap to a material with LTCGI disabled on top of calling this method.
SetVideoTexture(Texture texture)Changes the global realtime video texture input at runtime.
This call is fairly expensive — only call it when necessary.

button-toggle-global-state.png

Some shaders are LTCGI-compatible but only expose the option when the LTCGI package is installed. Poiyomi, for example, supports it.

Note 1: LTCGI has a noticeable performance impact. Add a toggle to enable or disable it on your avatar.

Note 2: We are not using the original LTCGI repo/package because it does not support Unity 2021; changes to support were requested on the official repo.

The latest Unity-2021-compatible package is here: github.com/kafeijao/ltcgi/releases/latest.

To remove the LTCGI package, open WindowPackage Manager, find the LTCGI package, and hit Remove.

Afterwards you may have errors because the scripting define symbol still exists:

  1. Top menu: EditProject Settings.
  2. Select Player on the left.
  3. Scroll almost to the bottom and find the list of Scripting Define Symbols.
  4. Remove the entry LTCGI_INCLUDED.

Library\PackageCache\at.pimaker.ltcgi@0242d67e55\Editor\LTCGI_Controller.cs(151,58): error CS0117: ‘SceneManager’ does not contain a definition for ‘loadedSceneCount’

TroubleshootingIncompatibleLTCGI.png

Solution: You are using an LTCGI version that is not compatible with Unity 2021. Remove the package (WindowPackage Manager) and install a Unity-2021-compatible release: https://github.com/kafeijao/ltcgi/releases/latest.

Assets\ABI.CCK\Components\CVRLTCGIAdapter.cs(103,27): error CS0246: The type or namespace name ‘LTCGI_UdonAdapter’ could not be found (are you missing a using directive or an assembly reference?)

TroubleshootingMissingLTCGI.png

Solution: Either install the LTCGI package in your project, or fully remove it.

The component stores a versioned serialized data blob — currently Versions.V1 with serializedDataV1 (a DataV1 container). DataV1 mirrors the LTCGI runtime inputs: the list of opted-in renderers, lightmaps and their ST vectors, per-renderer masks, screen transforms and counts, the pair of LUTs, LOD textures (including four Texture2DArray static LOD slots), screen vertex arrays, and the blur custom render texture input. A CVRLTCGIAdapterRuntime is created at runtime to handle _SetGlobalState / _SetVideoTexture.

  • CVR-GameFiles/ABI.CCK.Components/CVRLTCGIAdapter.cs