diff --git a/assets/models/chess.mtl b/assets/models/chess.mtl index 6c4cb69..284b24b 100644 --- a/assets/models/chess.mtl +++ b/assets/models/chess.mtl @@ -1,12 +1,12 @@ -# Blender 5.2.0 LTS MTL File: 'chess.blend' +# Blender 5.2.0 LTS MTL File: 'None' # www.blender.org newmtl Material.002 Ns 735.817688 Ka 1.000000 1.000000 1.000000 -Kd 0.800000 0.800000 0.800000 Ks 0.500000 0.500000 0.500000 Ke 0.000000 0.000000 0.000000 Ni 1.450000 d 1.000000 illum 2 +map_Kd chess_blue.png diff --git a/assets/shaders/basic.frag b/assets/shaders/basic.frag index 2050c7a..dd4314c 100644 --- a/assets/shaders/basic.frag +++ b/assets/shaders/basic.frag @@ -1,7 +1,10 @@ #version 460 core +in vec2 pass_textureCoords; + +uniform sampler2D textureSampler; out vec4 fragColor; void main() { - fragColor = vec4(1.0, 0.5, 0.2, 1.0); + fragColor = texture(textureSampler, pass_textureCoords); } \ No newline at end of file diff --git a/assets/shaders/basic.vert b/assets/shaders/basic.vert index 9717514..af2015c 100644 --- a/assets/shaders/basic.vert +++ b/assets/shaders/basic.vert @@ -1,11 +1,19 @@ #version 460 core layout(location = 0) in vec3 position; +layout(location = 1) in vec3 normal; +layout(location = 2) in vec2 textureCoords; uniform mat4 transformationMatrix; uniform mat4 projectionMatrix; uniform mat4 viewMatrix; +out vec2 pass_textureCoords; +out vec3 surfaceNormal; + void main() { vec4 worldPosition = transformationMatrix * vec4(position, 1.0f); gl_Position = projectionMatrix * viewMatrix * worldPosition; + pass_textureCoords = textureCoords; + + surfaceNormal = (transformationMatrix * vec4(normal , 0.f)).xyz; } \ No newline at end of file