basic textures

This commit is contained in:
2025-11-25 16:15:40 +00:00
parent 47a10623a1
commit bb7a3bafd2
17 changed files with 12154 additions and 10 deletions

View File

@@ -1,8 +1,11 @@
#version 330 core
out vec4 FragColor;
in vec3 color; // Input color from the vertex shader
in vec3 Color; // Input color from the vertex shader
in vec2 TexCoord; // Input texture coordinate from the vertex shader
uniform sampler2D Texture1;
void main() {
FragColor = vec4(color, 1.0); // Apply the color directly
FragColor = texture(Texture1, TexCoord);
}

View File

@@ -3,7 +3,8 @@
layout(location = 0) in vec3 position; // Vertex position
layout(location = 1) in vec3 normal; // Vertex normal
layout(location = 2) in vec2 texCoord; // Vertex texture coordinate
out vec3 color; // Output color to the fragment shader
out vec3 Color; // Output color to the fragment shader
out vec2 TexCoord; // Output texture coordinate to the fragment shader
uniform mat4 model;
uniform mat4 view;
@@ -11,5 +12,6 @@ uniform mat4 projection;
void main() {
gl_Position = projection * view * model * vec4(position, 1.0); // Apply transformation matrices
color = vec3(1.0, 0.5, 0.2); // Set output color (orange)
Color = normal * 0.5 + 0.5; // Simple coloring based on normal
TexCoord = texCoord; // Pass through the texture coordinate
}