A shader for Unity designed to create a retro look but with modern PBR features.

Licensed under Creative Commons Attribution 4.0 - (TL:DR; you can use it however you want, including for commercial projects, but you must credit me if you do)

Requirements:

  • Universal Render Pipeline (2020 or later)
  • Shader Graph Markdown is required for the material editor to look correct, but the shader will still work without it.


Known Issues:

  • Normal maps cause the per-texel calculations to go a little extra weird. This is usually fine, unless you let the camera get way up close to your textures. Smooth shaded models without normal maps have this issue too, but to a much lesser extent. As far as I know, this is a necessary trade-off, and can't really be fixed.
  • Does not currently support Subtractive lighting mode.
  • Does not support Screen Space Shadows on URP 2021.
  • Yes, the regular shader has "(NOT Transparent)" in the name.
    • This is a dumb workaround to make Unity bake lighting for objects that have Alpha Cutoff enabled. If you know a way to fix this I'll gladly take your help.

Features & Options:

  • Blend Modes:
    • Opaque
    • Alpha Cutoff
    • Transparent (Alpha Blend)
      • With refraction!
  • PSX-style vertex snapping and texture mapping
  • Texture Filtering:
    • Linear
    • Nearest
    • N64-style
  • 3 lighting modes:
    • Per-Pixel
    • Per-Texel
      • Snaps lighting to texels for a crisp pixel art look
      • Supports baked lights too!
    • Per-Vertex
      • More powerful than regular vertex lights!
      • Real-time vertex shadows!
      • Specular highlights!
      • Vertex-based lightmaps!
  • SSAO Support
    • In Per-Texel and Per-Pixel modes
  • 4 different specular modes
    • Standard (URP default)
    • Phong
    • Blinn-Phong
    • Disabled
  • Half-Lambert diffuse shading
  • Toggleable reflections
  • 2 Vertex Color modes
    • Multiply Vertex Color
    • Vertex Color as Emissive
  • Dithered lighting
    • Diffuse, Specular, and Ambient can be toggled separately
    • Double-size dither for that low res feel
  • Tint masking
    • Color your object selectively using a texture mask
  • Toon ramp support
    • Separate ramps for specular and diffuse lighting
    • Works in all three lighting modes
    • Generate ramps directly in the editor with Shader Graph Markdown!


Per-texel calculation code is originally by GreatestBear and truepak.

Thanks to Action Dawg for help with the affine UV code!

StatusReleased
CategoryAssets
Rating
Rated 5.0 out of 5 stars
(9)
AuthorAndrea Jörgensen
TagsShaders, Unity

Download

Download NowName your own price

Click download now to get access to the following files:

Retro Master (URP 2021) 129 kB
Version 2
Retro Master (URP 2020) 113 kB
Version 2
Example Toon Ramps 2 kB

Development log

Comments

Log in with itch.io to leave a comment.

This is awesome! I'm mostly interested in the per textel lighting - do you think it's possible to add this feature to built in pipeline's standard shader on unity 2019? Tried to convert my project but it's causing issues with some other assets. 

URP only! Lighting in BIRP is mildly more annoying and I don’t wanna screw with it

This is the best thing I've ever seen in my entire life.

Oh this is going to be useful! =D

Wow

For free??? Bruh