DOUBLE LAYER CLOUDS TEST 4. a few tweaks to the sky. fixed auto-exposure. fixed water glowing in dark places. fixed RP skies glowing.

This commit is contained in:
Xonk
2023-12-11 16:12:25 -05:00
parent 3893c87607
commit d0c2712da0
12 changed files with 44 additions and 59 deletions

View File

@ -633,8 +633,7 @@ void main() {
#endif
#endif
Background *= clamp( (feetPlayerPos_normalized.y+ 0.02)*5.0 + (eyeAltitude - 319)/800000 ,0.0,1.0);
Background *= exp(-25.0 * pow(clamp(-feetPlayerPos_normalized.y*5.0 + 0.5 ,0.0,1.0),2.0)); // darken the ground in the sky.
vec3 Sky = skyFromTex(feetPlayerPos_normalized, colortex4)/30.0;
Background += Sky;

View File

@ -135,6 +135,5 @@ void main() {
col = LinearTosRGB(clamp(col * ACESOutputMat, 0.0, 1.0));
#endif
gl_FragData[0].rgb = clamp(int8Dither(col,texcoord),0.0,1.0);
}

View File

@ -18,7 +18,7 @@ void main() {
gl_Position = ftransform();
texcoord = gl_MultiTexCoord0.xy;
exposure=vec4(texelFetch2D(colortex4,ivec2(10,37),0).r*vec3(FinalR,FinalG,FinalB),texelFetch2D(colortex4,ivec2(10,37),0).r);
exposure = vec4(texelFetch2D(colortex4,ivec2(10,37),0).r*vec3(FinalR,FinalG,FinalB),texelFetch2D(colortex4,ivec2(10,37),0).r);
rodExposureDepth = texelFetch2D(colortex4,ivec2(14,37),0).rg;
rodExposureDepth.y = sqrt(rodExposureDepth.y/65000.0);;
rodExposureDepth.y = sqrt(rodExposureDepth.y/65000.0);
}

View File

@ -29,11 +29,11 @@ const bool colortex6Clear = false;
const bool colortex7Clear = false;
const bool colortex8Clear = false;
const bool colortex9Clear = true;
const bool colortex10Clear = false;
const bool colortex10Clear = true;
const bool colortex11Clear = true;
const bool colortex12Clear = false;
const bool colortex13Clear = false;
const bool colortex14Clear = false;
const bool colortex14Clear = true;
const bool colortex15Clear = false;
#ifdef SCREENSHOT_MODE

View File

@ -27,9 +27,9 @@ void main() {
vec2 resScale = max(vec2(viewWidth,viewHeight),vec2(1920.0,1080.))/vec2(1920.,1080.);
vec2 quarterResTC = gl_FragCoord.xy*2.0*resScale*texelSize;
vec2 texcoord = (gl_FragCoord.xy*2.0*resScale*texelSize) * RENDER_SCALE;
// vec2 texcoord = (gl_FragCoord.xy*2.0*resScale*texelSize) * RENDER_SCALE;
bool hand = abs(decodeVec2(texture2D(colortex1,texcoord).w).y-0.75) < 0.01 && texture2D(depthtex0,texcoord).x < 1.0;
// bool hand = abs(decodeVec2(texture2D(colortex1,texcoord).w).y-0.75) < 0.01 && texture2D(depthtex0,texcoord).x < 1.0;
//0.5
gl_FragData[0] = texture2D(colortex5,quarterResTC-1.0*vec2(texelSize.x,texelSize.y))/4.*0.5;
@ -53,6 +53,6 @@ bool hand = abs(decodeVec2(texture2D(colortex1,texcoord).w).y-0.75) < 0.01 && te
gl_FragData[0] += texture2D(colortex5,quarterResTC)*0.125;
gl_FragData[0].rgb = clamp(gl_FragData[0].rgb,0.0,65000.);
if (hand || quarterResTC.x > 1.0 - 3.5*texelSize.x || quarterResTC.y > 1.0 -3.5*texelSize.y || quarterResTC.x < 3.5*texelSize.x || quarterResTC.y < 3.5*texelSize.y) gl_FragData[0].rgb = vec3(0.0);
if (quarterResTC.x > 1.0 - 3.5*texelSize.x || quarterResTC.y > 1.0 -3.5*texelSize.y || quarterResTC.x < 3.5*texelSize.x || quarterResTC.y < 3.5*texelSize.y) gl_FragData[0].rgb = vec3(0.0);
}

View File

@ -168,10 +168,13 @@ if (gl_FragCoord.x > 18.+257. && gl_FragCoord.y > 1. && gl_FragCoord.x < 18+257+
vec3 viewVector = cartToSphere(p);
vec3 sky = texelFetch2D(colortex4,ivec2(gl_FragCoord.xy)-ivec2(257,0),0).rgb/150.0;
vec3 suncol = sunColor;
#ifdef ambientLight_only
suncol = vec3(0.0);
#endif
// if(viewVector.y < -0.025) sky = sky * clamp( exp(viewVector.y) - 1.0,0.25,1.0) ;
vec4 clouds = renderClouds(mat3(gbufferModelView)*viewVector*1024.,vec2(fract(frameCounter/1.6180339887),1-fract(frameCounter/1.6180339887)), sunColor, moonColor, skyGroundCol/30.0);
vec4 clouds = renderClouds(mat3(gbufferModelView)*viewVector*1024.,vec2(fract(frameCounter/1.6180339887),1-fract(frameCounter/1.6180339887)), suncol, moonColor, skyGroundCol/30.0);
sky = sky*clouds.a + clouds.rgb / 5.0;
vec4 VL_Fog = GetVolumetricFog(mat3(gbufferModelView)*viewVector*1024., fract(frameCounter/1.6180339887), lightSourceColor*1.75, skyGroundCol/30.0);
@ -278,7 +281,7 @@ gl_FragData[0].rgb = clamp(mix(temp, curr, mixhistory),0.0,65000.);
//Exposure values
if (gl_FragCoord.x > 10. && gl_FragCoord.x < 11. && gl_FragCoord.y > 19.+18. && gl_FragCoord.y < 19.+18.+1 )
gl_FragData[0] = vec4(exposure,avgBrightness,avgL2,1.0);
gl_FragData[0] = vec4(exposure, avgBrightness, avgL2,1.0);
if (gl_FragCoord.x > 14. && gl_FragCoord.x < 15. && gl_FragCoord.y > 19.+18. && gl_FragCoord.y < 19.+18.+1 )
gl_FragData[0] = vec4(rodExposure,centerDepth,0.0, 1.0);
gl_FragData[0] = vec4(rodExposure, centerDepth,0.0, 1.0);
}