验证中...
本周日(5月27日)码云企业技术分享会【微服务】专场将与你相约上海。阿里、华为、ThoughtWorks的技术大咖齐聚,等你来撩!
Gray.shader
原始数据 复制代码
Shader "Custom/Gray"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
_Alpha ("Alpha", Range(0, 1)) = 1
_Contrast ("Contrast", Range(0, 2)) = 1
}
SubShader
{
Tags { "RenderType"="Opaque" }
LOD 200
Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma surface surf Lambert
sampler2D _MainTex;
half _Alpha;
fixed _Contrast;
struct Input
{
float2 uv_MainTex;
};
void surf (Input IN, inout SurfaceOutput o)
{
half4 c = tex2D (_MainTex, IN.uv_MainTex);
o.Albedo = dot(c.rgb, float3(0.299, 0.587, 0.114));
o.Alpha = _Alpha;
// 对比度
float3 avgLumin = float3(0.5, 0.5, 0.5);
o.Albedo = lerp(avgLumin, o.Albedo, _Contrast);
}
ENDCG
}
FallBack "Diffuse"
}

评论列表( 0 )

你可以在登录后,发表评论

9_float_left_people 9_float_left_close