2021-01-18 08:13:52 +00:00
|
|
|
#version 450
|
2024-01-20 10:42:28 +00:00
|
|
|
#extension GL_GOOGLE_include_directive : enable
|
|
|
|
|
|
|
|
#include "fog.finc"
|
2021-01-18 08:13:52 +00:00
|
|
|
|
2023-07-02 10:58:56 +00:00
|
|
|
layout (set = 3, binding = 0) uniform sampler2DArray Texture;
|
2024-01-16 02:02:29 +00:00
|
|
|
layout (set = 4, binding = 0) uniform sampler2D Lightmap;
|
2021-01-18 08:13:52 +00:00
|
|
|
|
|
|
|
layout (push_constant) uniform PushConstants {
|
|
|
|
vec4 fog;
|
2021-01-23 14:58:34 +00:00
|
|
|
float time;
|
2022-05-21 08:48:45 +00:00
|
|
|
float alpha;
|
2021-01-18 08:13:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
layout (location = 0) in vec4 tl_st;
|
2021-01-19 16:25:54 +00:00
|
|
|
layout (location = 1) in vec3 direction;
|
2023-07-02 10:58:56 +00:00
|
|
|
layout (location = 2) in vec3 normal;
|
|
|
|
layout (location = 3) in vec4 position;
|
|
|
|
layout (location = 4) in vec4 color;
|
2021-01-18 08:13:52 +00:00
|
|
|
|
|
|
|
layout (location = 0) out vec4 frag_color;
|
|
|
|
|
|
|
|
void
|
|
|
|
main (void)
|
|
|
|
{
|
2023-07-02 10:58:56 +00:00
|
|
|
vec3 t_st = vec3 (tl_st.xy, 0);
|
|
|
|
vec3 e_st = vec3 (tl_st.xy, 1);
|
|
|
|
vec2 l_st = vec2 (tl_st.zw);
|
|
|
|
|
|
|
|
vec4 c = texture (Texture, t_st) * color;
|
|
|
|
vec4 e = texture (Texture, e_st);
|
2024-01-16 02:02:29 +00:00
|
|
|
vec4 l = texture (Lightmap, l_st);
|
2021-01-18 08:13:52 +00:00
|
|
|
|
2024-01-20 10:42:28 +00:00
|
|
|
frag_color = FogBlend (c * l + e, fog);
|
2021-01-18 08:13:52 +00:00
|
|
|
}
|