2023-02-12 15:25:52 -05:00
|
|
|
#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;
|
2023-02-12 15:25:52 -05:00
|
|
|
|
2023-02-13 16:30:01 -05:00
|
|
|
uniform mat4 translation;
|
|
|
|
|
2023-02-12 15:25:52 -05:00
|
|
|
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-02-12 15:25:52 -05:00
|
|
|
};
|
|
|
|
|
2023-03-04 23:24:36 -05:00
|
|
|
void main() {
|
2023-03-05 00:01:54 -05:00
|
|
|
index = texture_index;
|
2023-02-13 16:30:01 -05:00
|
|
|
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;
|
2023-02-12 15:25:52 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
")";
|
|
|
|
#endif
|