XJINE / Unity_BillboardShader

These quads always show their faces to the camera.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unity_BillboardShader

These quads always show their faces to the camera.

v2f vert (appdata_full v)
{
	v2f o;

	float3 vpos       = mul(unity_ObjectToWorld, v.vertex.xyz);
	float4 worldCoord = float4(unity_ObjectToWorld._m03_m13_m23, 1);
	float4 viewPos    = mul(UNITY_MATRIX_V, worldCoord) + float4(vpos, 0);

	o.vertex = mul(UNITY_MATRIX_P, viewPos);
	o.uv     = v.texcoord;

	return o;
}

About

These quads always show their faces to the camera.

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:ShaderLab 100.0%