34 lines
688 B
GLSL
34 lines
688 B
GLSL
// #type vertex
|
|
#version 460 core
|
|
|
|
uniform mat4 uProjectionMatrix;
|
|
uniform mat4 uViewMatrix;
|
|
|
|
layout (location = 0) in vec3 aPos;
|
|
layout (location = 1) in vec3 aNormal;
|
|
layout (location = 2) in vec2 aTexCoords;
|
|
layout (location = 3) in mat4 aModelMatrix;
|
|
|
|
layout (location = 0) out vec2 oTexCoords;
|
|
|
|
void main()
|
|
{
|
|
gl_Position = uProjectionMatrix * uViewMatrix * aModelMatrix * vec4(aPos, 1.0);
|
|
oTexCoords = aTexCoords;
|
|
}
|
|
|
|
// #type fragment
|
|
#version 460 core
|
|
|
|
uniform sampler2D uTexture;
|
|
|
|
layout (location = 0) in vec2 iTexCoords;
|
|
|
|
layout (location = 0) out vec4 FragColor;
|
|
|
|
void main()
|
|
{
|
|
FragColor = texture(uTexture, iTexCoords);
|
|
if (FragColor.a == 0.0)
|
|
discard;
|
|
} |