Overarching class for global shader setters. See documented functions for more.
Exposes a subset of Unity’s built-in `Graphics` class. See documented functions for more.
Copies source texture into destination render texture 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 which 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.
VRCGraphics.Blit will not work on the Quest GPU unless you:
Add ZTest Always to the shader
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, it 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 value as
floatfor now, due to a Unity bug
Updated 4 days ago