Hi! I want to be able to display a lot of simple objects in the scene (2000-5000) so I am in the need of a very fast shader. I searched the forums and found the most simplest vertex shader:
Shader "Vertex Colors" {
Properties {
}
SubShader {
Tags { "RenderType"="Opaque" "Queue"="Geometry" }
Pass {
CGPROGRAM
#include "UnityCG.cginc"
#pragma vertex vert
#pragma fragment frag
struct v2f
{
fixed4 color : COLOR;
half4 pos : SV_POSITION;
};
v2f vert(appdata_full v)
{
v2f o;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
o.color = v.color;
return o;
}
fixed4 frag(v2f In) : COLOR
{
fixed4 c = fixed4(0,0,1,1);
c.rgb *= In.color.rgb;
return c;
}
ENDCG
}
}
}
I need some help in exposing color property for this shader. I don’t have much knowledge about shader scripting but I reckon it shouldn’t be that hard to do for someone experienced! Thanks!