Unity-Chan Toon Shader 2 介绍

Introduction to Unity-Chan Toon Shader 2

本文档主要是对UTS2官方手册的个人理解与总结(其实以翻译记录为主:>)
仅作为个人学习使用,不得作为商业用途,欢迎转载,并请注明出处。
翻译中有些术语不准确,但不影响理解的,不再一一调整,有些简单的示例可能会被跳过,请谅解。
参考链接:https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/blob/master/Manual/UTS2_Manual_en.md

Unity-Chan Toon Shader (UTS) is a toon shader for images and video that is designed to meet the needs of creators working on cel-shaded 3DCG animations.
Unity-Chan Toon Shader(UTS)是一个用于图像和视频的卡通(Toon)着色器,旨在满足3DCG动画创作者的需要。

[外链图片转存失败(img-kye4nSwD-1562039279774)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/UT2018_UTS2_SuperTips_10.jpg)]
This Toon shader is configured to easily produce all shadows essential to character design, such as those that accentuate the form of various parts of a character model, without having to worry about the position and intensity of light sources. Shadow color settings can also be used to make it easy for the person responsible for color design to create shadows.
这个Toon着色器可以很容易地生成角色设计所需的所有阴影信息,比如那些强调角色模型各个部分形状的阴影,而不必担心光源的位置和强度。阴影颜色设置也可以用来让负责色彩设计的人更容易地创建阴影。

One of this shader’s particularly powerful features is the ability to adjust shadows using sliders within the shader itself, eliminating the need for multiple light sources.
这个着色器的一个特别强大的功能是能够在着色器内部使用滑块调整阴影,消除了对多个光源的需要(不需要多个光源)。

[外链图片转存失败(img-rreGyfDQ-1562039279775)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/0713-06_01.jpg)]
Performance was greatly enhanced in Unity-Chan Toon Shader Ver. 2.0; the same rendering capabilities as Ver. 1.0 were retained while also allowing for an even more sophisticated look.
在UTS 2中,性能得到了极大的提高。保留了1.0相同的渲染功能,同时允许更复杂的外观。

[外链图片转存失败(img-2gFPscuO-1562039279775)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/SS_SampleScene.jpg)]
In addition to the 3 basic layers of Base Color, 1st Shade Color, and 2nd Shade Color, colors and textures can also accept a wide variety of customization options, such as High Color, Rim Light, MatCap (sphere mapping), and Emissive (light emission).
除了基本色、一阶阴影色和二阶阴影色这3个基本层之外,颜色和纹理还可以接受多种定制选项,比如高光(High Color)、Rim Light(轮廓光)、MatCap(球面映射)和Emissive(自发光)。

[外链图片转存失败(img-uNCvFvjf-1562039279776)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/UT2018_UTS2_SuperTips_11.jpg)]
The level of gradation between colors can also be adjusted in Unity in real-time.
颜色之间的渐变也可以在Unity中实时调整。

[外链图片转存失败(img-YR7xzzgo-1562039279776)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/UT2018_UTS2_SuperTips_13.jpg)]
This shader also has 2 options for creating fixed shadows necessary to the design: the Position Map, which assigns a set casting point to each shadow, and the Shading Grade Map, which can adjust shadow intensity based on the lighting.
这个着色器也有2个选项来创建设计所需的固定阴影:阴影位置贴图,它为每个阴影分配一个设置的投射点;阴影等级图,它可以根据光照调整阴影强度。

There are several other convenient tools for things like how visible eyes and eyebrows are through bangs, which can further emphasize an anime-style look.
还有其他一些方便的工具,比如眼睛和眉毛通过刘海的可见程度,可以进一步强调日本动漫的风格。

In short, Unity-Chan Toon Shader 2.0 (UTS2) makes a wide variety of character designs possible, from cel-shaded to light novel illustration styles.
简而言之,Unity-Chan Toon Shader 2.0 (UTS2)使各种各样的人物设计成为可能,从cel-shaded到light新颖的插画风格。

Of course, it also supports Unity’s system shadow feature.
当然,它也支持Unity的系统阴影功能。

[外链图片转存失败(img-BDvE7ReB-1562039279777)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/Comp_ST_UTS2.jpg)]
[外链图片转存失败(img-YcgJy9xI-1562039279777)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/Comp_ST_UTS2_2.jpg)]
Adding post effects allows UTS2 to use non-photorealistic rendering (NPR) to create any picture-like element that can be made with a standard shader that supports physics-based rendering (PBR).
添加后期效果(post effects)允许UTS2使用非真实感渲染(NPR)创建任何类似于图片的元素,这些元素可以使用支持基于物理的渲染(PBR)的标准着色器生成。

