Ultimate Mirror Shaders | VRChat Asset
Added 2020-05-24 21:55:24 +0000 UTC
Mirror is something which exists in every VRChat world. But why don't we have fancy custom mirrors yet? So, I decided to create a mirror shader with lots of useful features!
Ultimate Mirror Shaders Features:
- Dissolving
- Distance based dissolve support
- Control the mirror with buttons or automatically
- Refracting the reflection
- Several dissolve shapes
- Customizable patterns
- Animating patterns
- Color correction options
- Fading with reflection probes
- Nice performance
- Much more!
So, this asset is for my Tier III patrons. You can download it here:
>>> DOWNLOAD ULTIMATE MIRROR SHADERS v.1.0.0 <<<
Test the asset in this VRChat world:
>>> VRCHAT DEMO WORLD <<<
Included prefabs
To make life easier for you, a made a bunch of example mirror prefabs, ready to use in your worlds. All of them already has built-in VRC triggers, which disables mirror on distance. Just few of them below.
Using simple Perlin noise texture you can achieve a flame effect:

Personally, love this plasma-like edges:

You can make a smooth transition from real reflection to faked with reflection probe:

There are some build-in color correction options:


Choose any shape:

Just drag & drop and its done
Basically, as you already have lots of pre-made prefabs, just drag and drop it into your world and it's done!

Don't forget to import the latest VRChat SDK first. Both SDK 2 and SDK 3 are supported, but prefabs are made for SDK 2 only. If you're using Udon, you'll need to implement disabling your mirror object by distance yourself.
PS: The example scene also uses Post Processing Stack 2, so be sure you downloaded it from the Unity Package Manager.
Almost all the prefabs are automatic mirrors, which activates by distance. But there is also an example prefab called "Toggle Mirror". It's an animated implementation of a mirror, that can be controlled with buttons.
How to use the shader
There are actually 3 different shaders in this pack:

- Mirror Dissolve - Dissolving the mirror using cutout mode (Sharp edges)
- Mirror Dissolve Transparent - Dissolving the mirror using transparent mode mode (Smooth transparent edges)
- Mirror Fade - Fading mirror with a reflection probe fake reflection
So, first two shaders are similar:

Visuals
- Overlay - Overlay image just like in default VRC Mirror shader (Multiply blending)
- Overlay Opacity - Controls Overlay's opacity. ( 0 by default )
- Dissolve Color - HDR color which represents dissolve edge effect color.
- Progress Control - How to control your dissolve? ( Distance Based - uses "Distance Close" and "Distance Far" values to define distance from your camera to the mirror object, on which dissolve will happen automatically. "Progress Value" will be a limit value in this case. Progress Value - Controls your dissolve progress with a "Progress Value" property in your material. Object Z Scale - Controls your dissolve progress with scaling your mirror object by Z direction. The thing is that VRC_MirrorReflection script does not allow you to change any mirror material values with animator. So, the best way to control a dissolve progress is just scaling the mirror plane by Z direction.)
- Progress Value - controls the dissolve progress in "Progress Value" mode or limits the dissolve in "Distance Based" mode.
- Distance Close, Distance Far - defines your distance-based dissolve region. (Basically, in meters from the mirror object, but can be differ depending on a dissolve effect)
Shape
- Type - The main shape mask of your dissolve effect.
- Invert - Inverts the shape mask.
- Rotation - Rotates the shape mask. (In degrees)
- Margin X, Margin Y - Scale offset from sides to your shape. Useful when the mirror mesh is scaled disproportionally.
- Offset X, Offset Y - Offsets the shape mask over the UV.
Outer Mask, Inner Mask
Outer mask controls the region which is outside the mirror's edge.
Inner mask controls the region which is inside the visible mirror shape.
- Mask - Texture to mask the dissolve zone. (Outer Mask uses R channel, Inner Mask uses G channel)
- Scale - Scales current dissolve zone.
- Speed X, Speed Y - Animates and moves your mask in specified direction.
Refraction
Basically, you that's an offsetted inner mask region, which can refract the image.
- Normal - Normal map to refract the reflection.
- Power - Refraction power.
- Offset - Offset to make your refraction area larger.
- Speed X, Speed Y - Animates and moves your normal map in specified direction.
Back Side
You can make your mirror double sided.
- Double Sided - Enables or disables the back of the mirror
- Color - Color of mirror's back. Alpha controls transparency, but for "Mirror Dissolve Transparent" shader only.
- Smoothness - How glossy should be your back side
- Metalness - More metal, more mirror-like
Color Correction
Tweaks the color of your final image.
- Tint - Color to overlay the reflection (Multiply blend) (Default Value: White)
- Hue - Color shift (Default Value: 0)
- Saturation - Can make your mirror grayscale, for example (Default Value: 1)
- Brightness - Makes your image brighter (Default Value: 1)
- Contrast - Your reflection's contrast (Default Value: 1)
- Posterize - Basically limits the color specter of the final image. (Default Value: 0)
Mirror Fade Shader

Actually, this shader uses almost the same properties as the two previous. Except, that you can also specify PBR options such as Smoothness and Metalness for the front mirror side too.
Using VRC Mirror script with custom shaders
If you want to assemble your own mirror:
- Create it's own material using one of the shaders.
- Replace the material the mirror mesh uses with the new created material
- Choose the same shader you used for the created material in the VRC_Mirror Reflection component
- Done!

NOTE: Specifying the same shader in the VRC_Mirror Reflection component is mandatory, don't forget it! In other case, VRC_Mirror Reflection component will replace your material's shader to the default.
ALSO: VRC_Mirror Reflection script does not allow you to change the mirror material properties in runtime with animator. So, to control the mirror dissolve progress, better to use the Z-scaling option.
Performance
Comparing the Ultimate Mirror and default mirror shaders:

Ultimate Mirror shader on the left and Default mirror shader on the right. As you can see, the difference is in just a ~0.05ms, which is almost unnoticeable.