skinned_flat_vertex_colours.glsl (678B)
1 #ifdef VERTEX_SHADER 2 3 in vec4 position; 4 in vec3 colour; 5 6 in uvec4 joints; 7 in vec4 weights; 8 9 out vec3 frag_colour; 10 11 layout( std140 ) uniform view { 12 mat4 V; 13 mat4 P; 14 }; 15 16 layout( std140 ) uniform model { 17 mat4 M; 18 }; 19 20 layout( std140 ) uniform animation { 21 mat4 joint_poses[ 100 ]; 22 }; 23 24 void main() { 25 mat4 skin = 26 weights.x * joint_poses[ joints.x ] + 27 weights.y * joint_poses[ joints.y ] + 28 weights.z * joint_poses[ joints.z ] + 29 weights.w * joint_poses[ joints.w ]; 30 31 gl_Position = P * V * M * skin * position; 32 frag_colour = colour; 33 } 34 35 #else 36 37 in vec3 frag_colour; 38 39 out vec4 screen_colour; 40 41 void main() { 42 screen_colour = vec4( linear_to_srgb( frag_colour ), 1.0 ); 43 } 44 45 #endif