Ok. Let’s find out how you can organize your production process with SD.
Deeply understand the workflow of SD while creating a system with various SD functions to maintain the PBR quality of many artists.
来了解下怎么用 SD 构成制作工程。为了维持PBR的品质，我们美术要用 SD 的各种功能制作系统并深入理解 SD 的 Workflow。
Learning goal 学习目标
Create a development process that can easily and quickly apply PBR Material reference values to textures using the valures of the Color Mask. Through automation material development, you will be able to understand various function exposure methods and SD instance functions more deeply.
Let’s make the automation material produced by SD as a filter for SP and use it.
制作用 Color Mask 的颜色便捷又快速地把 PBR Material reference 值适用到质感上的开发工程。通过 Automation material 开发可以更深入了解函数的显示方式和 SD 的instance功能。SD 里制作的 Automation material 做成 SP 里用的滤镜并使用。
After I came to China in 2015, I found out that many artists in the studio are using individual Color IDs by Quixel tools. Many problems arose because such indiscriminate definition of Color ID was not standardized even when the artist later left the company or developed Auto Batching Tool. However, after thinking about what rules can make Color ID a norm, I observed the complementary color relationship first, and when it was changed to Gray, I came up with the idea that it could be made into a Gray level chart. Now based on this idea we will create an automated filter.
2015年来到中国后，在工作室发现有很多美术会用个别 Color ID。这种不明确的 Color ID 定义规则在该美术离职或者开发 Auto Batching Tool 的时候，因为没有标准化(正规化) 所以会出现很多问题。在想着用什么规则可以把 Color ID做成规范后，观察到了补色关系，这个变成 Gray 的时候我就想到可以做成 Gray level chart 。现在根据这个想法我们可以做自动化滤镜。
Let’s break it down into 10 final stages. When implemented in detail, the final texture will be produced with a value of about 0.25 in the range overlapped between each step. Let’s directly classify and look at the change in the roughness value, which is divided by , Let’s take a look at Knald Technology’s LYS first.
最终分为10个阶段吧。制作细节的时候每个阶段间 Overlapped 的范围大概是 0.25 ，会以这个值做到最终贴图。(严格来讲是 Overlapped range ，所以可以想成在 0.125 的误差分为内决定最终值。来区分并观察分为 10 个阶段的 Roughness 值的变化。
先观察下 Knald Technology 的 LYS 。
At this point, it is worth explaining again why we are trying to divide the factor values for Roughness and Metallic in 10 stages. Pursuing the PBR Work-Flow, which pursues almost perfection, requires a much more professional approach and requires various expensive equipment to create the corresponding measurement coefficient value. For example, the order 1886, released in late 2016, is a representative game that introduced and applied PBR rendering pretty quickly. When expressing the texture of clothes, the fabric scanner was already manufactured, the diffuse value and the specular value were separated from the polarizer and stored, and the normal map or depth map was photographed from real materials and used. From mid-2018 to the present, next-generation console game developers also tend to use measurement equipment and material scanners to process information obtained from the real world and use it as game resources. However, when we infer the environment of game developers, which are slightly different from the console game development environment, there will definitely be a deviation rate of Roughness and Metallic values between materials due to individual artists’ differences in opinion.
If the standard value of the medium is not defined directly within the development team, artists often change the value of Roughness little by little during actual work (although there is individual variation), and time based on which one looks more like them is bound to spill.
这里我们需要讲一下，为什么要把Roughness 和 Metallic的因子值分成10个阶段来使用。如果是追求完整的 PBR Work-Flow 就需要从更专业的角度出发，为了做出相应测量系数需要很多高价的装备。比如 2016后半年上线的 the order 1886 是比较快投入 PBR rendering 并使用的具有代表性的游戏。表现衣服质感的时候已经制作了 Fabric scanner 并把 diffuse 值和 Specular 值从偏光镜分离储存了， Normal map 或深度图也是从现实材料中摄影后使用的。2018年中开始到现在次时代主机游戏开发商也会用测量装备和材质扫描器把现实世界的数据加工用于游戏资源，这也是趋势。但是跟主机游戏的开发环境不同，游戏开发商的环境里会根据美术个人见解的差距，各个材质间的 Roughness 和 Metallic 值肯定会存在偏差率。
如果开发团队内部没有定义材质的标准值，美术制作的时候 (虽然会有个人偏差) 会在调 Roughness 值上花费时间，并以自己的喜好操作。
Understanding Roughness values.
You can see PBR, which will be dealt with in detail later in the book, but if you briefly go over it, you can see it as a set of mirror reflections caused by the fine roughness of the surface of an object. This surface roughness can be stored as a value, which can be stored using a value between 0 and 1 in the form of a parameter, and a Luminence value between 0 and 1 (between 0 and 255) based on the UV coordinate space using a texture color value) can be used to save.
这本书后半部会详细说明 PBR ，现在就简单讲下，这是物体表面微弱的粗糙度产生的反射光的散射。这个表面粗糙度可以储存为数值，可以用 parameter 形式从 0 到 1选一个值储存， 可以使用贴图以 UV 坐标空间为准 Luminence 0到 1 的值(0 到 255 之间的色彩值)储存。
INPUT VALUE : ROUGHNESS EVALUATIONS VIA CONSTANT VALUE.
Let’s take a look by connecting a constant to the Roughness Output.
Roughness Output 连上常数后观察下。
The closer the value of surface roughness is to 0, the smoother it is, and the closer it is to 1, the rougher the surface form is expressed. It is a part that is often shaded, but if you memorize 0 for no roughness and 1 for roughness, it is not shaded if it is a shader in the form of Metallic Roughness Setup.
表面的粗糙度越接近 0 值越光滑，越接近 1就越粗糙。这是经常会弄混的部分， 0 没有粗糙度 , 1有粗糙度，这么记下来的话 Metallic Roughness Setup 形式的Shader就不会弄混了。
The Unity game engine uses the roughness part as smoothness, and it is used as Smoothness. At this time, if it is 0, it is understood as not smoothness, and if it is 1, it is understood as smoothness. Therefore, it takes the value of the opposite concept of Roughness. In other words, smoothness is the natural inversion of the roughness value.
Unity引擎把粗糙度的部分用成了光滑度，是用成了 Smoothness 。这时 0 就是不光滑， 1就是光滑，所以 是 Roughness 相反概念的值。 也就是说, Smoothness 自然就是 Roughness 值的反转值。
Categorize Roughness values as standard values.
Now let’s internally determine a suitable value range. In this process, since different opinions may exist among artists, there must be sufficient communication in the initial standard definition assumption. If the reason for the classification is not fully explained and proceeded, art departments may not be able to understand what constitutes these systems, and may not actually use them after production.
When designing a system, gains and losses should be well explained, and when considering gains and losses, it should be clearly recognized which gives the system an advantage.
If you have consulted with the art team first, you can use that consultation as a standard. The author wanted to define the stage itself as the first 7 stages, but the art team’s opinion was at least 10 stages, and it was decided to divide it into the final 10 stages.
Looking at the above steps, it is a value of 0 from the left and a value closer to 1 as it goes to the right. Then, let’s look at how to automatically convert the above value from Color ID. A total of 10 levels of Roughness will correspond to a total of 10 Color IDs. The color of the Color ID can be determined within the art team. Let’s work on using this color by replacing it with the Roughness value.
看上图从左侧开始是 0 ，越往右侧越接近 1。我们看下怎么让上面的值自动从 Color ID 变换。10 个阶段的 Roughness 会对应总共 10 个 Color ID 。美术可以在内部指定 Color ID 的颜色，让我们把这个颜色可以置换成 Roughness 值使用
Gray value is evaluated as Value.
Gray 值用 Value 评测。
Search for Value Processor in Node search and add it. In Node search 里搜索 Value Processor 并添加。
Create Uniform Color node of RGB(1,0,0). Connect grayscale conversion node.
生成 RGB(1,0,0) 的 Uniform Color node 。连接 Grayscale conversion node。
Let’s change all grayscale conversion values to 0. Since the color is changed to a random value while converting the color to gray, you need to check how many values the result value takes as a constant. Value Processor is used at this time, and Sample Gray should be added.
Grayscale conversion 值都变更成 0 。把颜色变换成灰色的时候会变成任意值，所以要确认结果值是常数多少。这时使用的就是 Value Processor ，要添加 Sample Gray 。
Select Value Processor and modify Function. (Click the Edit button to modify.) 选择 Value Processor ，修改 Function 。 (点击 Edit 键修改。)
Sample Gray can take each position of the input value (pixel).
Sample Gray 可以取输入的值(像素) 的各个位置。
With Sample Gray selected, right-click and select Set as Output Node.
选择 Sample Gray 的状态下，右击鼠标做 Set as Output Node 。
If Value Processor is connected in the above format, the input color value can be evaluated as Value value.
如上图形式连接 Value Processor ，就可以用 Value 值评测输入的值。
This is the result of dividing into a total of 10 steps in the above way. Color ID was randomly selected.
这是根据以上方式分成10个阶段的结果。Color ID 是任意选的。
How the filter is made. 制作滤镜的方式。
Now we need to review the two approaches. One is whether to execute the conversion for all Color IDs in a single layer, or whether to configure it in the form of a generator so that the art team can conveniently use it in the Substance painter. For basic learning, we will create an Instance Filter that automatically converts Color ID information in a single bitmap into Roughness.
现在要评价两种处理方式。一种是单一 Layer 上执行所有 Color ID 的变换，一种是以 Generator 形式组成在 Substance painter里让美术方便使用。为了学习基础，来做下一张 Bitmap 的 Color ID 信息自动变换成 Roughness 的 Instance Filter。
AUTOMATIC GENERATION COLOR ID TO ROUGHNESS INSTANCE FILTER
Create a test color id map to check filter operation.
为了确认滤镜起不起效制作 Test color id map 。
기존 프로젝트를 별도 저장. 单独储存原有工程。
The graph created for separately saved Color ID learning will be used as an Instance Node later. Organize the nodes as shown in the picture above and save. After creating a new test project, we will modify this Graph again.
单独储存的 Color ID 为了学习生成的 Graph 之后会用成 Instance Node 。像上图一样整理节点后储存。生成新的测试工程后，会再修改这个 Graph 。
Creating a new test project. 生成新的测试工程。
Set the name to ColorID_Generation_Eval_Graph and create a new project. Save the project as ColorID_Generation_Eval_Graph.sbs. For Template, select metallic/Roughness. After the color ID map is input, it goes through a conversion process and finally becomes a gray map again. Gray map is information that records the value of roughness. Load the Color ID map you just created.
命名为 ColorID_Generation_Eval_Graph ，生成新的工程。工程储存为 ColorID_Generation_Eval_Graph.sbs 。Template 选择为 metallic/Roughness 。Color ID map 输入后经过变换过程最终成为 Gray map 。Gray map 是记录 Roughness 数值的信息。导入之前制作的 Color ID map 。
색상 확인. 确认颜色。
The working environment for producing Instance Node has been changed. The graph screen was divided into left and right sides, and each Main Graph and Instance Graph development setting was set.
좌측 : AutoGen_ColorID_Roughness Graph
우측 : ColorID_Generation_Eval_Graph
为了制作 Instance Node 变更了环境。
Graph 画面左右分割，各自进行了 Main Graph 和 Instance Graph 开发设置。
左侧: AutoGen_ColorID_Roughness Graph
ConversionRoughness.sbs 파일을 다시 열고 수정 합니다.
打开 ConversionRoughness.sbs 文件并修改。
If Value Pixel Processor is finished, we will move on to the next step. It will link the color chart and function with the pre-specified Color ID. Create an error range for the color specified in the Color ID, and make the Roughness value automatically within the error range.
Value Pixel Processor 整理好了就开始下一个阶段吧。 会把预先指定好的 Color ID 色卡和功能连接起来。需要制作 Color ID 指定的颜色误差范围，在误差范围内让 Roughness 值也自动含有误差范围。