SHADE_Y3/Assets/Shaders/Particle_FS.glsl

28 lines
548 B
Plaintext
Raw Normal View History

2023-03-13 11:41:23 +08:00
#version 460 core
2023-03-16 09:34:42 +08:00
#extension GL_EXT_nonuniform_qualifier : require
2023-03-13 11:41:23 +08:00
layout (location = 0) out vec4 fragColor;
2023-03-16 09:34:42 +08:00
layout (set = 0, binding = 1) uniform sampler2D textures[]; // for textures (global)
2023-03-13 11:41:23 +08:00
// between shader stages
layout(location = 0) in struct
{
vec2 uv; // location = 0
} In;
2023-03-16 09:34:42 +08:00
// material stuff
layout(location = 1) flat in struct
{
uint textureIndex;
vec4 color;
2023-03-16 09:34:42 +08:00
} InFlat;
2023-03-13 11:41:23 +08:00
void main ()
{
fragColor = vec4 (texture(textures [nonuniformEXT(InFlat.textureIndex)], In.uv)) * InFlat.color;
2023-03-16 09:34:42 +08:00
if (fragColor.a < 0.01f)
discard;
2023-03-13 11:41:23 +08:00
}