Deep Dive: Shaders & Effects

shaders_title.jpg
Very Very Valet is a visually “simple” game, but achieving the look of the game still came with some interesting challenges. 
Let’s take a tour of some of the more notable shaders and visual techniques in the game.

SHADOWS

First up: shadows! Wait, don’t you get shadows for free in Unity? Yes, but not how we needed. We wanted pretty baked lighting coming from a sun at an angle, while still having perfect straight-down gameplay shadows:
shaders_02_shadow_direction.jpg
So we added an orthographic camera in the scene that renders with a special shader that just outputs the depth of each pixel. Only certain objects are tagged to render into this camera, and often with simplified meshes. Brighter red = closer to the camera.
shaders_03_shadow_camera.jpg
A script on the camera sets some shader globals that include the matrix for computing shadow UVs from world space coordinates, as well as other values like offsets, biases to avoid self-shadow artifacts, etc.
shaders_04_globals.jpg
We created a shader “sub-graph” for calculating if a given pixel is in shadow or not. It also fades out the shadow at the edges of the region to avoid hard edges as objects enter/exit the shadow area.
shaders_05_read_shadows.jpg
Here is an example of our car shader. You can see that after calculating the main color, we read the shadow, and potentially transition to a shadow color instead, if the area is in shadow.
shaders_06_car_example.jpg
The end result are clean shadows that emphasize readability, while still looking nice!
shaders_07_shadow_results.jpg

SILHOUETTES

Next: “silhouettes” for when Valets and/or cars are obscured from view.  This is a pretty well-known technique, here is a recap animation of video of how it works.

FUZZY CHARACTERS

Next: “fuzz”! To try and make our character appear more like puppets that are soft and fuzzy, we ended up using a fairly hacky screen-space approach, explained in this video.

TELEPORTER TUNNELS

Next: “Teleporters”! This is also a pretty simple combination of a few things: scrolling layers of noise, a specifically crafted mesh, and some vertex displacement. Breakdown in the video!

Previous
Previous

New Gameplay Footage

Next
Next

Deep Dive: Animating Text