Skip to content

Instantly share code, notes, and snippets.

Created June 17, 2012 19:48
Show Gist options
  • Select an option

  • Save anonymous/2945544 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/2945544 to your computer and use it in GitHub Desktop.
CameraSpaceProjection Multiply
Shader "Custom/NoiseCameraSpace" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Overlay ("Overlay (RGBA)",2D) = "clear" {}
}
SubShader {
Tags { "RenderType"="Opaque" }
LOD 200
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
sampler2D _Overlay;
struct Input {
float2 uv_MainTex;
float4 screenPos;
};
void surf (Input IN, inout SurfaceOutput o) {
half4 c = tex2D (_MainTex, IN.uv_MainTex);
half4 d = tex2D (_Overlay, IN.screenPos.xy/IN.screenPos.w);
c *= d;
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment