gedeng/Shader/particle_render.fs

20 lines
521 B
GLSL

#version 430
layout (binding = 0) uniform sampler2D texture1;
layout (binding = 1) uniform sampler2D texture2;
layout (binding = 2) uniform sampler2D texture3;
smooth in vec2 tex_coords;
flat in vec4 color_part;
in float type;
out vec4 FragColor;
void main()
{
FragColor = texture2D(texture1, tex_coords) * color_part * float(abs(type - 1.0) < 0.1)
+ texture2D(texture2, tex_coords) * color_part * float(abs(type - 2.0) < 0.1)
+ texture2D(texture3, tex_coords) * color_part * float(abs(type - 3.0) < 0.1);
}