banner
幻梦晓寒

幻梦晓寒HACK-FOX

醉后不知天在水,满船清梦压星河
x
github
bilibili
vrchat

ltcgi usage

Since the images in this article are linked to the IPFS address of xlog, the article images on this site cannot be loaded. For a better reading experience, please visit the original site: https://xlog.xiaohan-kaka.me/ltcgi-use

Preface#

LTCGI is an optimized plug-and-play real-time area light solution that uses the linear transformation cosine algorithm and is suitable for independent Unity and VRChat. It is free to use with proper attribution. It can achieve realistic shadows on static objects using Unity's built-in light maps or Bakery.

Using LTCGI can achieve elegant reflection effects on objects and even video players in VRChat, while also achieving better performance.

This article only provides a general description of usage. For specific details, please refer to the official documentation: https://ltcgi.dev/

Installation#

Make sure your project is using supported shaders:

Shader List
ORL Shader Family by @orels1
Silent's Filamented
Mochie's Unity Shaders
Hekky Shaders
z3y's Shaders
Basic "Unlit" Test Shader (included)
Surface Shader (included)

Add using VCC:
https://vpm.pimaker.at/

If not used for VRChat projects, you can import it via Git in the package manager:

https://github.com/PiMaker/ltcgi.git

After importing the project, find LTCGI_Controller and place it in the scene wherever you like. This is a prefab used to control LTCGI baking and adjust some settings.

Usage#

LTCGI is used to control the glowing component and is a component called LTCGI_Screen.

It must be placed on a Mesh Filter object with at least 3 or 4 vertices.
For example: quad

image

Controller Explanation#

image

NameMeaning
arealight shapeDefines the shape of the light
colorLight color (the button below is used to try to directly obtain it from the attached object)
Diffuse modeDiffuse reflection mode
specularChoose whether to reflect
DynamicMarks this screen object as dynamic. It has a slight performance cost but allows the screen to be moved and its color to be changed at runtime
double sidedBoth sides of the object emit light instead of just one side
flip uvFlip the UV
affect avatarsWhether to affect the character itself (provided that the character uses a compatible shader)
color modeColor mode
Affected RenderersSelect which renderers in the scene should receive light from this LTCGI screen
Lightmap ChannelSelect the lightmap channel that this screen will occupy when baking shadows

Diffuse Reflection Mode#

TypeMeaning
no diffuseDisable
LTC DiffuseDiffuse reflection using the LTC algorithm
Lightmap DiffuseDirectly use the data calculated in the shadow map baking

Color Mode#

TypeMeaning
staticStatic
TextureChoose color from the texture, can be used for video textures or other static textures
Single UVSimilar to texture, but the screen will be lit at the exact UV coordinates specified below with a single color obtained from the texture
audiolinkLink to audiolink and detect signals in the specified area, such as bass

Applying Real-Time Video Textures#

The following example uses the VidViz player. If you are using the ProTV player, you can directly use the button on the controller to configure it with one click. Some players also have options to automate the configuration of LTCGI.

For other players, refer to: https://ltcgi.dev/Getting%20Started/Setup/Realtime_Video

  1. Add the screen texture used by LTCGI to the output target of the player.

image

image

  1. Go to LTCGI_Controller and assign the texture added to the player to the video texture option.

image

  1. Then select the screen component of the player and add a component, which is the LTCGI_Screen mentioned above. Configure the options and you're done.

Afterword#

This article roughly covers the basics of LTCGI. I myself only have a partial understanding of this tool. Maybe I will update this article in the future when I become more proficient in using this tool. It can also be combined with audiolink to create some cool effects, but that's another matter.

It is recommended to read the official documentation: https://ltcgi.dev/

This article is synchronized and updated to xLog by Mix Space.
The original link is https://blog.xiaohan-kaka.me/posts/unity/ltcgi-use


Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.