Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "PBRMaskTint"
- {
- Properties
- {
- _MainTex("Albedo", 2D) = "white" {}
- _Mask("Mask", 2D) = "white" {}
- _NormalMap("Normal", 2D) = "bump" {}
- _Metallic("SAM", 2D) = "white" {}
- _ColorTint1("Color01", Color) = (0,0.1394524,0.8088235,0)
- _ColorTint2("Color02", Color) = (0.4557808,0,0.6176471,0)
- _ColorTint3("Color03", Color) = (0.4557808,0,0.6176471,0)
- _Color01Power("Color01Power", Range( 0 , 2)) = 1
- _Color02Power("Color02Power", Range( 0 , 4)) = 2
- _Color03Power("Color03Power", Range( 0 , 2)) = 1
- _Brightness("Brightness", Range( 0 , 4)) = 1
- [HideInInspector] _texcoord( "", 2D ) = "white" {}
- [HideInInspector] __dirty( "", Int ) = 1
- }
- SubShader
- {
- Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+0" }
- Cull Back
- CGPROGRAM
- #pragma target 3.0
- #pragma surface surf Standard keepalpha addshadow fullforwardshadows
- struct Input
- {
- float2 uv_texcoord;
- };
- uniform sampler2D _NormalMap;
- uniform float4 _NormalMap_ST;
- uniform sampler2D _MainTex;
- uniform float4 _MainTex_ST;
- uniform sampler2D _Mask;
- uniform float4 _Mask_ST;
- uniform float4 _ColorTint1;
- uniform float _Color01Power;
- uniform float4 _ColorTint2;
- uniform float _Color02Power;
- uniform float4 _ColorTint3;
- uniform float _Color03Power;
- uniform float _Brightness;
- uniform sampler2D _Metallic;
- uniform float4 _Metallic_ST;
- void surf( Input i , inout SurfaceOutputStandard o )
- {
- float2 uv_Normal = i.uv_texcoord * _NormalMap_ST.xy + _NormalMap_ST.zw;
- o.Normal = UnpackNormal( tex2D( _NormalMap, uv_Normal ) );
- float2 uv_Albedo = i.uv_texcoord * _MainTex_ST.xy + _MainTex_ST.zw;
- float4 tex2DNode2 = tex2D( _MainTex, uv_Albedo );
- float2 uv_Mask = i.uv_texcoord * _Mask_ST.xy + _Mask_ST.zw;
- float4 tex2DNode5 = tex2D( _Mask, uv_Mask );
- float4 temp_cast_0 = (tex2DNode5.r).xxxx;
- float4 temp_cast_1 = (tex2DNode5.g).xxxx;
- float4 temp_cast_2 = (tex2DNode5.b).xxxx;
- float4 blendOpSrc20 = tex2DNode2;
- float4 blendOpDest20 = ( ( min( temp_cast_0 , _ColorTint1 ) * _Color01Power ) + ( min( temp_cast_1 , _ColorTint2 ) * _Color02Power ) + ( min( temp_cast_2 , _ColorTint3 ) * _Color03Power ) );
- float4 lerpResult19 = lerp( tex2DNode2 , ( ( saturate( ( blendOpSrc20 * blendOpDest20 ) )) * _Brightness ) , ( tex2DNode5.r + tex2DNode5.g + tex2DNode5.b ));
- o.Albedo = lerpResult19.rgb;
- float2 uv_SAM = i.uv_texcoord * _Metallic_ST.xy + _Metallic_ST.zw;
- float4 tex2DNode4 = tex2D( _Metallic, uv_SAM );
- o.Metallic = tex2DNode4.b;
- o.Smoothness = 0.5;// tex2DNode4.r;
- o.Occlusion = 1;//tex2DNode4.g;
- o.Alpha = 1;
- }
- ENDCG
- }
- Fallback "Diffuse"
- //CustomEditor "ASEMaterialInspector"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement