콘텐츠로 건너뛰기

Advanced Skin Shader for Next-Gen Mobile games.


通常,移动游戏开发环境不常使用Normal Blur Sub-Surface技术的原因是,因为Normal纹理的Mip-Map需要使用DDX、DDY或Gaussian Blur进行实时Blur处理。

In order to check the demand of the internal art team, it is the process of extracting the mobile game character data of Netease and testing the internally developed Shader.
The left side is a shader using the Gaussian Blur method, mipmap-chain and Diffusion Profile, and the left side is produced by introducing an optimization formula from myself. Although there is a huge difference in instruction quantities, there is not a big difference visually in the mobile game environment.

When dealing with character rendering, you often hear a lot about SSS effects.
In general, the reason why mobile game development environments do not often use Normal Blur Sub-Surface technology is that the normal texture Mip-Map requires DDX, DDY or Gaussian Blur for real-time blur processing.
Now, the content will introduce the idea steps of preprocessing the real-time processing part.


Copyright by Blue-Side

Texture-Space SSS 或 Screen-Space SSS 的概念,目标是移动设备也可以使用的轻巧、近似的( approximated ) SSS 。

Code hint

假设使用如图6所示的内核模糊法线贴图( 假设 L 是 Directional-Light Vector )。 那么可以得到以下结果。

实际上,由于没有执行将内在结果剪除到零以下的过程 max( dot( N, L ), 0 ) , 所以不能说完全一样, 但是可以用于近似值。使用punctual光源(如点光源)时,每个像素的光源向量会有所不同,但由于模糊的周围像素,因此在使用它作为近似值时不会有困难。
所以,如果预先模糊法线向量并计算出 Diffuse Lighting,就能大致计算出 SSS 结果。此方法的主要优点是,可以再使用一张法线贴图,仅需要一次 dot( N, L ) 演算就可以计算近似 SSS 。 问题是 ” SSS 近似到哪种程度” 。

Suppose you want to Blur a normal map using the Normal kernel as shown above. For convenience, let’s assume that L is a Directional-Light Vector. This will give you the following result:

In fact, we didn’t do max (dot (N, L), 0), which truncates the inner product to zero or less, so it’s not exactly the same, but it’s a good approximation.
Using point lights, etc., the light vector at each pixel is different.
Therefore, if you calculate the Diffuse Lighting by blurring the normal vector in advance, you can approximate the SSS result to some extent. And the biggest advantage of this method is that we can approximate SSS at the cost of using one more normal texture and doing another dot (N, L) operation. The bottom line is “how close is the SSS?”Also, two normal textures were compressed into one texture.

由于美术们的倾向,没有做出正确的纹理信息,所以制作和提供Substance Designer的滤镜是一个很好的方法。需要导出的信息由Substance Designer存储为Sbsar,并在Substance Painter上应用。

The artist must output the textures that are appropriate for the shader structure.
Since the exact texture information was not created according to the artist’s inclination, it is a good idea to create and provide a filter with Substance Designer.The information to be printed is saved as Sbsar in Substance Designer so that it can be directly applied in Substance Painter.

Refer model copyright by Netease : Not my own work , shader dev work result are my own.
Left result used to Spherical Gaussian method and Right result it my normal cluster kernel method.
My method have 5X more faster on mobile even very closet final result from SG method.
Refer model copyright by Netease : Not my own work , shader dev work result are my own.

添加SKIN BRDF和Back Scatter的初版结果。
开发手机皮肤shader时,通常需要确保在OpenGL 2.X或更高版本中工作。
如果使用Energy Conservation Normalized Blinn-Phong,则OpenGL 2.0的行为也不受限制。此外,还应避免使用尚未在特定硬件上支持的DDX和DDY。

This is the primary output of SKIN BRDF and Back Scatter.
When developing a mobile skin shader, always work to ensure that it works with OpenGL 2.X and above.Energy Conservation Normalized Blinn-Phong also works with OpenGL 2.0 without restriction. Also avoid using DDX or DDY, which is not yet supported by certain hardware.

Skin Shading with ACES tone mapped test.(Mobile)

这是有点西洋风格的角色制作案例。阴影部分使用OPTIMIZED PCSS。
可以优化Iteration Sample count,使用3D Lookup将运算数降至最低,并且可用于角色选择窗口专用。

This is an example of making a Western character.
The shadow part uses OPTIMIZED PCSS.I am currently testing Penumbra Scatter for shadows.
Optimize the Iteration Sample count and use 3D Lookup to minimize the amount of calculation and use it for character selection window only.It is available only in a conversation window without using it in a real game.

根据色温和颜色表,shader实现必须多次重复。在上面的插图中,有一个皮肤Shader是根据PBR shader实现的,它使用Blinn-Phong,在完全低性能的智能手机上也可以跑,并且存在未使用任何BRDF纹理的皮肤Shader。

Shader implementations need to be repeated many times, based on color temperature and color palette.In the picture above, there are skin shaders based on PBR shaders, and there are skin shaders that use Blinn-Phong, which works perfectly on low-end smartphones, and do not use any BRDF textures.

Old version of Skin shading

Blinn-Phong based Skin shader since by 2013 in years.

Additional further works

Automatic skin material applies system.

Beck-mann NDF for the dual specular robe.

Related post



댓글 남기기

%d 블로거가 이것을 좋아합니다: