Bliss-Shader/shaders/deferred1.vsh

40 lines
1011 B
V Shell
Raw Normal View History

2023-01-12 15:00:14 -05:00
#version 120
2023-07-06 17:40:23 -04:00
#extension GL_EXT_gpu_shader4 : disable
2023-01-12 15:28:19 -05:00
#include "lib/settings.glsl"
flat varying vec3 averageSkyCol_Clouds;
2023-01-12 15:00:14 -05:00
flat varying vec3 sunColor;
flat varying vec3 moonColor;
flat varying float tempOffsets;
flat varying vec3 WsunVec;
uniform mat4 gbufferModelViewInverse;
uniform vec3 sunPosition;
uniform float sunElevation;
2023-01-12 15:00:14 -05:00
uniform sampler2D colortex4;
uniform int frameCounter;
2023-01-12 15:00:14 -05:00
#include "/lib/util.glsl"
#include "/lib/res_params.glsl"
2023-01-12 15:00:14 -05:00
void main() {
tempOffsets = HaltonSeq2(frameCounter%10000);
gl_Position = ftransform();
gl_Position.xy = (gl_Position.xy*0.5+0.5)*clamp(CLOUDS_QUALITY+0.01,0.0,1.0)*2.0-1.0;
2023-01-12 15:00:14 -05:00
#ifdef TAA_UPSCALING
gl_Position.xy = (gl_Position.xy*0.5+0.5)*RENDER_SCALE*2.0-1.0;
#endif
averageSkyCol_Clouds = texelFetch2D(colortex4,ivec2(1,37),0).rgb;
sunColor = texelFetch2D(colortex4,ivec2(6,37),0).rgb;
2023-01-12 15:00:14 -05:00
moonColor = texelFetch2D(colortex4,ivec2(13,37),0).rgb;
WsunVec = ( float(sunElevation > 1e-5)*2-1. )*normalize(mat3(gbufferModelViewInverse) *sunPosition);
2023-01-12 15:00:14 -05:00
}