Skip to content

Instantly share code, notes, and snippets.

@sugi-cho
Last active August 29, 2015 14:12
Show Gist options
  • Save sugi-cho/155895d7eff5132da81a to your computer and use it in GitHub Desktop.
Save sugi-cho/155895d7eff5132da81a to your computer and use it in GitHub Desktop.
world position to frag matrix example
v2f vert(Input v) {
float4 posWorld = mul(_Object2World, v.vertex);
posWorld.xyz += _POS;
v2f o;
o.vertex = mul(UNITY_MATRIX_P, mul(UNITY_MATRIX_V, posWorld));
o.uv = v.uv;
return o;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment