VRChat Shader Globals
VRChat provides multiple global shader parameters Shader creators can use to implement VRChat-specific features.
The following shader globals are currently available:
float _VRChatCameraMode
:0
- Rendering normally1
- Rendering in VR handheld camera2
- Rendering in Desktop handheld camera3
- Rendering for a screenshot
uint _VRChatCameraMask
- ThecullingMask
property of the active camera, available if_VRChatCameraMode != 0
float _VRChatMirrorMode
:0
- Rendering normally, not in a mirror1
- Rendering in a mirror viewed in VR2
- Rendering in a mirror viewed in desktop mode
float3 _VRChatMirrorCameraPos
- World space position of mirror camera (eye independent, "centered" in VR),(0,0,0)
when not rendering in a mirrorfloat3 _VRChatScreenCameraPos
- World space position of main screen camerafloat4 _VRChatScreenCameraRot
- World space rotation (quaternion) of main screen camerafloat3 _VRChatPhotoCameraPos
- World space position of handheld photo camera (first instance when using Dolly Multicam),(0,0,0)
when camera is not activefloat4 _VRChatPhotoCameraRot
- Look, you get the idea