feat: add colors to vao and shaders
This commit is contained in:
@@ -2,20 +2,8 @@
|
||||
|
||||
out layout(location=0) vec4 color;
|
||||
in vec4 gl_FragCoord;
|
||||
in vec4 vColor;
|
||||
|
||||
void main() {
|
||||
vec4 b = vec4(0.0f,0.0f,0.0f,0.0f);
|
||||
vec4 w = vec4(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
float square_size = 128.0f;
|
||||
bool x = mod(gl_FragCoord.x, square_size) < square_size / 2.0f;
|
||||
bool y = mod(gl_FragCoord.y, square_size) < square_size / 2.0f;
|
||||
if (x && y) {
|
||||
color = b;
|
||||
} else if (x && !y) {
|
||||
color = w;
|
||||
} else if (!x && y) {
|
||||
color = w;
|
||||
} else if (!x && !y) {
|
||||
color = b;
|
||||
}
|
||||
color = vColor;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
#version 460 core
|
||||
|
||||
in layout(location=0) vec3 position;
|
||||
in layout(location=1) vec4 aColor;
|
||||
out vec4 vColor;
|
||||
|
||||
void main() {
|
||||
gl_Position = vec4(position, 1.0f);
|
||||
vColor = aColor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user