blob: 1d9347181388b2a3a2c536091a2ae7cd7ff999be (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#type vertex
#version 330 core
layout(location = 0) in vec3 pos;
layout(location = 1) in vec4 color;
layout(location = 2) in vec2 texcoord;
out Vertex2Fragmnet {
vec4 color;
vec2 texcoord;
} v2f;
// Autofill uniforms
uniform mat4 transformation;
void main() {
gl_Position = transformation * vec4(pos, 1.0);
v2f.color = color;
v2f.texcoord = texcoord;
}
#type fragment
#version 330 core
in Vertex2Fragmnet {
vec4 color;
vec2 texcoord;
} v2f;
out vec4 fragColor;
// Material uniforms
uniform sampler2D textureAtlas;
uniform vec4 taint;
void main() {
fragColor = texture(textureAtlas, v2f.texcoord) * v2f.color * taint;
}
|