Skip to content

Instantly share code, notes, and snippets.

@jhocking
jhocking / TintedUIBlur.shader
Created February 9, 2021 16:17
Blur the background behind UI
// blur shader from https://stackoverflow.com/questions/29030321/unity3d-blur-the-background-of-a-ui-canvas
// added toggle https://forum.unity.com/threads/shader-properties-no-bool-support.157580/#post-3013337
Shader "Custom/TintedUIBlur" {
Properties {
_Size("Blur", Range(0, 30)) = 3
[HideInInspector] _MainTex("Masking Texture", 2D) = "white" {}
_AdditiveColor("Additive Tint color", Color) = (0, 0, 0, 0)
_MultiplyColor("Multiply Tint color", Color) = (1, 1, 1, 1)
[Toggle(MAKE_DESATURATED)] _MakeDesaturated ("Desaturate", Float) = 0