Шейдеры для использования текстур
This commit is contained in:
parent
77c018f86c
commit
580ebd83fd
|
@ -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);
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue