28 lines
548 B
GLSL
28 lines
548 B
GLSL
#version 460 core
|
|
#extension GL_EXT_nonuniform_qualifier : require
|
|
|
|
layout (location = 0) out vec4 fragColor;
|
|
|
|
layout (set = 0, binding = 1) uniform sampler2D textures[]; // for textures (global)
|
|
|
|
// between shader stages
|
|
layout(location = 0) in struct
|
|
{
|
|
vec2 uv; // location = 0
|
|
} In;
|
|
|
|
// material stuff
|
|
layout(location = 1) flat in struct
|
|
{
|
|
uint textureIndex;
|
|
vec4 color;
|
|
} InFlat;
|
|
|
|
|
|
void main ()
|
|
{
|
|
fragColor = vec4 (texture(textures [nonuniformEXT(InFlat.textureIndex)], In.uv)) * InFlat.color;
|
|
if (fragColor.a < 0.01f)
|
|
discard;
|
|
}
|