Several techniques have been implemented to beautifully display characters in a variety of lighting environments, thanks to recent feedback from VRChat users.
由于最近来自VRChat用户的反馈,已经实现了几种技术来在各种照明环境中漂亮地显示角色。

See for yourself by coloring your best character model with Unity-Chan Toon Shader 2.0 (UTS2).
您自己可以通过使用UTS2为您最好的角色模型着色。

You may be surprised to see your character looking better than ever before.
你可能会惊讶地发现你的角色看起来比以前更好了。

This manual focuses on the newest version of Unity-Chan Toon Shader Ver. 2.0: UTS2 v.2.0.5 Release.
本手册主要介绍UTS2的最新版本:v.2.0.5发行版。

Development Environment 开发环境

Unity-Chan Toon Shader Ver. 2.0 is developed based on Unity 5.6.3p1, and verification of compatibility with the latest versions of Unity 2018.x is ongoing.
UTS2是基于Unity 5.6.3p1开发的,并验证了与最新版本Unity 2018.x的兼容性。

(However, as version 5.6.3p1 is in the legacy pipeline, it is not currently compatible with SRP).
(但是,由于5.6.3p1版本在传统渲染管线中实现,所以它目前与SRP不兼容)

Target Environment 目标环境

Unity 5.6.x or later is required. This shader is confirmed to be compatible with Unity 2017.4 15f1 LTS. Unity 2018.1.0f2 and later versions can also be used.
This package is developed in Unity 5.6.3p1.

This package uses a forward rendering environment. Using a linear color space is recommended.
此包使用前向渲染环境。建议使用线性颜色空间。
(A gamma color space can also be used, but this tends to strengthen shadow gradiation. For more details, see Linear or Gamma Workflow. )
(伽玛空间也可以使用,但这往往加强阴影梯度。有关详细信息,请参见线性或Gamma工作流。)

Download the project

Installation

Basic UTS2 Settings

For those completely new to UTS2, practicing “making a picture with Step and Feathering using only the Base Color and 1st Shade Color” is recommended, rather than immediately attempting to use all the available features.
对于UTS2的新手,建议练习“只使用基本颜色和第一个阴影颜色来制作带有分级和渐变的着色”,而不是立即尝试使用所有可用的特性。

It is important to first become familiar with the basics of UTS2, then gradually add rim lights and a 2nd Shade Color if necessary.
首先要熟悉UTS2的基本知识,然后在必要时逐渐添加轮廓光和第二层阴影颜色,这一点很重要。

Feel free to use the following video for reference while practicing.
练习时请随意使用以下视频作为参考。

Using the Different Shaders in UTS2

Opening the shader class (UnityChanToonShader) installed by Unity-Chan Toon Shader 2.0 (UTS2) shows that it contains a variety of shader files.
打开UTS2的Shader文件夹下会发现很多文件。

At this point, most users would simply close this; instead take a closer look at the various name blocks in the menu. These name blocks (Toon, DoubleShadeWithFeather, Clipping, StencilMask, etc.) are actually one of the most basic features of UTS2. This structure ensures that shaders that have the same name block as one shown in the menu will have the same features.
此时,大多数用户不需要关心它;相反,请仔细查看Shader菜单中的各种名称。这些名称块(Toon、DoubleShadeWithFeather、Clipping、StencilMask等)实际上是UTS2最基本的特性之一。此结构确保具有与菜单中显示的名称相同的着色器具有相同的特性。

Now, let’s take a look at each name block and their features.
现在,让我们看看每个名称块及其特性。

The Shaders in the UnityChanToonShader Root Folder Shaders菜单中UnityChanToonShader根目录

[外链图片转存失败(img-ACGaZqrE-1562039279778)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/UTS2_Standard.jpg)]
UTS2 shaders fall into two main categories.
UTS2着色器分为两大类。

  • DoubleShadeWithFeather : The standard shader for UTS2. Allows for 2 shade colors (Double Shade Colors) and gradation between colors (Feathering). UTS2的标准着色器。允许两种阴影色(双阴影色)和颜色之间的渐变(平滑)。
  • ShadingGradeMap: A more advanced UTS2 shader. In addition to the DoubleShadeWithFeather features, this shader can also hold a special map called a ShadingGradeMap. 一个更高级的UTS2着色器。除了DoubleShadeWithFeather特性外,这个着色器还可以保存一个称为ShadingGradeMap的特殊贴图。

