Shader Writing in Unity

For the last six months I started to work on shader writing in Unity. Following is some of the shaders I did.

Visual Likeness

I worked on a visual likeness project. I created a shader using the Cook - Torrance model. On the left, you can see the reference picture and on the right, you can see the render from Unity3D .for the reflection on the coffee table I used the Blinn model with a reflection probe from Unity.

All the models in the project are from asset store and I modified some of the models to fit the reference image. For the textures, I used substance painter. This shader only uses a diffuse and a normal map as an input. For the reflections, I used two parameters named diffuse and smoothness factor.

Title of Image


Escape the Flood

The following is a mini platformer game where the player tries to escape the city before the flood. The player moves the car using W, S, A, D. W,S for going backward and forward and A,D for steering the car. To steer the car the player needs to be moving.

This mini prototype has three main custom shaders. The water shader uses a noise to create the waves on the surface of the water. The shader cretes a foam where water connects with any surrounding objects. Shader has a UI for the user to change perameters directly from the engine.

The mirror shader uses a reflection probe. Reflection probe updates every frame and moves with cameras forward axis to create an updated reflection map. This reflection map is feed to the shader via script.

The opacity shader uses a transparent Blinn model and uses raycasts to determine if there is an object between the car and the camera. If there is an object between the two the alpha value of the object's shader changes to the desired amount. When the object is no longer between the two object alpha value changes back to its original amount.