Skip to content

Instantly share code, notes, and snippets.

@Nihlus
Created January 26, 2019 15:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nihlus/5ccd92255d53c1c73b2b886e141e1b1f to your computer and use it in GitHub Desktop.
Save Nihlus/5ccd92255d53c1c73b2b886e141e1b1f to your computer and use it in GitHub Desktop.
vec3 ProjectToScreen(mat3 viewportMatrix, vec4 clipSpaceCoordinate)
{
vec3 NDC = clipSpaceCoordinate.xyz / clipSpaceCoordinate.w;
return viewportMatrix * NDC;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment