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

How can I add Color property To This Shader

$
0
0
I want to change the color of material. Texture is working But how can i add COLOR property to change material color. Thanks. Shader "Custom/Jelly" { Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } SubShader { Pass { Tags { "RenderType"="Opaque" } CGPROGRAM #pragma vertex vert #pragma fragment frag #include "UnityCG.cginc" sampler2D _MainTex; struct v2f { float4 pos : SV_POSITION; half2 uv : TEXCOORD0; }; v2f vert(appdata_base v) { v2f o; v.vertex.x += sign(v.vertex.x) * sin(_Time.w)/50; v.vertex.y += sign(v.vertex.y) * cos(_Time.w)/50; o.pos = UnityObjectToClipPos(v.vertex); o.uv = v.texcoord; return o; } half4 frag(v2f i) : COLOR { half4 c = tex2D(_MainTex, i.uv); return c; } ENDCG } } FallBack "Diffuse" }

Viewing all articles
Browse latest Browse all 169

Trending Articles



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