2018-12-16

Unity ShaderLab Works

Introduction

In this UnityShaderLabWorks directory, I list several of my works related to Unity ShaderLab. Hopefully they can showcase my ability to write Unity Shaders and my understanding of modern CG pipeline.

Cartoon Shading

CartonCharacterShading.JPG

The ToonShader.shader and the ZigZagHairToon.shader in the CartoonShading folder are my implementation of (Japanese)Cartoon Style Shading. In the screenshot above, the character on the right is rendered by Unity Standard shader. And the one in the middle is rendered by my ToonShader.shader. I drew the outline by rendering the back side of the model - expand it to let it looks like an outline. And I shade the albedo color which has been ramped by a ramped texture. I also handled the specular term via a threshold to make it looks more anime-style. Finally, the character on the left is rendered by my ZigZagHairToon.shader. This shader is a improved version of ToonShader.shader, in which I improved the specular light on the character's hair - make it zigzag like what it should appear in an anime.

Radial Blur Effect

TIM截图20181216182139.png

The files in the RadialBlurEffect folder are my implementation of Radial Blur Post-Processing Effect. This effect is frequently used when a sense of speed up is wanted. Driving a roadster or parachuting for instance.

It is quite easy to use. Just import these files into a Unity project, drag the RadialBlur.cs on your main camera as a component, then drag the RadialBlur.shader as the value of "Radial Blur Shader" attribute.

TIM截图20181216194245.png

Rim Light Shader

TIM截图20181216182002.png

The files in the RimLightShader folder are my implementation of Rim Light Effect, which is widely used by Video Games. In the screenshot above, the golden capsule is a normal version of Rim Light. The blue one is a special version, since it appears normal when it is obscured by nothing and it shows rim light when obscured by something. I implemented this shader under inspiration from a game called Far Cry 5. The player's companion in that game will appear like this when obscured by some obstacles.

Water Rendering

WaterShading.JPG

The files in the WaterRendering folder are my implementation of water shading. I used an extra camera to realize reflection of water. And I distorted the sample coordinates to realize refraction of water. Fresnel Effect, caustic of water and scatter effect of water are also considered.

你可能感兴趣的:(2018-12-16)