45 lines
811 B
V Shell
Raw Permalink Normal View History

2023-10-07 22:18:20 -04:00
#include "/lib/settings.glsl"
flat varying vec2 TAA_Offset;
2023-10-07 22:18:20 -04:00
flat varying vec3 WsunVec;
uniform sampler2D colortex4;
uniform int frameCounter;
2023-10-07 22:18:20 -04:00
uniform float sunElevation;
uniform vec3 sunPosition;
uniform mat4 gbufferModelViewInverse;
2024-11-15 17:54:18 -05:00
flat varying vec3 zMults;
uniform float far;
uniform float near;
2023-10-07 22:18:20 -04:00
#include "/lib/util.glsl"
#include "/lib/res_params.glsl"
2023-10-07 22:18:20 -04:00
uniform int framemod8;
#include "/lib/TAA_jitter.glsl"
void main() {
gl_Position = ftransform();
2023-10-07 22:18:20 -04:00
WsunVec = (float(sunElevation > 1e-5)*2-1.)*normalize(mat3(gbufferModelViewInverse) * sunPosition);
2024-11-15 17:54:18 -05:00
zMults = vec3(1.0/(far * near),far+near,far-near);
#ifdef TAA
TAA_Offset = offsets[framemod8];
#else
TAA_Offset = vec2(0.0);
#endif
2023-10-07 22:18:20 -04:00
#ifdef TAA_UPSCALING
gl_Position.xy = (gl_Position.xy*0.5+0.5)*RENDER_SCALE*2.0-1.0;
#endif
}