fixed4 col = tex2D(_MainTex, i.uv);
亮度 _Brightness
//亮度直接叠加 fixed3 color = col.rgb*_Brightness;
饱和度 _Saturation
//饱和度=最低灰度颜色与原图的差值 fixed3 gray = fixed3(0.2125, 0.7154, 0.0721); fixed minGray = dot(gray, col.rgb); fixed3 grayColor = fixed3(minGray, minGray, minGray); color = lerp(grayColor, color, _Saturation);
对比度 _Contrast
//对比度=最低对比度图像(0.5,0.5,0.5)与原图的差值 fixed3 minContrast = fixed3(0.5, 0.5, 0.5); color = lerp(minContrast, color, _Contrast);
文章评论