/* Copyright (C) 2022 igoz * See end of file for extended copyright and license notice. */ Shader "Hidden/ColorBlindFiltering" { Properties { _MainTex ("", 2D) = "white" {} _Red ("", Color) = (1, 0, 0) _Green ("", Color) = (0, 1, 0) _Blue ("", Color) = (0, 0, 1) } SubShader { Cull Off ZWrite Off ZTest Always Lighting Off Fog { Mode Off } Pass { CGPROGRAM #pragma vertex vert_img #pragma fragment frag #include "UnityCG.cginc" sampler2D _MainTex; float4 _Red; float4 _Green; float4 _Blue; fixed4 frag(v2f_img i) : COLOR { fixed3 col = tex2D(_MainTex, i.uv); return fixed4( col.r * _Red.r + col.g * _Red.g + col.b * _Red.b, col.r * _Green.r + col.g * _Green.g + col.b * _Green.b, col.r * _Blue.r + col.g * _Blue.g + col.b * _Blue.b, 1); } ENDCG } } } /* Copyright (C) 2022 igoz * * This file is part of ColorBlindViewer. * * ColorBlindViewer is free software: you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) any * later version. * * ColorBlindViewer is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more * details. * * You should have received a copy of the GNU General Public License along with * ColorBlindViewer. If not, see . */