Skip to content

Instantly share code, notes, and snippets.

@beinteractive
Created February 2, 2016 04:25
Show Gist options
  • Save beinteractive/e8f685118c32e9b1ad67 to your computer and use it in GitHub Desktop.
Save beinteractive/e8f685118c32e9b1ad67 to your computer and use it in GitHub Desktop.
Shader "Legacy Shaders/Dither Diffuse" {
Properties {
_Color ("Main Color", Color) = (1,1,1,1)
_MainTex ("Base (RGB)", 2D) = "white" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
fixed4 _Color;
sampler3D _DitherMaskLOD;
struct Input {
float2 uv_MainTex;
float4 screenPos;
};
void surf (Input IN, inout SurfaceOutput o) {
float2 s = IN.screenPos.xy / IN.screenPos.w * _ScreenParams.xy * 200.0;
clip(0.5 + (sin(s.x) + sin(s.y)) * 0.25 - (1.0 - _Color.a));
o.Albedo = _Color.bbb;
o.Alpha = _Color.a;
}
ENDCG
}
Fallback "Legacy Shaders/Diffuse"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment