COSC-3P98-Final-Project/include/shaders/chunk.vert

33 lines
672 B
GLSL
Raw Normal View History

#ifdef __cplusplus
#include <string>
std::string shader_chunk_vert = R"("
#version 300 es
precision mediump float;
layout (location = 0) in vec3 vertex;
2023-03-04 23:24:36 -05:00
layout (location = 1) in vec2 texture_coord;
2023-03-05 00:01:54 -05:00
layout (location = 2) in float texture_index;
2023-03-04 23:24:36 -05:00
out vec2 uv;
2023-03-05 00:01:54 -05:00
out float index;
uniform mat4 translation;
layout (std140) uniform StandardMatrices
{
mat4 projection;
mat4 view;
// projection view matrix
mat4 pvm;
2023-02-15 00:49:27 -05:00
// orthographic projection matrix
mat4 orthographic;
};
2023-03-04 23:24:36 -05:00
void main() {
2023-03-05 00:01:54 -05:00
index = texture_index;
gl_Position = projection * view * translation * vec4(vertex.x, vertex.y, vertex.z, 1.0);
2023-03-04 23:24:36 -05:00
uv = texture_coord;
}
")";
#endif