Shaders

In this project we have had a few diferent uses for custom shaders all of which I've buit using a node based editor called Amplify Shader.

Stencil

Stencil shaders offer the ability to mask geometry based on an ID, I replicated a standard PBR shader to use for the base, and created a stencil shader to act as the 'window'.

Animated Tesselated Effects

I was playing around creating animated cloud effects using perlin noise and a simple UV animation, this snowballed when I started to play with offsetting vertices and using tesselation. In this example, 3 planes are layered on top of eachother creating a colour depth.

cloudshader

Animated Outline / Rim Lighting

For interactions we wanted to have a glowing pulse coming from the object. A script controls the shader using a toggle and an outline value.
Glow is added to the emission output of the surface shader and is animated using a sin curve between a min/max level.

interactshader

Skybox Peek

For one section of the game we wanted to show that the world is desolving away. One way i thought was to have the skybox show through into the world. Using transparency on textures was not an option as this needed to be placed at will. I created a shader to try to create the effect I was looking for.

skyboxpeek

The shader does create the illusion that you can see through the world, but it does so by rendering a reflection of the skybox. While it looks the part in this instance, we had to be careful to not actually overlap with the real thing as it breaks the illusion.

The wobble effect is an animated noise map with an alpha cutoff, it uses this same noise map to darken the edges and make them slightly transparent. The whole effect is configurable, and can be faded in/out by script sort of like a burnt edge effect.

Animated UI with Emission

I created a shader for the UI that animates a noise map and together with an alpha mask texture (for the emissive areas) produces a boost in emission. When coupled with a little postprocessing (bloom) you get the effect below. As with all of the animated shaders, this one animates the UV (rotate or translate) to produce the animation

uishader-1

Other

Throuout the project I've created many other shaders, some notable ones are:

  • A cutout shader for portal render textures
  • A particle shader that blends texture when near the camera emulating bokeh effects on dust
  • A depth fog effect that becomes more transparent the closer to another surface the pixel is (like water on the beach).