Collection of useful Unity Shaders, made for VRChat. They are not dependent on its SDK but some features rely on VRChat shader globals. Unless specified, they have only be tested in a PC VR VRChat context : DX11, unity built-in render pipeline.
Install :
Github repository in case you found this documentation from an installed package.
These overlay shaders are useful on avatars for world analysis (Wireframe, Normals, Grid, HUD), adjusting lighting (Gamma Adjust), debugging lights (Debug Lighting).
All overlays have multiple modes, statically selected by _Overlay_Mode property :
Mesh : applied on the meshFullscreen : applied as a screenspace shader (fullscreen). Has a dynamic toggle between fullscreen and mesh.Billboard Sphere : emulate a sphere mesh, with fullscreen when camera is inside.
Support mesh must be a flat surface with uniform normal. The sphere is defined by UV0 : center at (0.5, 0.5), radius 0.5.
Renderer object space 0 must be at the center of the object defined by UVs (no batching).
Example of valid mesh : unity quad. Also make the culling bounds a cube to prevent it from being culled.Trail : applied to a trail renderer. Only defined for overlays where it differs from Mesh mode. Changes from Mesh mode :
TrailRenderer Texture Mode to Static for UVs that stay immobile in world space, and make Texture Scale = 1/width to make the UVs have identical axis scales.
Sadly adding a dissolve on trail ends is likely not possible ; unity does not provide the information to the shader in trail renderer, and particle trails do not have the right behavior when stopping trail emission.If you use a fullscreen mode, it is good practice to only animate the fullscreen toggle locally (IsLocal VRChat parameter) to avoid annoying others.
Fullscreen mode uses VRChat shader globals to ignore mirror (always) and secondary cameras (toggle).
Note that this fullscreen effect only works if the mesh renderer is not culled by Unity, so ensure that the mesh bounds are in view of the player camera.
Since v1.4.0 the fullscreen mode uses the vertex stage only (no geometry pass).
This will fail depending on the mesh vertex ordering ; symptoms are a missing triangle on the screen.
To fix it change the vertex order slider until it displays correctly.
Billboard sphere mode is defined in object space. Non uniform scaling can transform the sphere into an ellipsoid. Using a very small scale on one axis will emulate a disc (flattened ellipsoid).
Overlays with a solid color also support border dissolve to appear less artificial :
None : no dissolveRadial dissolve mode makes the overlay dissolve radially from the UV (0.5, 0.5) point.
Direction, speed, noise scale, and transition scale and position can be selected.
Using a negative transition width dissolves at the center instead of the sides.
Works for all overlay modes, but inverted billboard sphere is not great.![]()
The Demo scene demonstrate their use on a dummy scene.
Adjust the gamma of the scene image behind it, like a post process effect.
Uses a GrabPass.
This is very useful to simulate low-light vision in dark spaces (without a dynamic light !), or decrease luminosity in worlds that are too bright.
![]()
These 3 overlays reconstruct the position of the scene pixels, and use it for various display effects :
Grid overlays a 1m (dependent on Zoom) world space grid on the scene objects, along X/Y/Z planesNormals shows the world space normals of the actual triangle geometry of the scene (without the normal maps !), color codedWireframe displays scene triangles with white edges on darkAll of these overlays use the _CameraDepthTexture, a unity feature to access the depth of scene pixels.
This texture is only available if required by the render pipeline, usually if a realtime dynamic light with shadows is present on the scene.
For worlds without dynamic light and shadows, you can force _CameraDepthTexture by adding a light on your avatar at the cost of avatar Rank : https://github.com/netri/Neitri-Unity-Shaders?tab=readme-ov-file#types.
I personnaly choose to not put a light on my avatars for performance reasons (they are really bad !), and accept that the _CameraDepthTexture is not always available.
These shaders are inspired by similar ones from https://github.com/netri/Neitri-Unity-Shaders, but they have been improved to be more numerically precise and do not use any GrabPass.
![]()
![]()
![]()
This shader shows various world positionning data in a fighter jet like HUD with emission :
_CameraDepthTexture is available (see note for depth).The HUD displays at infinity, like a reflector sight or a skybox.
You can select whether the reticle is aligned with the camera or with the mesh normals.
If you align with mesh normals, ensure that they are the same direction on the entire mesh, or the HUD will be distorted.
This works well on a simple quad.
For more complex geometries, you must ensure that all triangles have the same normal vectors ; this can be done with custom normals in blender.
In Billboard Sphere mode, the reticle is aligned with the sphere center, or camera if inside the sphere.
No specific Trail mode ; use Mesh mode with Camera reticle direction, as the normals are not specified.
This shader uses a small internal texture for the font (MSDF strategy).
![]()
Display lighting configuration elements that touch the mesh renderer as gizmos in the world :
Available in two variants :
Debug/Lighting : apply to any mesh (only 1 vertex required), displays gizmos if within the distance limitOverlay/Debug Lighting : displays gizmos only if seen through the overlay window. Support the various overlay modes.![]()
Applied to mesh, this shaders displays the tangent space at each vertex as small 3D lines.
![]()
Material that does not render anything.
This is useful to fill material slots that cannot be disabled by animators on avatars (skinned mesh slots).
This shader comes with a material configured to use the Material.SetShaderPassEnabled trick by d4rkpl4y3r (https://github.com/d4rkc0d3r/UnityAndVRChatQuirks?tab=readme-ov-file#skipping-draw-call-for-material-slot).
If this is used properly, the material does not generate any draw call.
As a fallback, this sets the clip space positions to NaN to discard all geometry.
lereldarion.unity-shaders
https://github.com/lereldarion/unity-shaders
2.0.1
2019.4 以降
なし
なし
なし