[外链图片转存失败(img-XWnfnD1N-1562039279778)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/Comp_UTS2_Shaders.jpg)]
Both types have the same basic features, so the same look can be achieved with either type by matching the color (_Step) and gradation (_Feather) values.
这两种类型都具有相同的基本特性,因此通过匹配颜色类型/分级(_Step)和渐变(_Feather)值,可以用任何一种类型实现相同的外观。

Choosing which shader to use is a matter of personal taste, but generally DoubleShadeWithFeather is more suited to cel styles that need sharp, well defined colors, while ShadingGradeMap may be better for illustrated styles where the colors are more blurred together.
选择使用哪个着色器是个人喜好的问题,但是一般来说,DoubleShadeWithFeather更适合需要锐利的、定义良好的颜色的卡通(cel)风格,而ShadingGradeMap可能更适合颜色更加模糊的插画(illustrated )风格。

Additionally, having Toon at the beginning of the shader name means that the shader can create outlines using the object inversion formula.
此外,在着色器名称的开头有Toon意味着着色器可以使用对象反转公式创建勾边。

Outlines in UTS2 have a lot of customization options: the strength of outlines made with dedicated textures, the level of blending with the Base Color, camera base offset, and more.
UTS2中的勾边有很多自定义选项:用专用纹理制作勾边的强度、与基本颜色的混合程度、基于相机偏移量等等。

Shader names also have name blocks such as Clipping at the end. These indicate the following kinds of features.
着色器名称也有名称块,比如末尾的裁切Clipping。这表明了以下几种特性。

  • Clipping: Shader contains a clipping mask, a kind of “texture omitter” capable of things like cut outs, dissolves, etc.
    裁切:着色器包含一个裁切蒙版,一种“纹理省略”,可以剪切、溶解等。
  • TransClipping: Also indicates a clipping mask, but takes the mask’s αTransparency into account when omitting a texture. This allows for better omission, but creates a greater load than Clipping.
    透明裁切:也是一个裁切蒙版,但考虑了蒙版的alpha 透明当作纹理省略的依据。这允许更好的省略,但是创建了比单裁切更大的负载。
  • StencilMask: Uses the stencil buffer to designate how visible certain parts are through others. For example, for an anime style character it may be desirable to always have the eyebrows visible instead of covered by the character’s bangs. This shader must always be used with a StencilOut type shader.
    模板遮罩:使用模板缓冲区指定某些部分通过其他部分的可见性。例如,对于动画风格的角色来说,最好总是让眉毛露出来,而不是被刘海遮住。此着色器必须始终与StencilOut类型着色器一起使用。
  • StencilOut : Used together with StencilMask type shaders. In the above example, this shader would be set on the “bangs” part to make them transparent so that the “eyebrows” parts are visible.
    模板去除:与StencilMask类型着色器一起使用。在上面的例子中,这个着色器将设置在“刘海”部分,使它们透明,以便“眉毛”部分可见。
    [外链图片转存失败(img-0dTO9Il0-1562039279778)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/1230-11_10.jpg)]
    The Shaders in the UnityChanToonShader/NoOutline Folder

[外链图片转存失败(img-sQ7NiKHB-1562039279779)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/UTS2_NoOutline.jpg)]
The shaders in the NoOutline folder have ToonColor at the front of their names, but here this indicates that the shader does not have the outline feature.
NoOutline文件夹中的着色器的名称前面有ToonColor,但在这里这表示着色器没有勾边特性。

Parts without the outline function will have one less drawing pass, so these shaders are ideal for designs that do not require outlines or when using high accuracy toon line shaders like PSOFT Pencil+ 4 Line for Unity.
没有勾边功能的部件将会少一个的渲染pass,所以对不需要勾边或在Unity中使用高精度卡通Line着色器如PSOFT Pencil+ 4 Line之外,这些着色器是更好的选择。

[外链图片转存失败(img-cx9H1h97-1562039279779)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/ToonColor_Transparent.jpg)]
Some of the NoOutline shaders have the Transparent name block at the end of their names.
一些没有勾边着色器的名称末尾有一个透明的名称块。
These are special transparency shaders. They are useful for parts meant to have a “blush” look, or for glass and glass-like objects.
这些是特殊的透明着色器。它们适用于具有“粉红色”外观的部件,或用于玻璃和类似玻璃的物体。

