Last active
February 1, 2019 09:32
-
-
Save ippan/aacdfa574228013d08fcb8e5793d5d5e to your computer and use it in GitHub Desktop.
Godot Billboard Shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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