Skip to content

ShingenPizza/UnityShadersPlus

Repository files navigation

Unity Shaders Plus

This repository holds a copy of Unity's built-in shaders, some of them edited to add some minor features, while keeping compatibility with those standard shaders that people are commonly using already.

Initially created for the Cleanup Crew crew, to allow videographers to be visible to actors and each other, while being invisible to each other's cameras.

Created to be used in VRChat, but feel free to use it wherever.

Please use the Releases page for prepared .unitypackage files.
Do not simply download and unpack this repository into your Unity project because it will not work that way.

Edited shaders

  • Standard
  • Standard (Specular setup)
  • Particle Standard Surface
  • Particle Standard Unlit
  • Unlit Color
  • Unlit Texture
  • Unlit Transparent
  • Unlit Transparent Cutout

Features

  • Limited Visibility
    presenting the Limited Visibility feature
    Toggles for visibility in VRChat when seen directly, in mirrors, on screenshots, and on cameras (separately the default VRChat one and Hirabiki's VRCLens).
  • VRC Light Volumes
    presenting the VRC Light Volumes support
    Support for the cool new "voxel based light probes replacement" (v2.1).
  • Minimum Brightness
    Support for the "Minimum Brightness" property, allowing you to remain visible in darker areas of VRC worlds.
  • Face Culling
    Control over which faces (front, back, or neither) are culled (not-rendered), e.g. if you need a mesh to be visible from both sides, to avoid having to duplicate mesh faces [a][b].
  • Double-Sided Lighting
    presenting the Double-Sided Lighting difference
    Combined with disabled Face Culling allows both sides of a mesh to be lit properly.
  • Translucency
    Simple simulation of light transmission, allowing thin surfaces to be "lit from behind". Technically, it blends colors of both sides of faces in the given ratio, and because of that it should be used with enabled Double-Sided Lighting.
  • Dynamic GUI
    Improved the GUIs of the shaders to make it clear which color channels are used for each property. They also change dynamically based on relevant settings.

[a] See the "Known issues" section below.
[b] Basic functionality of disabling back-face culling is available in some of the original shaders already as "Two Sided". I expanded it with front-face culling and copied to other shaders.

Example

Check out this example avatar using the Standard Plus shader.

Compatibility

They are available in packages based on built-in shaders of Unity versions:

  • 2019.4.40f1 (meant to be used in projects of Unity 2019.4.31f1, which actual shaders are broken)
  • 2022.3.6f1
  • 2022.3.22f1

All of those versions, when used in Unity editor of the respective version, seem to work correctly in VRChat as of it using version 2022.3.22f1.
I intend on updating all packages of versions that VRChat allows uploading content from, as long as it's not too big of a chore... but you kinda should be using the newest allowed Unity version. :x

Usage

After importing the package to your project, you can find these shaders in materials' shader selection under "ShingenPizza" category.

Example of usage for videographers:

  1. Change the shader in your avatar's materials with one of my edits.
  2. In those materials' GUIs in Inspector check "Limited Visibility Options".
  3. To become invisible to regular VRChat cameras, uncheck checkboxes under "Camera".
  4. To become invisible to VRCLens, uncheck the checkboxes under "VRCLens".

Voilà!

  • If you need to be able to toggle this effect, you can animate the above checkboxes or just swap the entire material the usual Unity/VRChat way.
  • Hint: if every videographer in given production is using only VRCLens, you can remain visible to regular cameras, in order to appear in the behind-the-scenes photos taken by spectators!

Known issues:

  • The Face Culling option doesn't work when toggled in VRChat - it needs to be set before upload.
  • Since I had to create a custom editor for Unlit shaders, the Inspector view doesn't look exactly the way the default one does. (The shaders themselves work just fine, though.)

Contact

Requests

If you'd like me to add a support for these features to other built-in shaders, feel free to create an Issue or contact me through other means.

Contributing

(This is only a short list of my own requirements in that topic, not a guide of how to contribute code on GitHub - there should be many tutorials about it elsewhere, if you need one) If you want to contribute some features/add the current ones to other shaders - cool! Preferably just add them to the main branch. I should be able to handle backporting them, unless you want to handle that too.

Your changes need to:

  • Not affect the behavior/look of the shader and already existing features when not used (to keep compatibility), and preferably also when used, unless that's their whole point, or there's an obvious unresolvable conflict between them.
  • Not be excessively heavy on the GPU.

Credits

  • Unity Technologies, for the shader and editor code it's all based on.
  • Hirabiki, for the VRCLens detection code bits.

That's all Folks!

Have fun recording and being not recorded!

About

A copy of built-in Unity shaders extended with additional functionality.

Resources

License

Stars

Watchers

Forks

Packages

No packages published