Overarching class for global shader setters. See functions documented below for more.
Exposes a subset of Unity’s built-in `Graphics` class. See documented functions for more.
Copies source texture into destination RenderTexture with a shader. Note that we do not allow you to supply a null destination.
The version of the SDK installed by the Creator Companion includes an example scene that provides a performant Minimap as an example use of Graphics.Blit. You can open it from the Unity Menu Bar under VRChat SDK > Samples > Minimap. This example uses the Udon Graph, it's also available as an UdonSharp example.
Meta Quest Exceptions
VRCGraphics.Blit will not work on the Quest GPU unless you:
Add ZTest Always to the shader OR Turn off the depth on the target RenderTexture.
Failing to do so will cause the operation to fail.
Draw the same mesh multiple times using GPU instancing.
Use PropertyToID to get an ID based on a shader property name. Call this function only once during initialization, the ID can be reused and will not change, even between different materials and shaders.
Note that the property name must be prefixed with “_Udon”, or be the literal string “_AudioTexture” in order to be used with VRCShader.SetGlobal, however, will still return the ID regardless of this.
Use the ID acquired with PropertyToID as a key and specify a value of the correct type. The value will be available in all shaders in the world (including ones on avatars!) under the name passed into PropertyToID.
- VRCShader.SetGlobalInteger() still sets the value as
floatfor now, due to a Unity bug