Page History
...
Warning |
---|
Please note that many example images shown in this article state that Material Diffuse Color should be 186/187. This was correct on earlier iterations of the PBR implementation but is no longer the case. Diffuse Color should always be 255,255,255 to get the maximum information from the texture. These example images will be updated with current information in the future. |
Overview
Table of Contents | ||||||
---|---|---|---|---|---|---|
|
Photoshop set up for Physically Based Shaders
The first thing we have to do is set up Photoshop correctly. When working with Physically Based Shaders you have to be aware that the default RGB color space is sRGB. In sRGB space, a 50% mid-gray is not 0.5 or 127 but rather 0.5 raised by the inverse of gamma 2.2, which equals 187 in Photoshop. In a nutshell, the reason that sRGB is used is to avoid banding artifacts (and to use a conservative range of values to avoid misrepresentation on the typical non-calibrated monitor). In sRGB space you get more precision for darker colors to which the human eye is more sensitive. Before working on colors, please make sure that your screen is calibrated properly.
...
If you want to understand more about Physically Based Shaders and how they work, please see: Physically Based Shading.
Specular Texturing for Physically Based Shaders
As we're using physically based shading for our project and truly being "next gen", the gloss map is one of the most important map if not the most. It requires a different thinking in how we use our specular maps.
...
All the gloss maps go into the Alpha Channel of the Normal Map.
Material types
There are only two categories of substances which are relevant for rendering: metals (conductors like iron, gold, copper, etc.) and non-metals (dielectric materials like plastic, stone, wood, skin, glass, etc.). Both have special characteristics regarding diffuse and specular reflectance.
...
In contrast to metal, non-metal has diffuse reflection; however the specular reflection is a lot weaker and less varied than for metal. Specular reflectance for non-metal is monochromatic (no color, just gray). Most non-metals reflect only a small fraction of the light as specular - for most materials between 2% and 5%.
Specular Color and what it does to the asset
The specular color defines how much light gets reflected immediately from the surface when the light source is directly above the surface. This is the minimum specular intensity, under grazing angles it will increase due to the Fresnel effect. As the specular color is specific for a certain type of material, it can also be considered as a mask for the type of material/substance. The specular color is a physical value which should be picked directly from a reference table. As such, it does not leave much artistic freedom.
...
If no metal is used in the texture your spec map should be white and the specular color values based on provided by the "Physically Based Shading" image. You can get it again by clicking this link.
Gloss values and what they do to the asset
Another big thing to keep in mind is how gloss works and how it should be used.
...
- The general value for non metals is between 53 and 61.
- The Gloss map always goes into the Alpha channel of the Normal map.
- No Spec map is needed unless you have Metals or your asset has metal parts.
How to texture for Physically based shading
The most important maps for Physically based shading are your gloss and normal maps. You should start texturing with those two maps alone, which will help you to define your surface, and then as a last step add your diffuse map.
The diffuse texture itself should have no lighting information at all.
Exporting your Normal Map with your Gloss Map out of Photoshop
Gloss and normals kind of belong together. The normal map defines the bumpiness of a surface on a macro scale while the gloss is the roughness on a micro scale.
...
To export your normal map with the gloss in the alpha channel, name it and always add the suffix _ddna (in this case courtyard_wall_arch_marble_ddna).
Examples of gloss maps and how to set up the shaders
Following are some examples with explanations of how the gloss map is affecting the asset and how it defines the material. It is also explained and showed how a gloss map should look to achieve the desired material and look.
These examples are placed on Orbs in the Asset Zoo to serve as a guide. Above them are the same materials without the diffuse, so we can see better what the gloss and normal map is doing.
Marble tiled floor material
Expand |
---|
As you can see the marble tiled floor is a very smooth surface with a mostly tight spec, a high and sharpened reflectivity. There are some sections which are not reflective, have a wide spec, and are therefore are not as smooth looking.
As for the Specular Color, you have some creative freedom in how high you should set it and what achieves the best look for the asset. The values it should be between 53 and 61 for non metals. |
Stone material
Expand |
---|
Stone is a very rough surface with a very low reflectivity and a very wide spec.
If you look closely at the gloss map you'll see also that it has unevenness in light and dark areas. This helps to make the surface look interesting as it creates different values as light travels across it, helping in making it look more believable. To set up our Shader correctly we need to set in the Material editor the Glossiness to 255, otherwise the gloss map will not work. As for the Specular Color, you have some creative freedom in how high you should set it and what achieves the best look for the asset. The values it should be between 53 and 61 for non metals. |
Sandstone bricks material
Expand |
---|
The sandstone brick material is also a rough surface with low reflectivity and a wide spec. It is though not as rough as stone.
Again you can see how different values of grey help to make the surface look more interesting, as differences in specularity occur when it's hit by the light. This makes our material more believable.
As for the Specular Color, you have some creative freedom in how high you should set it and what achieves the best look for the asset. The values it should be between 53 and 61 for non metals. |
Painted marble material
Expand |
---|
As you can see the painted marble material is a fairly smooth surface with a tighter spec. You can also see as the parts where the paint has worn off, it's duller with lower and less sharpen reflectivity and wider spec. It also has parts where it has the opposite. Pay close attention to how the paint is actually visible on the spec (breaking the smoothness) where the light hits it.
As for the Specular Color, you have some creative freedom in how high you should set it and what achieves the best look for the asset. The values it should be between 53 and 61 for non metals. |
Marble unpolished material
Expand |
---|
The unpolished marble material is a rougher surface with low and unsharpened reflectivity. It shows also a high roughness, with very wide and low highlights.
The different values of dark and light in the map create uneven specular values and reflectivity, making the surface believable and interesting.
As for the Specular Color, you have some creative freedom in how high you should set it and what achieves the best look for the asset. The values it should be between 53 and 61 for non metals. |
White/black and grey polished marble material
Expand |
---|
As opposed to the unpolished marble, we have a very smooth surface, with a high and much sharpened reflectivity. The spec is very tight with high highlights.
By having through the map different values of lights and darks, we can break the spec, reflectivity and sharpness. This helps make the surface look more interesting and believable.
As for the Specular Color, you have some creative freedom in how high you should set it and what achieves the best look for the asset. The values should be between 53 and 61 for non-metals. |
Polished white marble bricks material
Expand |
---|
The polished white marble brick material is a very smooth surface, but we have the crevices an in real life dirt accumulates there in making them less reflective.
The different values of dark and light make the material more believable and interesting as it creates different values in highness and sharpened reflectivity and smoothness.
As for the Specular Color, you have some creative freedom in how high you should set it and what achieves the best look for the asset. The values it should be between 53 and 61 for non metals. |
Non metal with metal material in the same texture
Expand |
---|
When a texture contains a part that is metal, we need to add color in the spec map to the metal part of it, since the metal will have a different spec color than the non metal parts. The gloss map in the alpha channel of the normal map, still defines the smoothness, reflectivity and tightness of highlights. But we won't control the spec color in the shader. We have to do it in the texture itself, to do that we have to take the values from the Physically Based Shading chart and add the color into our spec map. In this case we use a dedicated spec map and our gloss map will still go into the ALPHA CHANNEL of the Normal map!
We want the metal to have a high level of reflectivity, smoothness and tight highlights with some darker parts to break up the spec and make it more believable and interesting. Please look also at the rest of the gloss map. We see that the surfaces are being defined by parts. There are parts of the object which are rough with low highlights, wide spec and low reflectivity.
Please don't forget to set the value of the gloss also to 255 so the gloss map in the alpha channel will work.
|
Metals
Expand |
---|
When a asset consists purely of metal, we don't need a diffuse texture at all. Metals have no color and are defined by the color of the light they bounce back. Therefore we use our spec range sheet and color sample the metal according to it. The gloss map in the alpha channel of the normal map, still defines the smoothness, reflectivity and tightness of highlights. But we won't control the spec color in the shader. We have to do it in the texture itself. To do that, we have to take the values from the Physically Based Shading chart and add the color into our spec map. In this case we use a dedicated spec map and our gloss map will still go into the ALPHA CHANNEL of the Normal map!
Pay close attention to how white and contrasting the metal parts are. There are two examples of the gloss map. We have an unpolished metal, with wider spec and lower reflectivity, and we have the polished metal with a whiter gloss map that gives us a tight spec and high reflectivity. Once the asset is in the engine, we need to open up the material editor and set the specular value of the material to 255. This has to be done since the color map of the spec map is controlling the specular color and not the shader. Please don't forget to set the value of the gloss also to 255 so the gloss map in the alpha channel will work. |
Oxidized / Rusted Metals
Expand |
---|
Most of the metals you will encounter in the real world and in our game will be used, worn and even oxidized. We still don't need a diffuse texture at all. Metals have no color and are defined by the color of the light they bounce back. Therefore we use our spec range sheet and color sample the metal according to it. The gloss map in the alpha channel of the normal map, still defines the smoothness, reflectivity and tightness of highlights. We need to start out with this at first and really paint in the spots where the oxidization would naturally build. Those areas we want to have less gloss and less reflectivity. As you look at rust in general you can see that there's still some glimmer coming through it. Please think about that, look at reference, and incorporate that into your gloss map. As mentioned before, with metals we won't control the spec color in the shader. We have to do it in the texture itself. To do that, we have to take the values from the Physically Based Shading chart and add the color into our spec map. What we need to look at is our spec map and texture it accordingly. We start painting with the base color of the metal, taken from the spec ranges sheet, and paint in the color of the rust or oxidization in accordance of our gloss map. In the alpha channel of the normal map we still have our gloss map, which will define our reflectivity, smoothness and highlights. After we're done with our gloss map we paint according to our gloss map our spec map, to get different specular color of the oxidization. Once the asset is in engine we need to open up the material editor and set the specular value of the material to 255. This has to be done since the color map of the spec map is controlling the specular color and not the shader. Please don't forget to set the value of the gloss also to 255 so the gloss map in the alpha channel will work. Here's our final asset looks in game with the normal, gloss and spec map working. |
Subsurface scattering for environments
Expand |
---|
One of the biggest things to take our visual quality to truly "next gen" is using subsurface scattering in environments and the materials for it. You have materials that have a bigger amount of subsurface scattering like marble and you have some who have less or none. Since the cost of using it is very low we recommend using it frequently. The only time you shouldn't use it is on pure metal surfaces. Sometimes a surface doesn't have a lot of subsurface scattering, but we still recommend using it with a very low value. There are three colors of subsurface scattering we can use: red, blue and yellow. The red color of the subsurface scattering should be use more in conjunction with skin on characters. The blue should be use more with ice, but it can also be used with surfaces to give it a colder look. The yellow is the main color it should be used for environments and its surfaces, especially on marble.
|
Chinese | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
概述
在Photoshop中设置以符合Physically Based Shaders我们要做的第一件事情是需要保证Photoshop的设置是正确的。当你打算为你的Physically Based Shaders 绘制贴图的时候你应该清楚你的显示器应该调整到sRGB的色彩空间,一个50%的灰度在值不等同于0.5或者127,它相当于反向的gamma2.2的值有0.5的提高,这个值等于在Phot0oshop中的187。简而言之,这是使用标准的原因是为了避免一些条纹的产生。在sRGB空间使得更敏感的人的眼睛能感觉到更多更精确的暗部颜色,在开始调色前,请确认你的屏幕颜色较准正确。为了实现这个目标,我们需要到“"Color Settings”中,你打开Ps后可以选择 "Edit" 菜单选择"Color Settings..."。将RGB设置为sRGB接下来设置Gray到Gray Gamma 2.2. 默认情况下,Gray 一般设置为Dot Gain 20%,这会导致颜色在alpha通道中产生变化。对于一个127的数值在引擎中就会降低变成104这样就会导致一个不一致的结果,所以才必须要使用Gamma 2.2的原因 完成了Photoshop 里面的设置后,我们可以可以从样品的列表中通过颜色的拾取功能来获得当前想要的材质数据。请不要忘记你的 Gloss Map 现在已经移动到 Normal Map里面去了。 你现在看到的这里的数值几乎是可以针对所有的不同类型的材质。使用颜色拾取工具拾取样本来获得这些数值。请在图象上面单击下载这个图像文件并且保存成为一个bmp文件(这是未压缩的数据,可以给你正确的值),一定不能从在这个文档中下载的jpg文件中拾取这些颜色,这样以来你将会从压缩的数据中获得错误的值。 .如果你不知道什么是 Physically Based Shaders 和他是怎么工作的请参看:Physically Based Rendering 为 Physically Based Shaders制作Specular 贴图我们使用physically based shading 技术可以真正将我们的项目变成次时代游戏,在pbs中光泽度(gloss map )贴图几乎是最重要的贴图了,它要求我们需要去想一下如何去使用我们的specular maps。 光泽度(gloss map )贴图几乎和绘制 diffuse texture 差不多去绘制或者修改成你想要的效果。举例如果你不想使用任何的金属效果或者你的美术资源没有任何的金属部件,我们几乎不需要使用spec map就可以实现很好的效果。 我们将光泽度(gloss map )贴图放置到Normal Map.的Alpha 通道中去。 材质类型这里有关的渲染几乎只有两种类型的材质:他们是 金属 (导体类似铁, 黄金, 铜, 等等.) 以及 非金属((绝缘材料 类似塑料, 石头, 木材, 皮肤, 玻璃, 等等)。或者两者颜色和光泽都比较特殊的材料。 金属吸收所有光线进入表面下层,因此金属没有漫反射。这里的意思是金属的diffuse应该是黑色的。所有可见光从表面直接反射(高光反射)。这就意味着不同的金属类型应该用油不同的高光颜色。 对比金属类型的材料,非金属物体应该包含漫反射;然而非金属的高光的反射将比金属材料变化少很多力度弱很多。非金属高光反射是单色(没有颜色,只有灰色)。大多数非金属只反照了一小部分的光反射值,几乎大多数材质(材料)在2%和5%之间。 Specular Color 的工作原理specular color定义了当光源出现在物体表面正上方时有多少光线从表面立即被反射。这是最小的高光强度,在掠射角下将增加菲涅尔效应。由于高光色的颜色是一种特定类型的特定材料参数,它也可以被视作为一种材质或物质类型的遮罩。所以高光色是一种物理值应该在参考列表中获取正确的数值。因此,高光参数不会留下太多的自由空间让美术人员去更改。 几乎所有的非金属的高光反照率都介于 2% 和 5%之间并且它们的高光颜色都是单色(灰度)。由于变化太小,所以表现specular color 的时候经常使用一个常数来体现它应有的物理效果而不是一张specular 贴图。然而,如果金属和非金属混合在一个贴图中,specular贴图就是必须的了,作为金属类材料的specular 颜色将会比非金属的specular 明亮很多。如果使用了specular map,你必须将material editor中的specular color调整成纯白色也就是255,255,255。这是因为如果你不更改成纯白色的话这个数值将会与specular map的像素的数值相乘这样会降低specular map的亮度从而使得你得到了错误的高光数值。 如果非金属材质使用贴图,届时你的spec map 颜色应该是白色的,在引擎材质编辑器中的 specular color 的值请参考这个"Physically Based Shading" 图片。你可以在这个连接中得到。 gloss 光泽度数值和工作原理另一个比较大应伽牢记在心的事情是光泽度的工作原理和如何应用它 光泽度定义了表面的粗糙程度。低光泽度值意味着表面粗糙,而高光泽度 的表面非常光滑是有光泽的。光泽度的高低影响 specular高光的大小和强度。表面光滑有光泽的物体他的specular高光面积将会比较小。一个细小的小亮点将会比较明亮这是因为为了遵守能量守恒的物理规则。 几乎所有的材质都应该拥有光泽度贴图,因为这样会给你的材质带来很多的变化。光泽度和 normal maps关系非常的密切,在一些高频率和细节重复的normal map中创建一些粗糙 的感觉将会比较好。不管怎么说,光泽度是材质微观细节的粗糙度。 我们可以绘制我们的贴图了,甚至我们可以描述你的物体有多少部分是使用过的(因为一个严重磨损部分的部分更为光滑,它会比那些没有使用的部分更多光泽度和更多的反射率比)
如何为Physically based shading 制作贴图Physically based shad比较重要的贴图是你的gloss 和normal map。开始制作的时候你需要制作单独的两张贴图,它们将会帮你定义你的表面特性,之后最后的一步就是增加你的 diffuse map diffuse 贴图它自身一定不能包含灯光信息。 使用 Photoshop输出你的Normal Map 复合你的Gloss MapGloss 和normals 彼此相互依赖。 normal map定义宏观尺度表面的凹凸程度而 gloss 则定义微观尺度下的表面光泽度。 对于材质细节来说这两张贴图都非常的重要,所以你应该开始去制作你的normal map和gloss map。一旦你达到了预期的效果,你应该开始制作你的 diffuse texture,请千万切忌diffuse map必须永远不能包含光照信息。 gloss map 应该永远放置在normal map的alpha通道中,甚至如果你已经为你的金属材质使用了spec map 和这个金属材质包含了表面。 将输出你的normal map with the gloss in the alpha channel,这个选项,这个贴图的命名规则永远是 suffix _ddna (例如:庭院_墙_石头_ddna) 举例来说明如何设置 gloss maps 和shaders以下举一些例子来说明gloss maps是如何影响美术资源和它是如何定义的材质的 。还会教你理解,怎样将一个 gloss map达到预期的材质和效果。 这些范例都放置在资源Zoo里面的Orbs 作为范例。这些资源使用同一个材质除了他们的diffuse不同,这是因为我们可以看得更清楚gloss 和normal map在做什么工作。 大理石地面材质
岩石材质
砂岩砖块材质
彩绘大理石材质
大理石未抛光材质
白色/黑色和灰色抛光大理石材质
抛光的白色大理石砖材质
非金属材质和金属材质共用贴图
金属材质
氧化/生锈的金属
环境次表面散射材质
|
...