Created
July 9, 2013 20:07
-
-
Save ZeroStride/5960795 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| in vec3 InPosition; | |
| in vec2 InTex0; | |
| out vec2 tex_coord0; | |
| out vec4 color0; | |
| uniform vec4 color; | |
| uniform mat4 object_to_screen; | |
| uniform vec2 frame_width_height; // vec2(frame_width, frame_height) | |
| uniform vec2 tex_width_height; // vec2(frame_width * num_animation_frames, frame_height * num_character_ids) | |
| uniform vec2 frame_character; // vec2(animation_frame_id / (num_animation_frames - 1), character_id / (num_character_ids - 1)) | |
| void main() | |
| { | |
| gl_Position = object_to_screen * vec4(InPosition, 1.0); | |
| tex_coord0 = (InTex0.xy * frame_width_height + frame_character * frame_width_height) / tex_width_height; | |
| color0 = color; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment