Traditional Chinese Painting Shader

Platform: Unity 3D

In order to show traditional Chinese painting effect, I implement two main functions. One function is the edge detection, Edge = Dot( Normal , View ), which is used to draw black lines of the mountain to show the edges. Another function is change the colors. Considering there are not many colors are used in traditional Chinese paintings, I reduce the categories of color by merging similar colors. I utilize some images with Chinese brush textures to enhance the textures of the edges of the color blocks.



Lighting Simulation Shader

Platform: Unity 3D

I use the model's normal information to do the texture sampling in order to simulate the lighting effects. I can change different textures to create various lighting effects.



Snow Particle Effect & Snow Shader

Platform: Unity 3D

The core algorithm is o.Color = step(1-_Snow,v.normal.y)*fixed3(1,1,1), which makes the parts like dog's back and head covered with snow. I can change the _Snow to enlarge the parts with snow.



Crystal Shader on Horse

Platform: Unity 3D

In order to implement the visual effect of crystal I have to raytrace both reflections and refractions. I use a indoor CubeMap to provide the surrounding color and use R = I - 2.f * N * dot(I, N) to get the directions of reflections and use the Snell's Law to get the directions of refraction light. Then I use Schlick’s approximation R(θ) = R0 + (1 - R0)(1 - cosθ)⁵ to combine the effects of reflections and refractions.



Knit Fabric Shader on Cat

Platform: Unity 3D

According to the cat's grid data, I use each triangle on it to generate a outward-pointing "pyramid" with fabric texture to make the cat's surface look like knit fabric.



Deep Ocean Shader

Platform: Unity 3D

Generate ripples on different layers and simulate refraction effects.