Skip to content

VRSL GI (DMX): The GI Function Script

AcChosen edited this page Sep 6, 2023 · 7 revisions

The VRSL GI Function Script

The VRSL GI Function Script is an optional management script that facilitates the functionality of the Function Light Type in GI Setup Scripts, as well as provides an appropriate outlet to facilitate selectively updating the positions and rotation of VRSL GI points in real-time. Think of this script as a means to bind Function type GI Setup Scripts with mesh/materials that can be animated.

The way the script is set, there is a resizable list of GI points that can be added manually, and for each point that's added in, you can opt-in to have their color controlled by a mesh's material, have its position/rotation constantly updated, or both.

Each GI Point Function can be updated individually by sending a custom event with the appropriate function name, located at the top of the GI Function entry in the Function Script.

Variables and Functions

  • Is Running? - Enable or Disable all updates on this script.
  • Update Position Function Name - The name of the custom event to call to update all positions./rotations of listed GI points who have opted in.
  • # of Live Updated GI Positions - The number of GI positions that have opted in to have their positions/rotations updated constantly at runtime.
  • GI Manager - A reference field for the GI manager in the scene. Hit the Find VRSL GI Manager button to find the first one in the scene and fill this field with it.
  • Size - The size of the list of GI Points. A minimum of 1 and a maximum of 64. Use the + and - buttons to increment or decrement the size. Not every GI point in the scene needs to be part of this script. Only the ones that have a light type of Function do. As well as GI Points you want to be able to move around at runtime.

The following fields are for each instance of GI point entry.

  • VRSL GI Setup - The VRSL GI Setup script to target for this entry.
  • Mesh Material To Sample Color From - The mesh renderer in the scene that has a material with a "_Color" property you wish to sample from. It is recommended to grab a simple mesh with only one material, such as a small simple quad you can hide away and animate the color on.
  • Function Name - The custom event name to update the color of the GI point listed here with the color from the Mesh Material To Sample Color From
  • Live Update GI Position - Opt for this GI Point to have its position/rotation updated whenever the Update Position Function Name is called.
  • Enable Global Function Name - Opt for this GI Point to have its color updated by the Global Function Update Name. This function can be called by the Position Updater Script.