Retrograde Shader - Custom Lit, Retro PC / Anime Shader Graph

Greetings. I am a long-time Unity user. Went to school for game development and discovered Unity after graduating. I’ve been on and off these forums since 2010 (under a previous account) using Unity for mostly education and personal projects with the aim of making quality dev tools and fun, retro gaming content. In 2018, I got inspired by the game Bernband and VR to begin a project reimagining the first mission from Star Wars: Dark Forces to refamiliarize myself with the editor after a decent hiatus.

Some experiments with Shader Graph led to a side project in 2020 that had been a goal of mine since starting with Unity, which was to somehow preserve the look and techniques of games from the past. After 3 years of research, testing, and optimization, I am presenting my first asset on the Asset Store!

Retrograde Shader is a throwback to the height of late 90s PC software rendering, initially inspired by games like MDK and Jedi Knight: Dark Forces II. It’s also heavily inspired by vintage illustration and retro anime.

Features include

  • Texture palettization using gradient maps and LUTs
  • Rare and historic color palettes indexed from 25 different retro PC games
  • Custom lighting and shadows
  • Half-lambert diffuse lighting, cel shading, point and spot light attenuation, and more
  • Shadow tint, shadow attenuation, shadow gradient mapping, shadow dithering
  • A unique way to anti-alias or blur shadow attenuation using offset dithering. Does not require percentage closer filtering (soft shadows) or normal biasing. Reduces shadow acne without a large amount of bias, resulting in less peter panning
  • Object normal editing. To improve the look of cel shading
  • Normal map posterization. Sharpens normal maps and shades them like pixel art
  • Normal map emboss and occlusion effects. Static shading that can react to dynamic light
  • Effect that improves the look of mipmapping for unfiltered textures. Includes a kind of mipmap bias adjustment for sharpening mipmaps without anisotropic filtering
  • Specularity and metalness, palettized reflections, anisotropic reflections
  • Glow, paint, and debris layers
  • Radial and vertical fog
  • Output palettization and screen dithering that is not post-processed

There’s currently a 50% new release discount for the next 4 days. I plan to include several new features in future updates, including transparency and vertex colors. Always looking for ways to improve the shader, so feedback is welcome.

Retrograde Shader 1.0.6 released!

New features

  • Transparency and vertex color have since been added
  • Refinement of the lighting system
  • Added a PBR lit version of the shader for Built-in and HDRP compatibility
  • Better texture and object palettization

Planned features

  • Further lighting features and optimization
  • Vertex color lighting and baking
  • More transparency features
  • Palette cycling!
  • A streamlined, “lite” version of the shader
  • A hull outline shader with consistent width

In my project, I was experimenting with different Rendering Paths and I’m finding that Forward+ and Realtime Lights do not agree with each other resulting in the real time lights to rapidly flicker.

Is the Shaderpack designed only with the standard Forward Rendering Path in mind or should Forward+ ideally be usable and the flickering is just a bug? If it’s the latter, hope it won’t be a pain to fix.

Hi. At the moment, I haven’t officially updated the shader to 2022 LTS because of a rendering bug which I believe has been fixed in 2022.3.18f1 and up. I haven’t had access to forward+ in 2021 LTS, so haven’t had a chance to test it. It is on the to do list, although I haven’t yet looked into how to make it work with custom shaders. It should be possible though.

Currently working on a performance focused “lite” version of the shader as well as a playable demo of something. Also, if anyone is interested, I just released a free SoundFont player VST on itch.io. It kinda sucks because it was made with SynthEdit, but it can sound cool and is fun to play. I’m hoping SynthEdit 1.5 will update its soundfont player and UI.

1 Like

There is currently a 50% off sale for the next two weeks! Sale ends the week of June 10th.

Apologies for the pause in updates. The plan was to get the shader to a stable state while I work on some other game dev related stuff. Once the sale ends, it will be back to a more regular update schedule. I appreciate the support so far!

I’ve been updating the Dark Forces Demo project for a free playable release on itch.io. One of the goals of the project is to utilize MIDI music using various SoundFonts to compliment the retro visuals and to keep the game size to a minimum. I created an SNES Star Fox SoundFont that is compatible with General MIDI, with more GM SoundFonts planned for the future. It can be downloaded here:

Retrograde Shader 1.0.8 released!

Includes a new shader variant called Retrograde Lite that is more performant and easier to use. Added a tutorial on how to extract and export gradient maps to PNGs in GIMP. Simplified and improved the character controller. Overall, a very solid update that improves performance, functionality, and documentation.

Again, apologies for the delay in updates. I had to deal with some side projects and personal issues. I was also away from my computer for a week.

The next few updates will see further performance increases, specular highlight stepping, improvements to transparency, glow, and fog, and Gouraud-style vertex lighting and baking.

Retrograde Shader 1.0.9 released!

Adds texel snapped shadows to the URP variants of the shader. This was a popular feature request and is based on the texel snapping function developed by GreatestBear.

The next few updates will add texel snapping to other parts of the shader.

1 Like

Retrograde Shader 1.1.0 released!

A few quality of life improvements like global tiling and offset for textures and automatic dither pattern tiling, so dither patterns are always pixel-aligned with the textures they blend with.