[外链图片转存失败(img-6WUXYhgV-1562039279780)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/CheekMaterialSetting.jpg)]
The Shaders in the UnityChanToonShader/AngelRing Folder

[外链图片转存失败(img-k8xCQLRe-1562039279780)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/UTS2_AngelRing.jpg)]
The AngelRing folder contains shaders with an “angel ring” feature.
天使之环文件夹包含带有“天使之环”特性的着色器。

The “angel ring” is a highlight effect, as demonstrated in the image below. They have a fixed position from the camera’s perspective.
“天使之环”是一个高光效果,如下图所示。从透视相机的角度看,它们有一个固定的位置。

[外链图片转存失败(img-LNrNibaH-1562039279780)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/AR_Image.jpg)]
Only UTS2’s hi-spec ShadingGradeMap shaders and their variant ShadingGradeMap_TransClipping shaders have this “angel ring” feature.
只有UTS2的高规格ShadingGradeMap着色器及其变体ShadingGradeMap_TransClipping着色器才具有这种“天使之环”特性。

These shaders are primarily used in “hair” parts, which puts them in a similar category to StencilOut shaders, which are omitted by stencils.
这些着色器主要用于“毛发”部分,这使它们与模板去除着色器处于类似的类别。

The Shaders in the UnityChanToonShader/Mobile Folder

[外链图片转存失败(img-6Yhi293m-1562039279781)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/UTS2_Mobile.jpg)]
Lightweight versions of shaders, intended for Mobile and VR content, that generally won’t change the look of objects can be found in the Mobile folder.
轻量级着色器版本,适用于移动和VR内容,通常不会改变对象的外观,可以在Mobile文件夹中找到。

The following features are restricted in order to make these shaders lighter for mobile platforms.
为了使这些着色器在移动平台上更轻,限制了以下特性。

  • Only one real-time directional light may be used (multiple lights and real-time point lights are also unsupported).
    只能使用一个实时方向光(不支持多个光和实时点光源)。
  • Point lights are supported by using baked point lights and light probes. This may require certain adjustments to GI_Intensity.
    支持由点光源和光探针烘焙的点光源。这可能需要对GI_Intensity进行某些调整。

Mobile shader properties are compatible with normal Toon_DoubleShadeWithFeather shaders and Toon_ShadingGradeMap shaders, so if the above features are acceptable, mobile shaders can be substituted for their standard versions in order to improve rendering performance.
移动端着色器属性与普通的Toon_DoubleShadeWithFeather着色器和Toon_ShadingGradeMap着色器兼容,因此,如果上述特性是可接受的,可以用移动着色器替换它们的标准版本,以提高渲染性能。

The Mobile/AngelRing folder contains mobile shaders that support the “angel ring” feature.
Mobile/AngelRing 文件夹包含支持“天使之环”特性的移动着色器。

The basic features of each shader are identical to their standard version counterparts.
每个着色器的基本特性都与标准版本相同。

The Shaders in the UnityChanToonShader/Tessellation Folder

[外链图片转存失败(img-UCbuemyS-1562039279781)(https://github.com/unity3d-jp/UnityChanToonShaderVer2_Project/raw/master/Manual/Images_jpg/UTS2_Tess.jpg)]
UTS2 shaders that support DirectX 11 Phong Tessellation can be found in the Tessellation folder.
支持directx11 Phong细分方式的UTS2着色器可以在Tessellation 文件夹中找到。

Phong Tessellation corrects the position of subdivided surfaces so that they will be more closely aligned with the mesh’s normal vectors. It’s an effective method for smoothing low-poly meshes.
Phong细分修正了细分曲面的位置,使它们更接近网格的法向量。这是一种有效的低网格平滑方法。

UTS2 can only use Phong Tessellation with DirectX 11 in a Windows environment.
UTS2只能在Windows directx11环境中使用Phong细分。

The Tessellation/Light folder contains lightweight versions of the Tessellation shaders with the same restrictions as the Mobile shaders.
Tessellation/Light文件夹包含轻量级版本的细分着色器,具有与移动着色器相同的限制。

The rest of the folders also contain versions of the previously described shaders, with added support for Phong Tessellation.
其他文件夹还包含前面描述的着色器的版本,增加了对Phong细分的支持。

[外链图片转存失败(img-j0jkaJwe-1562039279782)(<

  • 0
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值