https://github.com/xjine/unity_billboardshader
These quads always show their faces to the camera.
https://github.com/xjine/unity_billboardshader
billboard shader unity
Last synced: about 1 year ago
JSON representation
These quads always show their faces to the camera.
- Host: GitHub
- URL: https://github.com/xjine/unity_billboardshader
- Owner: XJINE
- License: bsd-3-clause
- Created: 2023-04-29T21:11:22.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2023-04-29T21:19:09.000Z (about 3 years ago)
- Last Synced: 2025-02-08T22:28:20.681Z (over 1 year ago)
- Topics: billboard, shader, unity
- Language: ShaderLab
- Homepage:
- Size: 773 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Unity_BillboardShader

These quads always show their faces to the camera.
```hlsl
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;
}
```