Examples of previously developed shaders.
WARNING: Page contains lots of gifs. May take a long time (a lot of data) to load.
Workflow based in node-based shader editors. Finishing, custom features, or debugging done in ShaderLab/HLSL. Specific expertise in lighting, shader-based mesh animation, and shader-based VFX.
Contexts are primarily for 3D games and PBR based workflows, but skills and tech easily translate to 2D.
Particle Shader
Light-Reactive Volumetric Particle Effect
Design:
Solution:
Shader developed for custom particle behavior.
For use with simple particle system approach, the effect is based on a material shader for billboarded quads. Transparency is reactive to per-pixel lighting values. Uses forward rendering and supports multiple light sources, including their individual light colors, fall offs, and shadow-casters.
Context:
Project required volumetric lighting for atmospheric effects.
Unity’s Built-In Render Pipeline is not optimized for ray-marched based fog volumes.
The project required a light-weight solution (minimal impact on FPS).
The art pipeline specifically resulted in minimal overdraw from scene assets, so transparent particle based approach was selected. This approach afforded clear benchmarking and optimization since the impact of overdraw could be specifically attributed to density of this effect.
Features:
Supports Unity’s Particle System fading/transparency conditions
Works in “day” and “night” conditions
Effects normalized around a directional light intensity of 1 for ease of use
Uses procedural world space noise to simulate wind with full directional and morph rate controls
Allows for different mask textures to control particle “volume”/”density” representation
Implement soft-particle falloff to minimize quad/billboard-based artifacts
Through testing, works with as few as 5 layers between camera and light sources
Particle-based system allows for specific spatial localization, and simple logical control to disable CPU load for distant and out of frame Particle Systems
The shader captures illuminance for Post Processing effects like Bloom
Artist-friendly naming convention for ease of use
Notes:
Light and particle intensity turned up for demonstration purposes
Supports light cookies for softer falloff for spot lights, but omitted for clarity
Terrain Shader
Artifact-Free Tiling Terrain Shader
Design:
Solution:
Shader developed for Unity’s terrain system and editing tools, supporting splat mapping and built-in PBR texture support
Uses shader-based proceduralized texture variance to hide texture tiling artifacts
Supports Unity “Standard” shading, and additional requested feature - Parallax Occlusion Map
Context:
Project required solution to problem with minimal impact to existing tech stack and terrain pipeline, and zero impact to existing level designs
Specifically, Level Designers were using Unity’s built-in Terrain components, and built-in terrain editing tools (using height and splat maps)
Project’s performance budget required minimal use of large (2k+) textures, so increasing texture size was not viable
Features:
Drop-in replacement for Unity’s Standard Terrain Shader
No impact to, or loss of functionality from, Unity’s terrain editor workflow
Uses procedural random rotation and blending to hide texture seams
Blending supports Albedo, Normal, and Mask maps
Additionally supports POM using height map input, and per layer-POM strength
Easily modifiable to support custom lighting, snow accumulation effects, tint-based variance layering, etc.
Simple tuning features to support a wide range of high-frequency noise variance in albedo and normal textures
Artist-friendly naming convention for ease of use
Notes:
POM disabled to heighten visibility of “seams” (visual tiling artifacts")
Material Shaders
Custom Lighting Shader with Inverted Hull Outlines
Design:
Solution:
Custom Forward Lighting shader using soft-transition stepped toon lighting
Support PRB texture workflow, including Albedo, Normal, and AO, with architecture for future support of smoothness, metal, clipping, and detail layers
Inverted hull outline feature for aesthetic reinforcement, and selective application for design language (visual hierarchy)
Context:
Developed for personal project that required toon lighting
“Homemade” solution developed for unified lighting behavior across variants, such as:
Foliage - Noise-based wind animation for foliage
Simple - Outline free variant for environmental assets
Emissive - HDR variant for emissive sources
Terrain - Unity Terrain system support for splat maps
Water - Water variant with vertex offset animation for waves, computed normals for accurate lighting, and localized wave height suppression for ports
UV2 Support Sprite Sheet Flipbook - UV2 support with option for independent lighting behavior, permits the use of quantized sprite sheet for hand drawn facial expressions
Features:
Per-material Global Illumination base color (shadow color) step
Albedo texture base color step
Lit color step with control over inclusion/exclusion of light color contribution (broadcast Anime style vs digital illustration style)
Tunable ramps for transitions for soft edges
Supports fog
Skinned Mesh (Rigged Character) features like clipping mask - prevents body from visibly clipping through clothing under extreme deformation
“Normal Power” calculation to suppress/amplify normal map impact on lighting
Allows for simple style transfer for “photoreal” style assets
Artist-friendly naming convention for ease of use
Notes:
References below are all using variants of the same toon lighting shader (or other custom made shaders like wet glass, particle rain splash flipbook.
Effects Shader
Mesh Animations, Trail Effects, Screen Space Post-Processing Stack Effects
Demo Reel 1:
VFX System
All effects managed under single Effects Manager
Effects Manager operates with dynamic object pool, reusing existing objects, and dynamically creating new ones when overflow requires
Dynamic object pool is genericized so any game object / prefab can be managed, and any in-scope parameter can be observed for management
Effects can be controlled via static class accessor
Effects.Fire(string name, Vector3 pos, Quaternion rot;
Generic Effect Controller base class allows for the control of multiple various effects and rendering component control and scheduling (TrailRenderer, ParticleSystem, MeshRenderers, etc.), max lifetime, transform scaling, spatialized SFX firing, etc.
Generic Effect Controller utilizes SubClass Sandbox Pattern for easy variant creation
Generic Effect Controller has surfaced features for configuration, tuning, and customization in editor
Effect 1 - Bullet Trail
Task-based lifecycle management
Primary animation VIA CPU trail vertex (points) animation
Secondary animation VIA GPU (shader) vertex deformation animation
Screen space blue-noise dither fading for consistent lighting in overlapped regions
Effect 2 - Mesh Particle Explosion with Collisions
When crab enemies are killed, tentacle mesh particles are emitted upon death
Tentacles are animated using vertex deformation shader
Animation operates in world-space to prevent deformation scaling as particles scale
Particle system utilizes collisions to prevent clipping through terrain and other physics colliders
Effect 3 - Paper Particles
Uses Particle System to launch sheets of paper
Use of velocity, drag, noise, rotation, scaling to replicate high-surface-area-low-mass behavior
Effect 4 - Anime-Style Spherical Explosion Effect
Optimized UV sphere used to add topological density along vertex animation areas (fewer longitudinal divisions, greater latitudinal divisions)
Scaled (squashed) noise-based world space vertex deformation animation
Noise algorithm output used as color ramp mask
Task-based lifecycle management
Light-weight Animation Workflow
Hybrid Shader-based Vertex Animation and CPU-based Static Mesh Animation
Light-Weight Animation Workflow
Use of various optimization techniques reduces both CPU and GPU impact
Entity concepts are analyzed to look for alternative animation approaches to preclude need for armatures (rigs) and blendshapes, which can be CPU intensive
Static Mesh Animation
Using mesh object hierarchy in place of armature permits familiar FK animation workflow
Reused meshes (crab legs) can be efficiently rendered using GPU instancing because it is a static mesh (i.e. no mesh vertex changes)
Further optimization possible by reusing a single set of shared leg mesh assets (i.e. every leg is using the same mesh object so 1, NOT 8, meshes are packaged for the GPU)
Simple pose interpolation for locomotion cycles can be controlled by a single shared manager to further minimize CPU impact
Usage in examples:
Crab legs - 4 pose cyclic rotation interpolation
Crab teeth - 2 pose cyclic rotation interpolation
Crab and Jellyfish tentacles - local space rotation
Jellyfish eye - randomized local rotation
Vertex Deformation Animation
For repeating simple movements, vertex offset animation in-shader can massively minimize the cost versus armature-based or blendshape based animation
Using vertex painting, or texture based masking, animation scale and timing offset can be customized
For the jellyfish:
Vertex color R-channel is used to control magnitude - the top of the jellyfish body and base of smaller tentacles have an R-channel value of 0 to dampen animation effect
Vertex color G-channel is used to offset animation timing - the smaller tentacles have a higher G-channel value than body to apply offset to time so they move off-cycle from body slightly
For the tentacles:
Sinusoidal movement applied in local space to create wiggly movement
Randomized rotations on a per-instance basis can prevent appearance of synchronized animation across instances