Шейдеры для использования текстур

This commit is contained in:
parent 77c018f86c
commit 580ebd83fd
2 changed files with 11 additions and 2 deletions

View File

@ -1,8 +1,13 @@
#version 330 core
out vec3 color;
in vec2 texCoord;
uniform sampler2D tex_diffuse;
out vec4 color;
void main()
{
color = vec3(1, 0, 0);
color = texture(tex_diffuse, texCoord);
}

View File

@ -1,11 +1,15 @@
#version 330 core
layout(location = 0) in vec3 pos;
layout(location = 1) in vec2 inTexCoord;
uniform mat4 vp;
uniform mat4 model;
out vec2 texCoord;
void main()
{
gl_Position = vp * model * vec4(pos, 1.0);
texCoord = inTexCoord;
}