Update code to use image textures

This commit is contained in:
2024-11-27 00:21:33 +00:00
parent ead49cfbea
commit 921324585f
3 changed files with 86 additions and 8 deletions

View File

@@ -1,9 +1,14 @@
#version 330 core
in vec3 vert_color;
in vec2 tex_coords;
out vec4 color;
uniform float mix_factor;
uniform sampler2D texture0;
uniform sampler2D texture1;
void main() {
color = vec4(vert_color, 1.0f);
color = mix(texture(texture0, tex_coords), texture(texture1, tex_coords), mix_factor);
};

View File

@@ -2,10 +2,13 @@
layout(location=0) in vec3 position;
layout(location=1) in vec3 color;
layout(location=2) in vec2 uv;
out vec3 vert_color;
out vec2 tex_coords;
void main() {
vert_color = color;
tex_coords = uv;
vert_color = color;
gl_Position = vec4(position, 1.0);
};