Shaders | Unity | HLSL
Escape the Flood - Prototype
Escape the Flood is a mini platformer game where the player tries to escape the city before getting caught up to the flood.
Player controls the blue car using W, A, S, D. W - S is used for going forward & backwards and A - D is used for steering the car. Additonally, to steer the car has to be moving.
I created 3 custom shaders for this prototype; Water Shader, Mirror Shader, Opacity Shader.
The water shader uses a noise map to crate the waves on the surface. This was intentional to give Artists/Game Designers the freedom to change visual language of the water. The shader creates foam effect where objects intersect the surface of the water.
The miror shader uses a reflection probe which is updated every frame and moves with camera's forward axis to create an run-time updated reflection map. This reflection map feds itself to the shader via script.
The opacity shader uses a transparent Blinn Model and uses raycast to determine if there is any object between the player (Blue Car) and the camera. When an object is detected the alpha value of the object's shader changes it to the desired amount to get the effect. Once the object is out of boundaries the alpha value changes itself back to it's default state.