Bliss-Shader/shaders/dimensions/composite1.vsh

77 lines
1.7 KiB
V Shell
Raw Normal View History

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
2023-10-08 10:18:20 +08:00
flat varying vec3 WsunVec;
flat varying vec3 unsigned_WsunVec;
2023-10-08 10:18:20 +08:00
flat varying vec3 averageSkyCol_Clouds;
flat varying vec4 lightCol;
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-10-08 10:18:20 +08:00
// uniform float far;
uniform float near;
2023-10-08 10:18:20 +08:00
uniform mat4 gbufferModelViewInverse;
uniform vec3 sunPosition;
uniform float rainStrength;
uniform float sunElevation;
uniform int frameCounter;
uniform float frameTimeCounter;
2023-10-08 10:18:20 +08:00
uniform int framemod8;
#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
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;
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
exposure = texelFetch2D(colortex4,ivec2(10,37),0).r;
#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);
#endif
#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
}