Home

Awesome

README.md

Project Ended

Project is DEPRECATED, please go to ACLS shader: https://github.com/ACIIL/ACLS-Shader for all my modernizations and extendtions of this source.

Intro:

UTS2-ac shader, a git fork of UnityChanToonShaderVer2_Project (UTS2) with lighting improvements and bug fixes based on the v2.0.4+ versions. Tweaks by ACiiL.

https://github.com/ACIIL/UnityChanToonShaderVer2_Project

Credits to the original author(s) unity3d-jp for humbly providing UTS2 open source and those that helped me develop the improvements.

https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project

Install:

In github download the zip in the releases tab or from the branch you selected. In the zip file you will find the asset/ folder and Manual/ documentation. Copy the inner Toon/ folder into your unity assets\ project folder. Your shader listing should now have UnityChainToonShader/ACiiL sub menu installed.

Watchout when applying UTS2 to news materials for when object sorting is see-threw, fix it by setting the zwrite on.

What is this and history:

UTS2 is a extremely customizable toon shader. Its good for 2 to 5 "color tone" toony paint effects with many options which represent Unity standard shader appearance in a abstracted toony way.

Today mainline UTS2 has moved forward to v2.0.5+ and this little side branch of mine was for v2.0.4+. It should be possible to swap other versions of UTS2 with mine for a while.

This has a been about a year long on-and-off study project since middle of January 2018. Back then no one knew UnityChanToonShaderVer2_Project and it didnt work in vrchat, I was interested in making it function in vrchat. Some on and off weeks studying unity's hlsl i learned unity's lighting and how to correctly manipulate them for shaders. This Study result is UTS2-AC.

After some lucky back and forth with the main author of UTS2 shader i shown them my code edits and then the main branch of UTS2 became functional in vrchat. Now we see UTS2 being used freely for commercial avatar sales on Booth.pm and the general players in vrchat who like the styles UTS2 provides.

My UTS2 branch is its own separate fork. I have my own methods to approach unity engine's lighting system and my own goals to take it. I want to give artists the power to select UTS2 shader effects without disobeying unity's light system (to much) under the common bad map lighting seen in vrchat maps.

In regards to community improvements i will accept code contribution as pull requests! Pass me bug fixes for my fork, preferably within github.

Manual:

Read the documentation for UTS2. See the latest mainline UTS2 release manual, it contain videos and examples of setup:

https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/blob/master/Manual/

Note my fork is somewhat different from the mainline readme version.

Shader keywords limit notes and solutions for avatar creators and shader writers.

A common problem to all vrchat shaders is sharing the limited space of shader keywords. When the limit is hit durring a play session strange visual bug will happen to new shaders loading in. The keyword space can also be flooded in your unity project avoid that by only enabling shaders you use.

How do clean up keywords before avatar upload manually:

There is a way to clean up unused keywords in materials between shader swaps and updates! Select your material -> set debug by using the drop down gear right of the inspector tab row -> read out the "keywords" text box and test deleting that list. If things look ok after you are lucky.

For shader writers, avoid methods that create keywords. See how i implemented [toggle(_)] for toggles and number enum's, and see how defines do not use #pragma shader_feature or #pragma multi_compile

Forks differences and features.

Details what's different in UTS2-AC. See the official UTS2 readme for everything.

Shader file usage and render error avoidances.

Start by using the no-outlines version for best performance (outlines are extra passes. So i typically use it for non alpha or skin materials).

I use dither cutout alpha. It should be able to handle any alpha texture and mesh layering after a bit of calibration in the settings. You only pay the cost of a screenspace pattern and quality improves as you raise MSAA or screen resolution.

Limitations of alpha.

True transparency queue shaders will not have z sorting issues, however the unity engine cannot do shadow receiving and thus dynamic toon ramps will be full bright. I made my fork use dithered cutout with alpha as a solution.

Color balancing and map bloom control.

Its really easy to get the stack of effects in UTS2 to overbright. Basically dont use full white color tints on effects. I recommend installing unity post processing stack in your scene with bloom on and watch when bloom is too strong with a default directional light and ambience. Bloom happens when HRD color values goes higher than 110% and you should know many maps like to push lights above this value in vrchat!

So to limit blooming make your toon ramps darker than 95% luminance. Set your base color ramp to (0.95, 0.95, 0.95, 1) and go down brightness in the shadows. You will be fairly resistant to over brighting in maps and its a good average to how lambart darking in Standard shader averages.

To control specular effects you actually can go higher than 100%, just watch the bloom.

If you come across very badly lit shadows in vrchat maps there is a way to compensate. Increase the "minimal shadow caster blackness" from 0 (which is natural).

Outlines setup.

Please default your outline color to 50% bright and balance from there. Please Use outlines with Opaque mode only.

Bugs:

Please send issue reports to my github page.

Some vrchat maps are setup light incorrectly, in a perfect world they obey unity's light models, where direct lights (dynamics and shadows) are counter balanced by indirect lights (ambient) and reflection sources, and correct post processing for HDR practices.

If you come across a map too bright or shadows too black, please contact the author and promptly yell until they fix it on standard shader. For maps where standard shader avatars looks fine and UTS does not i will be interested in debugging. Provide me with the map name and author to visit.

Outlines have an outstanding shadow caster bug. Directional light shadows bleed threw the outlines. Fixing will need a geometry in shadow caster rewrite.

Stencil currently requires manual file editing.

Is your model pure black when you apply UTS2? Default your model import settings: You want unity to calculate tangent normals.

Support credits to:

Noe, TCL, June, Cubed, Silent, RetroGeo, Xiexe, Mel0n, Cibbi, Hakanai, Neitri, 1001, Kaj, Error.mdl, d4rkpl4y3r, poiyomi, Thryrallo, many more.

Hosting site:

https://github.com/ACIIL/UnityChanToonShaderVer2_Project

A fork of:

https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project

License:

I inherent the Unity-Chan Toon Shader license (UCL2_0). In addition if you use my forks separate methods or tips please credit towards my github and name; I really appreciate citation and i will do the same. Contact me by discord or twitter if you want to sort out what of this code is fully my work or UTS2 original.

Unity-Chan Toon Shader 2.0 is provided under the Unity-Chan License 2.0 terms.
Please refer to the following link for information regarding the Unity-Chan License.
http://unity-chan.com/contents/guideline_en/