Hey,
I have a shader to billboard a plane, it’s working great except it doesn’t support scaling.
here’s the vertex shader:
v2f vert (appdata v)
{
v2f o;
//Scale support but breaks position...
//v.vertex = mul (_Object2World, v.vertex);
o.pos = mul(UNITY_MATRIX_P,
mul(UNITY_MATRIX_MV, float4(0.0, 0.0, 0.0, 1.0)) - float4(v.vertex.x, v.vertex.y, 0.0, 0.0));
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
I made some support for the scale using v.vertex = mul (_Object2World, v.vertex); but it breaks the positon in x and y.
any help would be great!
Thanks.