2023-01-12 15:00:14 -05:00
|
|
|
#version 120
|
2023-07-06 17:56:54 -04:00
|
|
|
//#extension GL_EXT_gpu_shader4 : disable
|
2023-04-16 16:18:26 -04:00
|
|
|
|
|
|
|
#include "/lib/settings.glsl"
|
|
|
|
|
2023-01-12 15:00:14 -05:00
|
|
|
varying vec2 texcoord;
|
|
|
|
|
2023-07-29 21:26:04 -04:00
|
|
|
// flat varying vec3 avgAmbient;
|
2023-04-16 16:18:26 -04:00
|
|
|
|
2023-01-12 15:00:14 -05:00
|
|
|
flat varying float tempOffsets;
|
|
|
|
flat varying vec2 TAA_Offset;
|
|
|
|
flat varying vec3 zMults;
|
|
|
|
|
|
|
|
uniform sampler2D colortex4;
|
|
|
|
|
|
|
|
uniform float far;
|
|
|
|
uniform float near;
|
|
|
|
uniform mat4 gbufferModelViewInverse;
|
|
|
|
uniform vec3 sunPosition;
|
|
|
|
uniform float rainStrength;
|
|
|
|
uniform float sunElevation;
|
|
|
|
uniform int frameCounter;
|
|
|
|
|
|
|
|
const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.),
|
|
|
|
vec2(-1.,3.)/8.,
|
|
|
|
vec2(5.0,1.)/8.,
|
|
|
|
vec2(-3,-5.)/8.,
|
|
|
|
vec2(-5.,5.)/8.,
|
|
|
|
vec2(-7.,-1.)/8.,
|
|
|
|
vec2(3,7.)/8.,
|
|
|
|
vec2(7.,-7.)/8.);
|
|
|
|
|
|
|
|
|
|
|
|
#include "/lib/util.glsl"
|
|
|
|
|
|
|
|
void main() {
|
|
|
|
gl_Position = ftransform();
|
|
|
|
texcoord = gl_MultiTexCoord0.xy;
|
|
|
|
|
|
|
|
tempOffsets = HaltonSeq2(frameCounter%10000);
|
2023-04-16 16:18:26 -04:00
|
|
|
|
2023-01-12 15:00:14 -05:00
|
|
|
TAA_Offset = offsets[frameCounter%8];
|
2023-04-16 16:18:26 -04:00
|
|
|
|
2023-01-12 15:00:14 -05:00
|
|
|
#ifndef TAA
|
2023-04-16 16:18:26 -04:00
|
|
|
TAA_Offset = vec2(0.0);
|
2023-01-12 15:00:14 -05:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2023-07-29 21:26:04 -04:00
|
|
|
// avgAmbient = texelFetch2D(colortex4,ivec2(0,37),0).rgb;
|
2023-01-12 15:00:14 -05:00
|
|
|
zMults = vec3((far * near)*2.0,far+near,far-near);
|
|
|
|
}
|