Skip to content

Instantly share code, notes, and snippets.

@ippan
Last active February 1, 2019 09:32
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 ippan/aacdfa574228013d08fcb8e5793d5d5e to your computer and use it in GitHub Desktop.
Save ippan/aacdfa574228013d08fcb8e5793d5d5e to your computer and use it in GitHub Desktop.
Godot Billboard Shader
// billboard
MODELVIEW_MATRIX = INV_CAMERA_MATRIX * mat4(CAMERA_MATRIX[0], CAMERA_MATRIX[1], CAMERA_MATRIX[2], WORLD_MATRIX[3]);
// scale
MODELVIEW_MATRIX = MODELVIEW_MATRIX * mat4(vec4(length(WORLD_MATRIX[0].xyz), 0, 0, 0), vec4(0, length(WORLD_MATRIX[1].xyz), 0, 0), vec4(0, 0, length(WORLD_MATRIX[2].xyz), 0), vec4(0, 0, 0, 1));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment