evershade/Assets/Shaders/NoiseImageShader.shader

44 lines
997 B
Plaintext

Shader "Custom/NoiseShader"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_NoiseScale ("Noise Scale", Range(1, 100)) = 10
}
SubShader
{
Tags
{
"RenderType"="Opaque"
}
LOD 200
CGPROGRAM
#pragma surface surf Standard fullforwardshadows
sampler2D _MainTex;
half _NoiseScale;
struct Input
{
float2 uv_MainTex;
};
void surf(Input IN, inout SurfaceOutputStandard o)
{
// Base color from the main texture
half4 c = tex2D(_MainTex, IN.uv_MainTex);
// Generate noise
float noise = frac(sin(dot(IN.uv_MainTex * _NoiseScale, float2(12.9898, 78.233))) * 43758.5453);
// Apply noise to the color
c.rgb += noise * 0.1; // Adjust noise intensity here
o.Albedo = c.rgb;
o.Alpha = c.a;
}
ENDCG
}
FallBack "Diffuse"
}