Balance cloud lighting. remake altocumulus shapes. Add daily weather profiles. Add rainy weather. clean vl fog code and fix atmospheric haze contribution to bloomy fog. add motion blur. add new composite pass dedicated to post processing effects (damage effects, motion blur, whatever). fix waving for tall plants. fix broken lighting when HQ ambient light is enabled. improve screenspace SSS on DH chunks. add more DH settings. add "large waves" setting for water. make moonlight slightly darker. improve cave fog. remade cave detection. fix upscaling scaling issues

This commit is contained in:
Xonk
2024-06-10 23:26:19 -04:00
parent 9a66781d0f
commit a7ab9f971f
53 changed files with 1305 additions and 854 deletions

View File

@ -313,23 +313,25 @@ void main() {
float torchlightmap = lmtexcoord.z;
#ifdef Hand_Held_lights
if(HELD_ITEM_BRIGHTNESS > 0.0) torchlightmap = max(torchlightmap, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(fragpos)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
if(HELD_ITEM_BRIGHTNESS > 0.0) torchlightmap = max(torchlightmap, HELD_ITEM_BRIGHTNESS * clamp( pow(max(1.0-length(worldpos-cameraPosition)/HANDHELD_LIGHT_RANGE,0.0),1.5),0.0,1.0));
#ifdef HAND
torchlightmap *= 0.9;
#endif
#endif
float lightmap = clamp( (lmtexcoord.w-0.8) * 10.0,0.,1.);
float lightmap = clamp( (lmtexcoord.w-0.9) * 10.0,0.,1.);
float rainfall = rainStrength * noPuddleAreas;
float Puddle_shape = 0.;
float rainfall = 0.0;
float Puddle_shape = 0.0;
#if defined Puddles && defined WORLD && !defined ENTITIES && !defined HAND
Puddle_shape = (1.0 - clamp(exp(-15 * pow(texture2D(noisetex, worldpos.xz * (0.020 * Puddle_Size) ).b ,5)),0,1)) * lightmap ;
Puddle_shape *= clamp( viewToWorld(normal).y*0.5+0.5 ,0.0,1.0);
Puddle_shape *= rainfall;
rainfall = rainStrength * noPuddleAreas * lightmap;
Puddle_shape = clamp(lightmap - exp(-15.0 * pow(texture2D(noisetex, worldpos.xz * (0.020 * Puddle_Size) ).b,5.0)),0.0,1.0);
Puddle_shape *= clamp( viewToWorld(normal).y*0.5+0.5,0.0,1.0);
Puddle_shape *= rainStrength * noPuddleAreas ;
#endif
@ -446,12 +448,12 @@ void main() {
#ifdef HAND
if (Albedo.a > 0.1){
Albedo.a = 0.75;
gl_FragData[3] = vec4(0.0);
} else {
Albedo.a = 1.0;
}
#endif
#if defined HAND || defined ENTITIES || defined BLOCKENTITIES
#if defined PARTICLE_RENDERING_FIX && (defined ENTITIES || defined BLOCKENTITIES)
gl_FragData[3] = vec4(0.0);
#endif
@ -472,16 +474,7 @@ void main() {
NormalTex.xy = NormalTex.xy * 2.0-1.0;
NormalTex.z = sqrt(max(1.0 - dot(NormalTex.xy, NormalTex.xy), 0.0));
// #if defined HEIGTHMAP_DEPTH_OFFSET && !defined HAND
// gl_FragDepth = gl_FragCoord.z;
// vec3 truePos = fragpos;
// truePos.z -= Heightmap * POM_DEPTH * (1.0 + ld(truePos.z));
// gl_FragDepth = toClipSpace3(truePos).z;
// #endif
normal = applyBump(tbnMatrix, NormalTex.xyz, mix(1.0,1-Puddle_shape,rainfall) );
// normal = applyBump(tbnMatrix, NormalTex.xyz, 0.0);
normal = applyBump(tbnMatrix, NormalTex.xyz, 1.0-Puddle_shape);
#endif
//////////////////////////////// ////////////////////////////////
@ -491,8 +484,8 @@ void main() {
#ifdef WORLD
vec4 SpecularTex = texture2D_POMSwitch(specular, adjustedTexCoord.xy, vec4(dcdx,dcdy), ifPOM,textureLOD);
SpecularTex.r = max(SpecularTex.r, Puddle_shape);
SpecularTex.g = max(SpecularTex.g, Puddle_shape*0.02);
SpecularTex.r = max(SpecularTex.r, rainfall);
SpecularTex.g = max(SpecularTex.g, max(Puddle_shape*0.02,0.02));
gl_FragData[1].rg = SpecularTex.rg;
@ -548,12 +541,13 @@ void main() {
//////////////////////////////// ////////////////////////////////
#ifdef WORLD
#ifdef Puddles
float porosity = 0.4;
#ifdef Porosity
porosity = SpecularTex.z >= 64.5/255.0 ? 0.0 : (SpecularTex.z*255.0/64.0)*0.65;
#endif
if(SpecularTex.g < 229.5/255.0) Albedo.rgb = mix(Albedo.rgb, vec3(0), Puddle_shape*porosity);
#endif
@ -561,9 +555,8 @@ void main() {
vec2 PackLightmaps = vec2(torchlightmap, lmtexcoord.w);
vec4 data1 = clamp( encode(viewToWorld(normal), PackLightmaps), 0.0, 1.0);
// gl_FragData[0] = vec4(.0);
gl_FragData[0] = vec4(encodeVec2(Albedo.x,data1.x), encodeVec2(Albedo.y,data1.y), encodeVec2(Albedo.z,data1.z), encodeVec2(data1.w,Albedo.w));
gl_FragData[0] = vec4(encodeVec2(Albedo.x,data1.x), encodeVec2(Albedo.y,data1.y), encodeVec2(Albedo.z,data1.z), encodeVec2(data1.w,Albedo.w));
gl_FragData[2] = vec4(FlatNormals * 0.5 + 0.5, VanillaAO);
#endif