You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lunarium_OLD/src/renderer/shaders/quad.vert

26 lines
769 B
GLSL

#version 450 core
layout(location = 0) in vec3 pos;
layout(location = 1) in vec2 tex_coords;
layout(location = 2) in vec4 color;
layout(location = 3) in int tex_slot;
layout(location = 4) in vec3 translation;
layout(location = 5) in float angle;
layout(location = 6) in vec3 scale;
//out vec2 TexCoords;
out vec4 vert_color;
uniform mat4 projview;
void main()
{
vert_color = color;
mat4 ModelTrans = mat4(
vec4( scale.x * cos(angle), scale.x * -sin(angle), 0.0, 0.0),
vec4( scale.y * sin(angle), scale.y * cos(angle), 0.0, 0.0),
vec4( 0.0, 0.0, scale.z, 0.0),
vec4( translation.xyz, 1.0)
);
gl_Position = projview * ModelTrans * vec4(pos, 1.0);
}