Also added texel snapping for baked GI and simplified the custom texel snapping node to be more modular.

Retrograde Shader 1.1.1 recently released!

Adds several new features to complete the cel shaded look. Among them are specular highlight effects, including stepping, and a new hull outline shader inspired by cel animation and Vagrant Story. Also added 2 new LUTs based on color palettes used by anime studios, like Toei.


1 Like

There is currently a 50% off Black Friday sale until December 9th!

So I cannot get these shading results in HDRP because it is limited to Lit?
Not even a very simple sharp shadow falloff feature?

Only looking for the same lighting/shadow falloff as RealToon in HDRP:

This shader being based on Shadergraph is the convenience I seek.

I’d understand different lighting modes and reflections being more complicated to implement in HDRP, but is that the case even for the traditional cel-shaded sharp shadow falloff transitions?

Clearly I am sounding like a beggar in here because a shadergraph-based HDRP-compatible cel-shaded solution with the characteristic cel-shaded shadowing support would make you a lifesaver :sweat_smile:

Hi 011. HDRP uses deferred rendering, similar to Unreal, which makes custom lighting more difficult to achieve. A common technique is to fake it using post-processing. RealToon is an excellent shader that appears to provide custom lighting in HDRP. Not exactly sure how it’s done yet, but it may not be possible with Shader Graph. I have yet to come across any instructions or tutorials on how to implement it for HDRP.

Here are some resources on how to create post-processed cel shading. The last video is an Unreal tutorial, but the same concepts can be applied to Unity:

https://ragueel.medium.com/creating-simple-cell-shading-custom-post-process-in-hdrp-b3f2ea2b8c28

https://youtu.be/9fa4uFm1eCE?si=EHn73dqDWlIVQsap

https://youtu.be/eBS3BOI5KnM?si=GqkUQBObjkqlm6Y5

There’s also the free Unity Toon Shader, which works in HDRP:

https://docs.unity3d.com/Packages/com.unity.toonshader@0.7/manual/index.html

At the moment, I am looking to update the shader to Unity 6 as well as implement baked and dynamic vertex lighting.

Something as simple as this can do the job for me by being implemented into Retrograde:
HDRP Simple Toon Shading.rar (543.6 KB)



I am not very knowledgeable when it comes to shaders so even I am surprised I got that to work by bringing together these two resources :upside_down_face: :

https://bitbucket.org/gaello/toon-shading/downloads/
[Additional resource: HDRP getting shadow attenuation - #20 by Just_Lukas]

Would it be complicated to add this shading in the Retrograde HDRP Lit shader?
I tried to use the Retrograde HDRP Lit shader as Unlit and it seems to work just fine but I’m sure it isn’t as simple as that no? There’s even that Shadow Matte flag that becomes enabled in Unlit Mode.

EDIT: I have no need for the ramp feature, that’s just in there from the original source project.

Nice work! Thank you for those resources. Hadn’t seen that before. Unfortunately, it doesn’t provide enough code to access things like light intensity, shadow attenuation, or additional light data (point and spot). They are using forward rendering though, which is what I suspect RealToon is using. Not sure why forward rendered HDRP doesn’t let you customize lighting in Shader Graph like forward rendered URP. I’d imagine it’ll be possible at some point.

Final night of the Black Friday sale!

I read it is never coming to HDRP because of this:
https://www.reddit.com/r/Unity3D/comments/i3hswz/getting_access_to_light_attenuation_in_a_custom/

You cant. The light loop is much more complicated in HDRP, also it uses tiled deferred for most opaque things (with the exception of the stack lit master node), so lighting is not calculated in the shader itself, but rather as a post process.

So as a last question, I wanted to know: is it possible to bake the diffuse map generated by Retrogade into a texture, specifically the whole color adjustment section of the shader material? That would solve all of my problems.

They might be referring to the deferred renderer in HDRP. It could potentially be possible with HDRP’s forward renderer, like URP, but that’s just a guess. Custom lighting is not impossible with deferred rendering. I’ve seen it done with a custom build of Unreal 4’s deferred renderer. I suppose it just comes down to performance concerns and a lack of photorealism.

Do you mean using the shader as a kind of image editor that can save textures? Not currently. What you could do is create a scene with an orthographic camera facing a square plane. Edit your material on the plane and then screenshot it with no anti-aliasing. If your texture is larger than the maximized Game view, there is the Fullscreen Editor. It’s $20, but quite useful.

1 Like

Thanks for that!
Got very good results.

1 Like

Shader effects like Dither, Screen Dither, Transparency Opacity and Glow Tint are broken in the HDRP RetrogradeLit version while they work just fine in URP.

Thanks for letting me know. What version of Unity are you on? I tested in a new 2021 HDRP project, and Dither, Screen Dither, and Transparency Opacity seemed to work, but Glow Tint did not.

Found this: HDRP Shader Graph - Emission Not Working
Emission Node | Shader Graph | 10.2.2

It seems you need the Emission Node in HDRP graphs to interpret emission. Also, the Reference name of the Glow Tint property is conflicting with an existing Reference name. If you change it to something like _EmissionColor_1 or just _GlowTint, it should work. I’ll fix this in the next update.