diff options
Diffstat (limited to 'Assets/ThirdParty/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_DesaturateNode.shader')
-rw-r--r-- | Assets/ThirdParty/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_DesaturateNode.shader | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Assets/ThirdParty/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_DesaturateNode.shader b/Assets/ThirdParty/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_DesaturateNode.shader new file mode 100644 index 00000000..1bc967fa --- /dev/null +++ b/Assets/ThirdParty/AmplifyShaderEditor/Plugins/EditorResources/Previews/Preview_DesaturateNode.shader @@ -0,0 +1,34 @@ +Shader "Hidden/DesaturateNode" +{ + Properties + { + _A ( "_RBG", 2D ) = "white" {} + _B ( "_Fraction", 2D ) = "white" {} + } + + SubShader + { + Pass + { + CGPROGRAM + #include "UnityCG.cginc" + #pragma vertex vert_img + #pragma fragment frag + + uniform sampler2D _A; + uniform sampler2D _B; + + float4 frag ( v2f_img i ) : SV_Target + { + float3 rgb = tex2D ( _A, i.uv ).rgb; + float fraction = tex2D ( _B, i.uv ).r; + + float dotResult = dot ( rgb, float3( 0.299, 0.587, 0.114 ) ); + float3 finalColor = lerp ( rgb, dotResult.xxx, fraction ); + + return float4( finalColor, 1 ); + } + ENDCG + } + } +} |