This commit is contained in:
Adrien Bourmault 2023-01-26 02:04:56 +01:00
parent 9f3d83af65
commit e96f339cf4
No known key found for this signature in database
GPG Key ID: 6EB408FE0ACEC664
3 changed files with 24 additions and 10 deletions

View File

@ -35,8 +35,8 @@
#include "../../include/base.h"
#include "../../include/ui.h"
#define VERTEX_SHADER_FILE "data/shader.vert"
#define FRAG_SHADER_FILE "data/shader.frag"
#define VERTEX_SHADER_FILE "src/shaders/shader.vert"
#define FRAG_SHADER_FILE "src/shaders/shader.frag"
/* -------------------------------------------------------------------------- */

View File

@ -1,7 +1,9 @@
uniform vec2 resolution;
#version 330 core
void main()
in vec4 color;
out vec4 out_frag_color;
void main(void)
{
gl_FragColor = vec4(gl_FragCoord.x / resolution.x,1,1,1);
out_frag_color = color;
}

View File

@ -1,4 +1,16 @@
void main()
#version 330 core
uniform mat4 projection_matrix;
uniform mat4 model_matrix;
uniform mat4 view_matrix;
layout(location=0) in vec3 in_position;
layout(location=1) in vec3 in_color;
out vec4 color;
void main(void)
{
gl_Position = ftransform();
gl_Position = projection_matrix * view_matrix * model_matrix * vec4(in_position, 1);
color = vec4(1 * in_color.rgb, 1);
}