2023-10-08 10:18:20 +08:00
|
|
|
#include "/lib/settings.glsl"
|
|
|
|
#include "/lib/res_params.glsl"
|
|
|
|
|
2024-03-03 03:58:27 +08:00
|
|
|
#ifdef END_SHADER
|
|
|
|
flat varying float Flashing;
|
|
|
|
#endif
|
2023-10-08 10:18:20 +08:00
|
|
|
|
2024-11-16 06:54:18 +08:00
|
|
|
#ifdef Daily_Weather
|
|
|
|
flat varying vec4 dailyWeatherParams0;
|
|
|
|
flat varying vec4 dailyWeatherParams1;
|
|
|
|
#endif
|
|
|
|
|
2024-05-22 12:01:17 +08:00
|
|
|
|
2023-10-08 10:18:20 +08:00
|
|
|
flat varying vec3 WsunVec;
|
2024-05-05 09:08:24 +08:00
|
|
|
flat varying vec3 unsigned_WsunVec;
|
2023-10-08 10:18:20 +08:00
|
|
|
flat varying vec3 averageSkyCol_Clouds;
|
|
|
|
flat varying vec4 lightCol;
|
2023-08-03 12:23:29 +08:00
|
|
|
|
2024-05-05 09:08:24 +08:00
|
|
|
flat varying float exposure;
|
|
|
|
|
2023-10-08 10:18:20 +08:00
|
|
|
flat varying vec2 TAA_Offset;
|
|
|
|
flat varying vec3 zMults;
|
|
|
|
uniform sampler2D colortex4;
|
2023-08-03 12:23:29 +08:00
|
|
|
|
2023-10-08 10:18:20 +08:00
|
|
|
// uniform float far;
|
|
|
|
uniform float near;
|
2024-03-02 11:48:09 +08:00
|
|
|
|
2023-10-08 10:18:20 +08:00
|
|
|
uniform mat4 gbufferModelViewInverse;
|
|
|
|
uniform vec3 sunPosition;
|
|
|
|
uniform float rainStrength;
|
|
|
|
uniform float sunElevation;
|
2023-08-03 12:23:29 +08:00
|
|
|
uniform int frameCounter;
|
2023-10-15 11:34:52 +08:00
|
|
|
uniform float frameTimeCounter;
|
2023-08-03 12:23:29 +08:00
|
|
|
|
2023-10-08 10:18:20 +08:00
|
|
|
uniform int framemod8;
|
2024-07-07 09:03:31 +08:00
|
|
|
#include "/lib/TAA_jitter.glsl"
|
|
|
|
|
2023-01-13 04:00:14 +08:00
|
|
|
|
2023-10-08 10:18:20 +08:00
|
|
|
|
|
|
|
#include "/lib/util.glsl"
|
|
|
|
#include "/lib/Shadow_Params.glsl"
|
2023-01-13 04:00:14 +08:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
gl_Position = ftransform();
|
|
|
|
|
2024-03-03 03:58:27 +08:00
|
|
|
#ifdef END_SHADER
|
|
|
|
Flashing = texelFetch2D(colortex4,ivec2(1,1),0).x/150.0;
|
|
|
|
#endif
|
2023-10-08 10:18:20 +08:00
|
|
|
|
2024-03-02 11:48:09 +08:00
|
|
|
zMults = vec3(1.0/(far * near),far+near,far-near);
|
2023-10-08 10:18:20 +08:00
|
|
|
|
|
|
|
lightCol.rgb = texelFetch2D(colortex4,ivec2(6,37),0).rgb;
|
|
|
|
lightCol.a = float(sunElevation > 1e-5)*2.0 - 1.0;
|
|
|
|
|
|
|
|
averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
|
|
|
|
|
2024-05-05 09:08:24 +08:00
|
|
|
unsigned_WsunVec = normalize(mat3(gbufferModelViewInverse) * sunPosition);
|
2024-11-16 06:54:18 +08:00
|
|
|
WsunVec = lightCol.a*unsigned_WsunVec;
|
2023-10-08 10:18:20 +08:00
|
|
|
|
2024-05-05 09:08:24 +08:00
|
|
|
exposure = texelFetch2D(colortex4,ivec2(10,37),0).r;
|
2024-05-22 12:01:17 +08:00
|
|
|
|
|
|
|
#if defined Daily_Weather
|
2024-11-16 06:54:18 +08:00
|
|
|
dailyWeatherParams0 = vec4(texelFetch2D(colortex4,ivec2(1,1),0).rgb / 1500.0, 0.0);
|
|
|
|
dailyWeatherParams1 = vec4(texelFetch2D(colortex4,ivec2(2,1),0).rgb / 1500.0, 0.0);
|
2024-05-22 12:01:17 +08:00
|
|
|
#endif
|
|
|
|
|
2024-03-02 11:48:09 +08:00
|
|
|
#ifdef TAA
|
|
|
|
TAA_Offset = offsets[framemod8];
|
|
|
|
#else
|
|
|
|
TAA_Offset = vec2(0.0);
|
|
|
|
#endif
|
2023-10-08 10:18:20 +08:00
|
|
|
|
|
|
|
#ifdef TAA_UPSCALING
|
|
|
|
gl_Position.xy = (gl_Position.xy*0.5+0.5)*RENDER_SCALE*2.0-1.0;
|
|
|
|
#endif
|
2023-01-13 04:00:14 +08:00
|
|
|
}
|