Quantcast
Channel: Questions in topic: "shader programming"
Viewing all articles
Browse latest Browse all 169

How do I set matte on an Unlit Shader?

$
0
0
How can I add a mat setting for this shader? Shader "Unlit/Customs/SpriteBlendColor" { Properties { [HideInInspector] [PerRendererData] _MainTex ("Texture", 2D) = "white" {} // _ColorMultiply ("Multiply", Color) = (1, 1, 1, 1) // _Glossiness ("Smoothness", Range(0,1)) = 0.5 Matlık ekleme için - Akın Deneme // _Metallic ("Metallic", Range(0,1)) = 0.0 } SubShader { Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "PreviewType"="Plane" "CanUseSpriteAtlas"="True" } Cull Off Lighting Off ZWrite Off Blend SrcAlpha OneMinusSrcAlpha Pass { CGPROGRAM #pragma vertex vert #pragma fragment frag #include "UnityCG.cginc" #include "PsBlendColor.cginc" struct appdata { float4 vertex : POSITION; float4 color : COLOR; float2 uv : TEXCOORD0; }; struct v2f { float4 vertex : SV_POSITION; float4 color : COLOR; float2 uv : TEXCOORD0; }; sampler2D _MainTex; float4 _MainTex_ST; float4 _Color; // half _Glossiness; half _Metallic; // float4 _ColorMultiply; v2f vert(appdata v) { v2f o; o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); o.color = v.color; // * _ColorMultiply; return o; } fixed4 frag(v2f i) : SV_Target { fixed4 col = tex2D(_MainTex, i.uv); // return col * _ColorMultiply; col.rgb = BlendColor(col.rgb, i.color); col.a *= i.color.a; // col = _Glossiness; Matlık ekleme için - Akın Deneme // col.rgb = _Metallic; return col; } ENDCG } } }

Viewing all articles
Browse latest Browse all 169

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>