Shaders are predominatly made for Unity URP so may need adjustment for HDRP
While these shaders should work fine and I have used them in previous/current projects they are not actively maintained
Fullscreen Effects
Shader "Custom/GlitchURP" {
SubShader {
HLSLINCLUDE
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
ENDHLSL
Tags { "RenderType"="Opaque" }
LOD 100
ZWrite Off
Cull Off
Pass {
Name "GlitchPass"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment Frag
float2 _ScanlineJitter; // (displacement, threshold)
float2 _VerticalJump; // (amount, time)
float _HorizontalShake;
float2 _ColorDrift; // (amount, time)
float rand(float2 co) {
return frac(sin(dot(co.xy, float2(12.9898,78.233))) * 43758.5453);
}
half4 Frag (Varyings i) : SV_Target {
// Scan line jitter
float jitter = rand(float2(i.texcoord.y, _Time.x)) * 2 - 1;
jitter *= step(_ScanlineJitter.y, abs(jitter)) * _ScanlineJitter.x;
// Vertical jump
float jump = lerp(i.texcoord.y, frac(i.texcoord.y + _VerticalJump.y), _VerticalJump.x);
// Horizontal shake
float shake = (rand(float2(_Time.x, 2)) - 0.5) * _HorizontalShake;
// Color drift
float drift = sin(jump + _ColorDrift.y) * _ColorDrift.x;
half4 src1 = SAMPLE_TEXTURE2D(_BlitTexture, sampler_LinearClamp, frac(float2(i.texcoord.x + jitter + shake, jump)));
half4 src2 = SAMPLE_TEXTURE2D(_BlitTexture, sampler_LinearClamp, frac(float2(i.texcoord.x + jitter + shake + drift, jump)));
return half4(src1.r, src2.g, src1.b, 1);
}
ENDHLSL
}
}
}
using UnityEngine;
public class GlitchController : MonoBehaviour {
public Material glitch;
[Range(0, 1)] public float scanlineJitter;
[Range(0, 1)] public float verticalJump;
[Range(0, 1)] public float horizontalShake;
[Range(0, 1)] public float colorDrift;
private float verticalJumpTime;
public void Reset() {
scanlineJitter = 0f;
verticalJump = 0f;
horizontalShake = 0f;
colorDrift = 0f;
}
private void Update() {
verticalJumpTime += Time.deltaTime * verticalJump * 11.3f;
float sl_thresh = Mathf.Clamp01(1.0f - scanlineJitter * 1.2f);
float sl_disp = 0.002f + Mathf.Pow(scanlineJitter, 3) * 0.05f;
glitch.SetVector("_ScanlineJitter", new Vector2(sl_disp, sl_thresh));
Vector2 vj = new Vector2(verticalJump, verticalJumpTime);
glitch.SetVector("_VerticalJump", vj);
glitch.SetFloat("_HorizontalShake", horizontalShake * 0.2f);
Vector2 cd = new Vector2(colorDrift * 0.04f, Time.time * 606.11f);
glitch.SetVector("_ColorDrift", cd);
}
}
Shader "Custom/Static" {
Properties {
_Intensity ("Static Intensity", Range(0,1)) = 0
_Scale ("Noise Scale", Float) = 50
}
SubShader {
HLSLINCLUDE
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.core/Runtime/Utilities/Blit.hlsl"
ENDHLSL
Tags { "RenderType"="Opaque" }
LOD 100
ZWrite Off
Cull Off
Pass {
Name "StaticPass"
HLSLPROGRAM
#pragma vertex Vert
#pragma fragment Frag
CBUFFER_START(UnityPerMaterial)
float _Intensity;
float _Scale;
CBUFFER_END
float hash(float2 p) {
return frac(sin(dot(p, float2(127.1, 311.7))) * 43758.5453);
}
float4 Frag (Varyings i) : SV_Target {
float3 col = SAMPLE_TEXTURE2D(_BlitTexture, sampler_LinearClamp, i.texcoord).rgb;
float2 noiseUV = i.texcoord * _Scale + hash(_Time.y) * 50.0;
float flicker = frac(_Time.y * 10.0);
float noise = hash(floor(noiseUV + flicker));
float staticValue = (noise - 0.5) * 2.0;
col += staticValue * _Intensity;
return float4(col, 1);
}
ENDHLSL
}
}
}
Material Shaders
Shader "Custom/BlackCore" {
Properties {
[HDR] _RingColor("Ring Color", Color) = (1,1,1,1)
_RingWidth("Ring Width", Range(0.0, 1.0)) = 0.3
_RingSoftness("Ring Softness", Range(0.0, 1.0)) = 0.2
}
SubShader {
Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" }
Pass {
HLSLPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
struct Attributes {
float4 positionOS : POSITION;
float3 normalOS : NORMAL;
};
struct Varyings {
float4 positionHCS : SV_POSITION;
float3 normalWS : TEXCOORD0;
float3 viewDirWS : TEXCOORD1;
};
CBUFFER_START(UnityPerMaterial)
float4 _RingColor;
float _RingWidth;
float _RingSoftness;
CBUFFER_END
Varyings vert(Attributes IN) {
Varyings OUT;
VertexPositionInputs posInputs = GetVertexPositionInputs(IN.positionOS.xyz);
VertexNormalInputs normalInputs = GetVertexNormalInputs(IN.normalOS);
OUT.positionHCS = posInputs.positionCS;
OUT.normalWS = normalize(normalInputs.normalWS);
float3 camPos = GetCameraPositionWS();
OUT.viewDirWS = normalize(camPos - posInputs.positionWS);
return OUT;
}
half4 frag(Varyings IN) : SV_Target {
float NdotV = saturate(dot(IN.normalWS, IN.viewDirWS));
float rim = 1.0 - NdotV;
float ring = smoothstep(_RingWidth, _RingWidth + _RingSoftness, rim);
return half4(_RingColor.rgb * ring, 1.0);
}
ENDHLSL
}
}
}
Shader "Custom/SIMPJ0136" {
Properties {
_Scale ("Noise Scale", Float) = 5
_Speed ("Flow Speed", Float) = 0.2
_Distortion ("Distortion", Float) = 0.3
[HDR] _ColorA ("Color A", Color) = (0.8,0.5,0.3,1)
[HDR] _ColorB ("Color B", Color) = (1.0,0.8,0.6,1)
_Bias ("Bias", Float) = 0.0
_LightningIntensity ("Lightning Intensity", Float) = 0.3
_LightningFrequency ("Lightning Frequency", Float) = 0.3
_LightningSpeed ("Lightning Speed", Float) = 0.3
}
SubShader {
Tags { "RenderType"="Opaque" "RenderPipeline"="UniversalPipeline" }
Pass {
Blend SrcAlpha OneMinusSrcAlpha
ZWrite On
ZTest LEqual
HLSLPROGRAM
#pragma target 4.5
#pragma vertex vert
#pragma fragment frag
#pragma multi_compile_instancing
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
CBUFFER_START(UnityPerMaterial)
float _Scale;
float _Speed;
float _Distortion;
float4 _ColorA;
float4 _ColorB;
float _Bias;
float _LightningIntensity;
float _LightningFrequency;
float _LightningSpeed;
CBUFFER_END
struct appdata {
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f {
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
float3 palette(float t, float3 a, float3 b, float3 c, float3 d) {
return a + b * cos(6.28318 * (c * t + d));
}
float hash(float2 p) {
return frac(sin(dot(p, float2(127.1,311.7))) * 43758.5453);
}
float noise(float2 p) {
float2 i = floor(p);
float2 f = frac(p);
float a = hash(i);
float b = hash(i + float2(1,0));
float c = hash(i + float2(0,1));
float d = hash(i + float2(1,1));
float2 u = f*f*(3.0-2.0*f);
return lerp(lerp(a,b,u.x), lerp(c,d,u.x), u.y);
}
float fbm(float2 p) {
float v = 0.0;
float a = 0.5;
for(int i = 0; i < 4; i++) {
v += noise(p) * a;
p *= 2.0;
a *= 0.5;
}
return v;
}
float lightningMask(float2 uv, float time) {
float n = fbm(uv * 2.0);
float t = sin(time * _LightningFrequency + n * 10.0);
float flash = smoothstep(0.92, 1.0, t);
return flash;
}
v2f vert (appdata v) {
v2f o;
o.vertex = TransformObjectToHClip(v.vertex.xyz);
o.uv = v.uv;
return o;
}
float4 frag (v2f i) : SV_Target {
float2 uv = i.uv;
float time = _Time.y * _Speed;
float2 flow = float2(
fbm(uv * _Scale + time),
fbm(uv * _Scale - time)
);
uv += (flow - 0.5) * _Distortion;
float bands = sin((uv.y + fbm(uv*2.0)*0.2) * 20.0);
float n = fbm(uv * _Scale + bands);
float3 col = lerp(_ColorA.rgb, _ColorB.rgb, n);
float eps = 0.002;
float h = n;
float hx = fbm((uv + float2(eps,0)) * _Scale);
float hy = fbm((uv + float2(0,eps)) * _Scale);
float3 normal = normalize(float3(h - hx, h - hy, 0.2));
float light = dot(normal, normalize(float3(1,1,1))) * 0.5 + 0.5;
// Outside Lightning
float flash = lightningMask(uv, _Time.y * _LightningSpeed);
float flicker = fbm(uv * 10.0 + _Time.y * 5.0);
flash *= smoothstep(0.4, 1.0, flicker);
float3 baseLightningColor = palette(
n,
float3(8.0, 0.05, 0.1), // red
float3(0.1, 0.1, 0.1), // dark grey
float3(0.3, 0.1, 0.5), // purple
float3(1.0, 1.0, 1.0) // white
);
float3 rareLightningColor = palette(
n,
float3(0.3, 0.4, 0.8), // blue
float3(0.1, 0.1, 0.1), // dark grey
float3(0.8, 0.6, 1.0), // purple
float3(1.0, 1.0, 1.0) // white
);
float3 lightningColor = lerp(baseLightningColor, rareLightningColor, n * 0.5 + _Bias);
col += lightningColor * flash * _LightningIntensity * 2.5;
light *= lerp(1.0, 2.0, flash * _LightningIntensity);
// Internal lightning
float internal = fbm(uv * _Scale * 0.5 + flash * 2.0);
col += internal * flash * _LightningIntensity;
return float4(col * light, 1);
}
ENDHLSL
}
}
}
Shader "Custom/WireframeShader"
{
Properties {
_MainTex ("Albedo (RGB)", 2D) = "white" {}
_Tint ("Tint", Color) = (1,1,1,1)
_WireframeWidth("Wireframe Width", float) = 0.05
}
SubShader {
Tags { "RenderType"="Opaque" }
Pass {
HLSLPROGRAM
#pragma target 4.5
#pragma vertex vert
#pragma require geometry
#pragma fragment frag
#pragma geometry geom
#pragma multi_compile_instancing
#pragma multi_compile _ DOTS_INSTANCING_ON
#include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl"
#include "Packages/com.unity.render-pipelines.core/ShaderLibrary/UnityInstancing.hlsl"
struct appdata {
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
#if UNITY_ANY_INSTANCING_ENABLED
uint instanceID : INSTANCEID_SEMANTIC;
#endif
};
struct v2f {
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
#if UNITY_ANY_INSTANCING_ENABLED
uint instanceID : INSTANCEID_SEMANTIC;
#endif
};
struct g2f {
float4 pos : SV_POSITION;
float3 barycentric : TEXCOORD0;
#if UNITY_ANY_INSTANCING_ENABLED
uint instanceID : INSTANCEID_SEMANTIC;
#endif
};
TEXTURE2D(_MainTex);
SAMPLER(sampler_MainTex);
CBUFFER_START(UnityPerMaterial)
float4 _Tint;
float _WireframeWidth;
CBUFFER_END
#ifdef DOTS_INSTANCING_ON
UNITY_DOTS_INSTANCING_START(MaterialPropertyMetadata)
UNITY_DOTS_INSTANCED_PROP(float4, _Tint)
UNITY_DOTS_INSTANCED_PROP(float, _WireframeWidth)
UNITY_DOTS_INSTANCING_END(MaterialPropertyMetadata)
#define _Tint UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float4, _Tint)
#define _WireframeWidth UNITY_ACCESS_DOTS_INSTANCED_PROP_WITH_DEFAULT(float, _WireframeWidth)
#endif
v2f vert (appdata v) {
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_TRANSFER_INSTANCE_ID(v, o);
o.vertex = TransformObjectToHClip(v.vertex.xyz);
o.uv = v.uv;
return o;
}
half4 frag (v2f i) : SV_Target {
half4 col = SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, i.uv);
col.rgb *= _Tint.rgb;
return col;
}
[maxvertexcount(3)]
void geom(triangle v2f IN[3], inout TriangleStream<g2f> triStream) {
UNITY_SETUP_INSTANCE_ID(IN[0]);
g2f o;
UNITY_TRANSFER_INSTANCE_ID(IN[0], o);
o.pos = IN[0].vertex;
o.barycentric = float3(1.0, 0.0, 0.0);
triStream.Append(o);
UNITY_TRANSFER_INSTANCE_ID(IN[1], o);
o.pos = IN[1].vertex;
o.barycentric = float3(0.0, 1.0, 0.0);
triStream.Append(o);
UNITY_TRANSFER_INSTANCE_ID(IN[2], o);
o.pos = IN[2].vertex;
o.barycentric = float3(0.0, 0.0, 1.0);
triStream.Append(o);
}
half4 frag(g2f i) : SV_Target {
UNITY_SETUP_INSTANCE_ID(i);
float closest = min(i.barycentric.x, min(i.barycentric.y, i.barycentric.z));
float alpha = step(closest, _WireframeWidth);
return half4(lerp(float3(0,0,0), _Tint.rgb, alpha), 1);
}
ENDHLSL
}
}
}