CVR LTCGI Adapter ¶
This component provides the interface to set up and control LTCGI in your World
Setup¶
The component will guide you to set up LTCGI
- Pick any game object and select
Add Component
and look forCVR LTCGI Adapter
inChillout VR
. You should get something like this: - You can now click
Import LTCGI via UPM
, this will download and install the LTCGI package in your unity project.
Note1: If you already have it in your project you may skip this step
Note2: If this doesn't work, (for example gives an error saying git is not installed), use theDownload Unity 2021 LTCGI UnityPackage
button - If LTCGI is installed in you project you should see something like
this:
- Now click on
Create LTCGI Controller
, so it adds the LTCGI Controller component to the game object - The end result should be something like
this:
- You can now configure the LTCGI Controller (for example adding the Video Player Texture) and other settings you may want to change. After that you should be all set.
Controlling during Runtime¶
There are 2 methods you can call from unity events to control LTCGI in runtime, they are available when targeting the CVRLTCGI Adapter Component
This is not required for LTCGI to work, it just provides a bit more control for advanced users
Method | Description |
---|---|
SetGlobalState(bool state) | Globally enables or disables LTCGI. Material-swapping to a material with LTCGI disabled in addition to using this method is recommended for best performance |
SetVideoTexture(Texture texture) | Changes the global realtime video texture input at runtime. This operation is fairly expensive and should only be called when necessary |
Example of a button to disable LTCGI¶
Enable LTCGI on Avatars¶
Some shaders have LTCGI
compatibility, but they only show the option if the LTCGI package is installed. Poiyomi shader
is compatible for example.
Note1: LTCGI has a noticeable performance impact, it's recommended to add a toggle to enable or disable on the avatar
Note2: We're not using the original LTCGI
repo/package because it doesn't support Unity 2021, the changes to
support were requested on the official repo.
You can get the latest Unity 2021 compatible package here: https://github.com/kafeijao/ltcgi/releases/latest
Removing the LTCGI package¶
If you want to remove the LTCGI package from your project, you can go to Window
-> Package Manager
, find the LTCGI
package and hit the button Remove
After doing this, you should have some errors because you also need to remove the Symbols:
- On the Top Menu pick
Edit
->Project Settings
- On the left select
Player
- Scroll almost to the bottom where there's a list with
Scripting Define Symbols
- Look for the entry
LTCGI_INCLUDED
and remove it. This should ensure the package is fully removed.
Troubleshooting¶
Incompatible LTCGI Package¶
Library\PackageCache\at.pimaker.ltcgi@0242d67e55\Editor\LTCGI_Controller.cs(151,58): error CS0117: 'SceneManager' does not contain a definition for 'loadedSceneCount'
Solution: You're using a version of LTCGI that is not compatible with Unity 2021. You need to remove the
package (Window
-> Package Manager
) and then import a Unity 2021 compatible version. It can be acquired
here: https://github.com/kafeijao/ltcgi/releases/latest
Broken/Incomplete LTCGI installation¶
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?)
Solution: Either install the LTCGI package in your project, or fully remove it