Shader"unlit/colorful"{Properties {_maintex ("Texture", 2D) =" White"{} _brightnessamount ("Brightness Amount", Range (0.0,2.0)) =1.0_saturationamount ("saturation Amount", Range (0.0,2.0)) =1.0_contrastamount ("contrast Amount", Range (0.0,2.0)) =1.0} subshader {Tags {"Rendertype"="Opaque"} LOD -Pass {Cgprogram#pragmaVertex vert#pragmaFragment Frag//Make fog work #pragmaMulti_compile_fog#include"Unitycg.cginc"sampler2d _maintex; FLOAT4 _maintex_st; fixed_brightnessamount; fixed_saturationamount; fixed_contrastamount; structAppData {float4 vertex:position; FLOAT2 uv:texcoord0; }; structv2f {float4 pos:sv_position; FLOAT2 uv:texcoord0; }; FLOAT3 contrastsaturationbrightness (float3 color,floatBrtfloatSatfloatcon) { //increase or decrease these values to//adjust R, G and B color channels separately floatAVGLUMR =0.5; floatAVGLUMG =0.5; floatAvglumb =0.5; //luminance coefficients for getting luminance from the imageFLOAT3 Luminancecoeff = FLOAT3 (0.2125,0.7154,0.0721); //Operation for BrightmessFLOAT3 Avglumin =float3 (AVGLUMR, AVGLUMG, Avglumb); FLOAT3 Brtcolor= Color *BRT; floatINTENSITYF =dot (Brtcolor, Luminancecoeff); FLOAT3 intensity=float3 (INTENSITYF, INTENSITYF, INTENSITYF); //operation for SaturationFLOAT3 Satcolor =lerp (intensity, brtcolor, Sat); //Operation for contrastFLOAT3 concolor =lerp (avglumin, Satcolor, con); returnconcolor; } v2f Vert (AppData v) {v2f o; O.pos=Mul (UNITY_MATRIX_MVP, V.vertex); O.uv=Transform_tex (V.UV, _maintex); returno; } fixed4 Frag (v2f i): sv_target {fixed4 col=tex2d (_maintex, I.UV); Col.rgb=contrastsaturationbrightness (col, _brightnessamount, _saturationamount, _contrastamount); returnCol; } ENDCG} }}
Shader color Adjustment: Hue, lightness, saturation, contrast