DOUBLE LAYER CLOUD TEST #2. tweaked cloud lighting further. tweaked the sky ground. added gradient to fog skylighting. fix hand bug with bloomy fog.

This commit is contained in:
Xonk
2023-12-05 22:06:47 -05:00
parent d90a15e694
commit 72709b914d
13 changed files with 211 additions and 254 deletions

View File

@ -6,8 +6,7 @@ const bool colortex5MipmapEnabled = true;
#ifdef OVERWORLD_SHADER
const bool shadowHardwareFiltering = true;
uniform sampler2DShadow shadow;
flat varying vec3 averageSkyCol_Clouds;
flat varying vec4 lightCol;
@ -54,6 +53,7 @@ uniform sampler2D colortex7; //water?
uniform sampler2D colortex8; //Specular
uniform sampler2D colortex9; //Specular
uniform sampler2D colortex10;
uniform sampler2D colortex12;
uniform sampler2D colortex15; // flat normals(rgb), vanillaAO(alpha)
@ -507,7 +507,7 @@ vec3 SubsurfaceScattering_sky(vec3 albedo, float Scattering, float Density){
void main() {
vec3 DEBUG =vec3( 1.0);
vec3 DEBUG = vec3( 1.0);
////// --------------- SETUP STUFF --------------- //////
vec2 texcoord = gl_FragCoord.xy*texelSize;
@ -640,7 +640,7 @@ void main() {
Background += Sky;
#ifdef VOLUMETRIC_CLOUDS
vec4 Clouds = texture2D_bicubic_offset(colortex0, texcoord*CLOUDS_QUALITY, noise);
vec4 Clouds = texture2D_bicubic_offset(colortex0, texcoord*CLOUDS_QUALITY, noise_2);
Background = Background * Clouds.a + Clouds.rgb;
#endif
@ -793,18 +793,11 @@ void main() {
}
#endif
// #if SSS_TYPE != 0
// Direct_SSS *= 1.0-clamp(NdotL*Shadows,0,1);
// #endif
#ifdef CLOUDS_SHADOWS
cloudShadow = GetCloudShadow(feetPlayerPos);
Shadows *= cloudShadow;
Direct_SSS *= cloudShadow;
#endif
#endif
@ -843,7 +836,6 @@ void main() {
float skylight = max(pow(viewToWorld(FlatNormals).y*0.5+0.5,0.1) + SkylightDir, 0.25 + (1.0-lightmap.y) * 0.75) ;
AmbientLightColor *= skylight;
#endif
#ifdef NETHER_SHADER
@ -996,6 +988,7 @@ void main() {
Emission(gl_FragData[0].rgb, albedo, SpecularTex.a);
if(lightningBolt) gl_FragData[0].rgb = vec3(77.0, 153.0, 255.0);
}
#ifdef OVERWORLD_SHADER
@ -1028,7 +1021,8 @@ void main() {
waterVolumetrics_notoverworld(gl_FragData[0].rgb, viewPos0, viewPos, estimatedDepth , estimatedDepth, Vdiff, noise_2, totEpsilon, scatterCoef, ambientColVol);
}
#endif
// gl_FragData[0].rgb = skyCloudsFromTexLOD2(feetPlayerPos_normalized, colortex12, 6).rgb/30;
// gl_FragData[0].rgb = vec3(hand);
/* DRAWBUFFERS:3 */
}

View File

@ -126,11 +126,8 @@ void main() {
col = mix(lum * vec3(Purkinje_R, Purkinje_G, Purkinje_B) * Purkinje_Multiplier, col, rodCurve);
// if(texcoord.x > 0.75)col = vec3(1) * ;
#ifndef USE_ACES_COLORSPACE_APPROXIMATION
col = LinearTosRGB(TONEMAP(col));
col = LinearTosRGB(TONEMAP(col));
#else
col = col * ACESInputMat;
col = TONEMAP(col);

View File

@ -28,6 +28,7 @@ uniform int isEyeInWater;
uniform float rainStrength;
uniform ivec2 eyeBrightnessSmooth;
uniform float eyeAltitude;
#include "/lib/color_transforms.glsl"
#include "/lib/color_dither.glsl"
#include "/lib/projections.glsl"

View File

@ -12,7 +12,6 @@ uniform sampler2D colortex0;
uniform sampler2D colortex1;
uniform sampler2D colortex2;
uniform sampler2D colortex3;
// uniform sampler2D colortex4;
uniform sampler2D colortex5;
uniform sampler2D colortex6;
uniform sampler2D colortex7;
@ -20,11 +19,14 @@ uniform sampler2D colortex8;
uniform sampler2D colortex9;
uniform sampler2D colortex10;
uniform sampler2D colortex11;
// uniform sampler2D colortex12;
uniform sampler2D colortex13;
uniform sampler2D colortex15;
uniform vec2 texelSize;
#if defined NETHER_SHADER || defined END_SHADER
uniform sampler2D colortex4;
#endif
flat varying vec4 lightCol; //main light source color (rgb),used light source(1=sun,-1=moon)
flat varying vec3 WsunVec;
@ -360,6 +362,7 @@ void main() {
#ifdef display_LUT
vec2 movedTC = texcoord;
vec3 thingy = texture2D(colortex4,movedTC).rgb / 30;
if(luma(thingy) > 0.0){
color.rgb = thingy;
vl.a = 1.0;

View File

@ -8,14 +8,13 @@ const int colortex2Format = RGBA16F; //forward + transparencies (gbuffer->com
const int colortex3Format = R11F_G11F_B10F; //frame buffer + bloom (deferred6->final)
const int colortex4Format = RGBA16F; //light values and skyboxes (everything)
const int colortex6Format = R11F_G11F_B10F; //additionnal buffer for bloom (composite3->final)
const int colortex7Format = RGBA8; //Final output, transparencies id (gbuffer->composite4)
const int colortex8Format = RGBA8; // Specular Texture
const int colortex7Format = RGBA8; //Final output, transparencies id (gbuffer->composite4)
const int colortex8Format = RGBA8; // Specular Texture
const int colortex9Format = RGBA8; // rain in alpha
const int colortex10Format = RGBA16; // resourcepack Skies
const int colortex11Format = RGBA16; // unchanged translucents albedo, alpha and tangent normals
const int colortex10Format = RGBA16; // resourcepack Skies
const int colortex11Format = RGBA16; // unchanged translucents albedo, alpha and tangent normals
const int colortex14Format = RGBA8; // a = skylightmap for translucents.
const int colortex14Format = RGBA8; // a = skylightmap for translucents.
const int colortex15Format = RGBA8; // flat normals and vanilla AO
*/
@ -28,7 +27,14 @@ const bool colortex4Clear = false;
const bool colortex5Clear = false;
const bool colortex6Clear = false;
const bool colortex7Clear = false;
const bool colortex8Clear = false;
const bool colortex9Clear = true;
const bool colortex10Clear = false;
const bool colortex11Clear = true;
const bool colortex12Clear = false;
const bool colortex13Clear = false;
const bool colortex14Clear = false;
const bool colortex15Clear = false;
#ifdef SCREENSHOT_MODE
/*

View File

@ -27,7 +27,7 @@ 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*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;

View File

@ -69,6 +69,7 @@ float blueNoise(){
#ifdef OVERWORLD_SHADER
// uniform sampler2D colortex12;
// const bool shadowHardwareFiltering = true;
uniform sampler2DShadow shadow;
#define TEST
@ -102,7 +103,7 @@ float mixhistory = 0.06;
vec3 AmbientLightTint = vec3(AmbientLight_R, AmbientLight_G, AmbientLight_B);
// --- the color of the atmosphere + the average color of the atmosphere.
vec3 skyGroundCol = skyFromTex(vec3(0, -1 ,0), colortex4).rgb ;
vec3 skyGroundCol = skyFromTex(vec3(0, -1 ,0), colortex4).rgb;// * clamp(WsunVec.y*2.0,0.2,1.0);
/// --- Save light values
if (gl_FragCoord.x < 1. && gl_FragCoord.y > 19.+18. && gl_FragCoord.y < 19.+18.+1 )
@ -144,12 +145,11 @@ if (gl_FragCoord.x > 18. && gl_FragCoord.y > 1. && gl_FragCoord.x < 18+257){
vec2 planetSphere = vec2(0.0);
vec3 sky = vec3(0.0);
vec3 skyAbsorb = vec3(0.0);
// vec3 WsunVec = mat3(gbufferModelViewInverse)*sunVec;
// vec3 WsunVec = normalize(LightDir);
sky = calculateAtmosphere(averageSkyCol*4000./2.0, viewVector, vec3(0.0,1.0,0.0), WsunVec, -WsunVec, planetSphere, skyAbsorb, 10, blueNoise());
// float GroundDarkening = (exp2(-15 * clamp(-viewVector.y,0.0,1.0)) * 0.7+0.3); // darken the ground in the sky.
sky = calculateAtmosphere((averageSkyCol*4000./2.0), viewVector, vec3(0.0,1.0,0.0), WsunVec, -WsunVec, planetSphere, skyAbsorb, 10, blueNoise());
// sky = mix(sky, (averageSkyCol + skyAbsorb)*4000./2.0 ,(1.0 - exp(pow(clamp(-viewVector.y+0.5,0.0,1.0),2) * -25)));
// sky = mix(sky, (averageSkyCol + skyAbsorb)*4000./2.0, (1.0 - exp(pow(clamp(-viewVector.y+0.5,0.0,1.0),2) * -25)));
// fade atmosphere conditions for rain away when you pass above the cloud plane.
float heightRelativeToClouds = clamp(1.0 - max(eyeAltitude - Cumulus_height,0.0) / 200.0 ,0.0,1.0);
@ -167,8 +167,6 @@ if (gl_FragCoord.x > 18.+257. && gl_FragCoord.y > 1. && gl_FragCoord.x < 18+257+
vec2 p = clamp(floor(gl_FragCoord.xy-vec2(18.+257,1.))/256.+tempOffsets/256.,0.0,1.0);
vec3 viewVector = cartToSphere(p);
// vec3 WsunVec = mat3(gbufferModelViewInverse)*sunVec;
// vec3 WsunVec = normalize(LightDir);
vec3 sky = texelFetch2D(colortex4,ivec2(gl_FragCoord.xy)-ivec2(257,0),0).rgb/150.0;
if(viewVector.y < -0.025) sky = sky * clamp( exp(viewVector.y) - 1.0,0.25,1.0) ;
@ -180,7 +178,6 @@ if (gl_FragCoord.x > 18.+257. && gl_FragCoord.y > 1. && gl_FragCoord.x < 18+257+
sky = sky * VL_Fog.a + VL_Fog.rgb / 5.0;
gl_FragData[0] = vec4(sky,1.0);
}
#endif
@ -284,5 +281,4 @@ if (gl_FragCoord.x > 10. && gl_FragCoord.x < 11. && gl_FragCoord.y > 19.+18. &&
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);
}

View File

@ -114,9 +114,9 @@ void main() {
/// TOOO DAMN BLUE
// // only need to sample one spot for this
// averageSkyCol += 2.0*skyFromTex(normalize(vec3(0.0,1.0,0.0)),colortex4).rgb/150.;
vec3 minimimlight = vec3(0.2,0.4,1.0) * (MIN_LIGHT_AMOUNT*0.003 + nightVision);
averageSkyCol_Clouds = max(averageSkyCol_Clouds, minimimlight);
averageSkyCol = max(averageSkyCol, minimimlight);
vec3 minimumlight = vec3(0.2,0.4,1.0) * (MIN_LIGHT_AMOUNT*0.003 + nightVision);
averageSkyCol_Clouds = max(averageSkyCol_Clouds, minimumlight);
averageSkyCol = max(averageSkyCol, minimumlight);
////////////////////////////////////////
/// --- SUNLIGHT/MOONLIGHT STUFF --- ///