diff --git a/shaders/block.properties b/shaders/block.properties index 3b2cc17..24c9b3a 100644 --- a/shaders/block.properties +++ b/shaders/block.properties @@ -16,7 +16,7 @@ block.15=minecraft:oak_sapling minecraft:spruce_sapling minecraft:birch_sapling block.16=vine -block.17=minecraft:hanging_roots minecraft:weeping_vines minecraft:cave_vines:berries=false +block.17=minecraft:hanging_roots minecraft:weeping_vines ####### ----- waving blocks with SSS ----- ####### @@ -43,7 +43,7 @@ block.80=minecraft:kelp_plant minecraft:peony minecraft:rose_bush minecraft:lila westerosblocks:blackberry_bush westerosblocks:blueberry_bush westerosblocks:raspberry_bush westerosblocks:juniper_bush westerosblocks:red_rose_bush westerosblocks:pink_rose_bush westerosblocks:white_rose_bush westerosblocks:yellow_rose_bush westerosblocks:yellow_wildflowers westerosblocks:green_spiny_herb westerosblocks:green_leafy_herb westerosblocks:orange_marigolds westerosblocks:orange_trollius westerosblocks:blue_forgetmenots westerosblocks:pink_wildflowers westerosblocks:yellow_tansy westerosblocks:blue_flax westerosblocks:white_daisies westerosblocks:yellow_daisies westerosblocks:green_scrub_grass westerosblocks:dead_scrub_grass westerosblocks:yellow_bedstraw westerosblocks:orange_bells westerosblocks:blue_bells westerosblocks:blue_swamp_bells westerosblocks:yellow_buttercups westerosblocks:orange_bog_asphodel westerosblocks:yellow_lupine westerosblocks:blue_hyacinth westerosblocks:pink_thistle westerosblocks:yellow_dandelions westerosblocks:yellow_daffodils westerosblocks:yellow_roses westerosblocks:strawberry_bush westerosblocks:white_lilyofthevalley westerosblocks:yellow_bells westerosblocks:yellow_sunflower westerosblocks:white_roses westerosblocks:red_dark_roses westerosblocks:yellow_hellebore westerosblocks:meadow_fescue westerosblocks:red_poppies westerosblocks:red_roses westerosblocks:purple_pansies westerosblocks:purple_roses westerosblocks:orange_sun_star westerosblocks:pink_primrose westerosblocks:red_aster westerosblocks:blue_chicory westerosblocks:red_flowering_spiny_herb westerosblocks:purple_foxglove westerosblocks:pink_allium westerosblocks:purple_violets westerosblocks:white_chamomile westerosblocks:red_tulips westerosblocks:white_peony westerosblocks:purple_alpine_sowthistle westerosblocks:red_carnations westerosblocks:magenta_roses westerosblocks:red_chrysanthemum westerosblocks:blue_orchid westerosblocks:yellow_rudbeckia westerosblocks:pink_tulips westerosblocks:cranberry_bush westerosblocks:purple_lavender westerosblocks:red_sourleaf_bush westerosblocks:pink_sweet_peas westerosblocks:red_sorrel westerosblocks:pink_roses westerosblocks:unshaded_grass westerosblocks:cow_parsely westerosblocks:bracken westerosblocks:lady_fern westerosblocks:nettle westerosblocks:dead_bracken westerosblocks:fireweed westerosblocks:heather westerosblocks:red_fern westerosblocks:dock_leaf westerosblocks:jasmine_vines westerosblocks:dappled_moss westerosblocks:cushion_moss_wall westerosblocks:hemp_short westerosblocks:hemp_tall westerosblocks:hemp_dense westerosblocks:crop_carrots westerosblocks:crop_wheat westerosblocks:crop_turnips westerosblocks:crop_peas westerosblocks:cattails westerosblocks:jungle_tall_fern westerosblocks:jungle_tall_grass westerosblocks:savanna_tall_grass ## weak sss -block.81=minecraft:amethyst_block minecraft:budding_amethyst minecraft:small_amethyst_bud minecraft:pitcher_plant minecraft:grass_block:snowy=true snow:layers=5 snow:layers=6 snow:layers=7 snow:layers=8 minecraft:snow_block powder_snow cobweb red_mushroom_block brown_mushroom_block weeping_vines weeping_vines_plant twisting_vines twisting_vines_plant tube_coral tube_coral_block tube_coral_fan tube_coral_wall_fan horn_coral horn_coral_block horn_coral_fan horn_coral_wall_fan fire_coral fire_coral_block fire_coral_fan fire_coral_wall_fan dead_brain_coral dead_brain_coral_block dead_brain_coral_fan dead_brain_coral_wall_fan dead_bubble_coral dead_bubble_coral_block dead_bubble_coral_fan dead_bubble_coral_wall_fan dead_bush dead_fire_coral dead_fire_coral_block dead_fire_coral_fan dead_fire_coral_wall_fan dead_horn_coral dead_horn_coral_block dead_horn_coral_fan dead_horn_coral_wall_fan dead_tube_coral dead_tube_coral_block dead_tube_coral_fan dead_tube_coral_wall_fan bubble_coral bubble_coral_block bubble_coral_fan bubble_coral_wall_fan brain_coral brain_coral_block brain_coral_fan brain_coral_wall_fan minecraft:spore_blossom minecraft:cave_vines_plant:berries=false minecraft:melon minecraft:pumpkin minecraft:big_dripleaf minecraft:big_dripleaf_stem minecraft:cactus minecraft:hay_block minecraft:brown_mushroom minecraft:mushroom_stem minecraft:sugar_cane minecraft:crimson_fungus minecraft:warped_fungus minecraft:sea_pickle:waterlogged=false minecraft:honeycomb_block +block.81=minecraft:cave_vines:berries=falseminecraft:amethyst_block minecraft:budding_amethyst minecraft:small_amethyst_bud minecraft:pitcher_plant minecraft:grass_block:snowy=true snow:layers=5 snow:layers=6 snow:layers=7 snow:layers=8 minecraft:snow_block powder_snow cobweb red_mushroom_block brown_mushroom_block weeping_vines weeping_vines_plant twisting_vines twisting_vines_plant tube_coral tube_coral_block tube_coral_fan tube_coral_wall_fan horn_coral horn_coral_block horn_coral_fan horn_coral_wall_fan fire_coral fire_coral_block fire_coral_fan fire_coral_wall_fan dead_brain_coral dead_brain_coral_block dead_brain_coral_fan dead_brain_coral_wall_fan dead_bubble_coral dead_bubble_coral_block dead_bubble_coral_fan dead_bubble_coral_wall_fan dead_bush dead_fire_coral dead_fire_coral_block dead_fire_coral_fan dead_fire_coral_wall_fan dead_horn_coral dead_horn_coral_block dead_horn_coral_fan dead_horn_coral_wall_fan dead_tube_coral dead_tube_coral_block dead_tube_coral_fan dead_tube_coral_wall_fan bubble_coral bubble_coral_block bubble_coral_fan bubble_coral_wall_fan brain_coral brain_coral_block brain_coral_fan brain_coral_wall_fan minecraft:spore_blossom minecraft:cave_vines_plant:berries=false minecraft:melon minecraft:pumpkin minecraft:big_dripleaf minecraft:big_dripleaf_stem minecraft:cactus minecraft:hay_block minecraft:brown_mushroom minecraft:mushroom_stem minecraft:sugar_cane minecraft:crimson_fungus minecraft:warped_fungus minecraft:sea_pickle:waterlogged=false minecraft:honeycomb_block ## weak sss block.82=minecraft:white_wool minecraft:orange_wool minecraft:magenta_wool minecraft:light_blue_wool minecraft:yellow_wool minecraft:lime_wool minecraft:pink_wool minecraft:gray_wool minecraft:light_gray_wool minecraft:cyan_wool minecraft:purple_wool minecraft:blue_wool minecraft:brown_wool minecraft:green_wool minecraft:red_wool minecraft:black_wool minecraft:orange_carpet minecraft:magenta_carpet minecraft:light_blue_carpet minecraft:yellow_carpet minecraft:lime_carpet minecraft:pink_carpet minecraft:gray_carpet minecraft:light_gray_carpet minecraft:cyan_carpet minecraft:purple_carpet minecraft:blue_carpet minecraft:brown_carpet minecraft:green_carpet minecraft:red_carpet minecraft:black_carpet \ @@ -703,8 +703,4 @@ block.477=cobblestone_wall:north=low:east=tall:south=low:west=tall:up=false ande block.500=minecraft:end_portal ## all blocks here get exluded from POM. -block.501=minecraft:oak_sign minecraft:spruce_sign minecraft:birch_sign minecraft:jungle_sign minecraft:acacia_sign minecraft:dark_oak_sign minecraft:mangrove_sign minecraft:crimson_sign minecraft:warped_sign minecraft:oak_wall_sign minecraft:spruce_wall_sign minecraft:birch_wall_sign minecraft:jungle_wall_sign minecraft:acacia_wall_sign minecraft:dark_oak_wall_sign minecraft:mangrove_wall_sign minecraft:crimson_wall_sign minecraft:warped_wall_sign - - ## workaround mixed render stages - ##= BLOCK_REDSTONE_WIRE - ##block.*= minecraft:redstone_wire +block.501=minecraft:oak_sign minecraft:spruce_sign minecraft:birch_sign minecraft:jungle_sign minecraft:acacia_sign minecraft:dark_oak_sign minecraft:mangrove_sign minecraft:crimson_sign minecraft:warped_sign minecraft:oak_wall_sign minecraft:spruce_wall_sign minecraft:birch_wall_sign minecraft:jungle_wall_sign minecraft:acacia_wall_sign minecraft:dark_oak_wall_sign minecraft:mangrove_wall_sign minecraft:crimson_wall_sign minecraft:warped_wall_sign \ No newline at end of file diff --git a/shaders/dimensions/DH_solid.fsh b/shaders/dimensions/DH_solid.fsh index da30fb6..afd0197 100644 --- a/shaders/dimensions/DH_solid.fsh +++ b/shaders/dimensions/DH_solid.fsh @@ -118,7 +118,7 @@ void main() { vec2 PackLightmaps = lightmapCoords; // PackLightmaps.y *= 1.05; - // PackLightmaps = min(max(PackLightmaps - 0.001*blueNoise(),0.0)*1.002,1.0); + PackLightmaps = min(max(PackLightmaps,0.0)*1.05,1.0); vec4 data1 = clamp( encode(normals.xyz, PackLightmaps), 0.0, 1.0); diff --git a/shaders/dimensions/DH_translucent.fsh b/shaders/dimensions/DH_translucent.fsh index 0feec41..a215a8b 100644 --- a/shaders/dimensions/DH_translucent.fsh +++ b/shaders/dimensions/DH_translucent.fsh @@ -168,7 +168,7 @@ const vec2[8] offsets = vec2[8](vec2(1./8.,-3./8.), vec3 rayTrace(vec3 dir, vec3 position,float dither, float fresnel, bool inwater){ - float quality = mix(15,SSR_STEPS,fresnel); + float quality = mix(5,SSR_STEPS,fresnel); vec3 clipPosition = DH_toClipSpace3(position); float rayLength = ((position.z + dir.z * dhFarPlane*sqrt(3.)) > -dhNearPlane) ? (-dhNearPlane - position.z) / dir.z : dhFarPlane*sqrt(3.); diff --git a/shaders/dimensions/all_particles.fsh b/shaders/dimensions/all_particles.fsh index 5abb889..cc69edb 100644 --- a/shaders/dimensions/all_particles.fsh +++ b/shaders/dimensions/all_particles.fsh @@ -432,6 +432,14 @@ void main() { #endif #endif + + #ifdef NETHER_SHADER + AmbientLightColor = skyCloudsFromTexLOD2(vec3(0.0,1.0,0.0), colortex4, 6).rgb / 30.0; + #endif + + #ifdef END_SHADER + AmbientLightColor = vec3(0.3,0.6,1.0) * 0.5; + #endif #ifdef IS_LPV_ENABLED vec3 lpvPos = GetLpvPosition(feetPlayerPos); diff --git a/shaders/dimensions/all_translucent.fsh b/shaders/dimensions/all_translucent.fsh index c7ec37f..e5ff096 100644 --- a/shaders/dimensions/all_translucent.fsh +++ b/shaders/dimensions/all_translucent.fsh @@ -436,65 +436,6 @@ void Emission( if( Emission < 254.5/255.0) Lighting = mix(Lighting, Albedo * Emissive_Brightness * autoBrightnessAdjust * 0.1, pow(Emission, Emissive_Curve)); // old method.... idk why } -/* -uniform float viewWidth; -uniform float viewHeight; -void frisvad(in vec3 n, out vec3 f, out vec3 r){ - if(n.z < -0.9) { - f = vec3(0.,-1,0); - r = vec3(-1, 0, 0); - } else { - float a = 1./(1.+n.z); - float b = -n.x*n.y*a; - f = vec3(1. - n.x*n.x*a, b, -n.x) ; - r = vec3(b, 1. - n.y*n.y*a , -n.y); - } -} -mat3 CoordBase(vec3 n){ - vec3 x,y; - frisvad(n,x,y); - return mat3(x,y,n); -} -vec2 R2_samples(int n){ - vec2 alpha = vec2(0.75487765, 0.56984026); - return fract(alpha * n); -} -float fma(float a,float b,float c){ - return a * b + c; -} -//// thank you Zombye | the paper: https://ggx-research.github.io/publication/2023/06/09/publication-ggx.html -vec3 SampleVNDFGGX( - vec3 viewerDirection, // Direction pointing towards the viewer, oriented such that +Z corresponds to the surface normal - vec2 alpha, // Roughness parameter along X and Y of the distribution - float xy // Pair of uniformly distributed numbers in [0, 1) -) { - // alpha *= alpha; - // Transform viewer direction to the hemisphere configuration - viewerDirection = normalize(vec3(alpha * viewerDirection.xy, viewerDirection.z)); - - // Sample a reflection direction off the hemisphere - const float tau = 6.2831853; // 2 * pi - float phi = tau * xy; - - float cosTheta = fma(1.0 - xy, 1.0 + viewerDirection.z, -viewerDirection.z) ; - float sinTheta = sqrt(clamp(1.0 - cosTheta * cosTheta, 0.0, 1.0)); - - // xonk note, i dont know what im doing but this kinda does what i want so whatever - float attemptTailClamp = clamp(sinTheta,max(cosTheta-0.25,0), cosTheta); - float attemptTailClamp2 = clamp(cosTheta,max(sinTheta-0.25,0), sinTheta); - - vec3 reflected = vec3(vec2(cos(phi), sin(phi)) * attemptTailClamp2, attemptTailClamp); - // vec3 reflected = vec3(vec2(cos(phi), sin(phi)) * sinTheta, cosTheta); - - // Evaluate halfway direction - // This gives the normal on the hemisphere - vec3 halfway = reflected + viewerDirection; - - // Transform the halfway direction back to hemiellispoid configuation - // This gives the final sampled normal - return normalize(vec3(alpha * halfway.xy, halfway.z)); -} -*/ //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// @@ -717,8 +658,12 @@ if (gl_FragCoord.x * texelSize.x < 1.0 && gl_FragCoord.y * texelSize.y < 1.0 ) Direct_lighting = lightColors * endFogPhase(lightPos) * NdotL; - vec3 AmbientLightColor = vec3(0.5,0.75,1.0) * 0.9 + 0.1; - AmbientLightColor *= clamp(1.5 + dot(worldSpaceNormal, normalize(feetPlayerPos))*0.5,0,2); + // vec3 AmbientLightColor = vec3(0.5,0.75,1.0) * 0.9 + 0.1; + // AmbientLightColor *= clamp(1.5 + dot(worldSpaceNormal, normalize(feetPlayerPos))*0.5,0,2); + + vec3 AmbientLightColor = vec3(0.3,0.6,1.0) * 0.5; + + AmbientLightColor = AmbientLightColor + 0.7 * AmbientLightColor * dot(worldSpaceNormal, normalize(feetPlayerPos)); #endif #ifdef IS_LPV_ENABLED diff --git a/shaders/dimensions/composite1.fsh b/shaders/dimensions/composite1.fsh index 6917bae..a3daa25 100644 --- a/shaders/dimensions/composite1.fsh +++ b/shaders/dimensions/composite1.fsh @@ -476,6 +476,10 @@ vec4 BilateralUpscale_DH(sampler2D tex, sampler2D depth, vec2 coord, float refer ivec2(-2, 0), ivec2( 0, 0), ivec2( 0,-2) + // ivec2(-1,-1), + // ivec2( 1, 1), + // ivec2(-1, 1), + // ivec2( 1,-1) ); #ifdef DISTANT_HORIZONS @@ -487,9 +491,11 @@ vec4 BilateralUpscale_DH(sampler2D tex, sampler2D depth, vec2 coord, float refer vec4 RESULT = vec4(0.0); float SUM = 0.0; + RESULT += texelFetch2D(tex, posColor + pos, 0); + for (int i = 0; i < 4; i++) { - ivec2 radius = getRadius[i]; + ivec2 radius = getRadius[i] ; #ifdef DISTANT_HORIZONS float offsetDepth = sqrt(texelFetch2D(depth, posDepth + radius * scaling + pos * scaling,0).a/65000.0); @@ -515,10 +521,10 @@ void BilateralUpscale_REUSE_Z(sampler2D tex1, sampler2D tex2, sampler2D depth, v ivec2 pos = ivec2(gl_FragCoord.xy*texelSize + 1); ivec2 getRadius[4] = ivec2[]( - ivec2(-1,-1), - ivec2(-1, 0), - ivec2( 0, 0), - ivec2( 0,-1) + ivec2(-1,-1), + ivec2( 1,-1), + ivec2( 1, 1), + ivec2(-1, 1) ); #ifdef DISTANT_HORIZONS @@ -529,7 +535,65 @@ void BilateralUpscale_REUSE_Z(sampler2D tex1, sampler2D tex2, sampler2D depth, v vec3 shadow_RESULT = vec3(0.0); vec2 ssao_RESULT = vec2(0.0); - vec4 fog_RESULT = vec4(0.0); + float SUM = 1.0; + + #ifdef LIGHTING_EFFECTS_BLUR_FILTER + for (int i = 0; i < 4; i++) { + + ivec2 radius = getRadius[i]; + + #ifdef DISTANT_HORIZONS + float offsetDepth = sqrt(texelFetch2D(depth, posDepth + radius * scaling + pos * scaling,0).a/65000.0); + #else + float offsetDepth = ld(texelFetch2D(depth, posDepth + radius * scaling + pos * scaling, 0).r); + #endif + + float EDGES = abs(offsetDepth - referenceDepth) < diffThreshold ? 1.0 : 1e-5; + + #ifdef Variable_Penumbra_Shadows + shadow_RESULT += texelFetch2D(tex1, posColor + radius + pos, 0).rgb * EDGES; + #endif + + #if indirect_effect == 1 + ssao_RESULT += texelFetch2D(tex2, posColor + radius + pos, 0).rg * EDGES; + #endif + + SUM += EDGES; + } + #endif + + #ifdef Variable_Penumbra_Shadows + shadow_RESULT += texture2D(tex1, gl_FragCoord.xy*texelSize).rgb; + filteredShadow = shadow_RESULT/SUM; + #endif + + #if indirect_effect == 1 + ssao_RESULT += texture2D(tex2, gl_FragCoord.xy*texelSize).rg; + ambientEffects = ssao_RESULT/SUM; + #endif +} + +vec4 BilateralUpscale_VLFOG(sampler2D tex, sampler2D depth, vec2 coord, float referenceDepth){ + ivec2 scaling = ivec2(1.0/VL_RENDER_RESOLUTION); + ivec2 posDepth = ivec2(coord*VL_RENDER_RESOLUTION) * scaling; + ivec2 posColor = ivec2(coord*VL_RENDER_RESOLUTION); + ivec2 pos = ivec2(gl_FragCoord.xy*texelSize + 1); + + ivec2 getRadius[5] = ivec2[]( + ivec2(-1,-1), + ivec2( 1, 1), + ivec2(-1, 1), + ivec2( 1,-1), + ivec2( 0, 0) + ); + + #ifdef DISTANT_HORIZONS + float diffThreshold = 0.01; + #else + float diffThreshold = zMults.x; + #endif + + vec4 RESULT = vec4(0.0); float SUM = 0.0; for (int i = 0; i < 4; i++) { @@ -543,22 +607,13 @@ void BilateralUpscale_REUSE_Z(sampler2D tex1, sampler2D tex2, sampler2D depth, v #endif float EDGES = abs(offsetDepth - referenceDepth) < diffThreshold ? 1.0 : 1e-5; - // #ifdef Variable_Penumbra_Shadows - shadow_RESULT += texelFetch2D(tex1, posColor + radius + pos, 0).rgb * EDGES; - // #endif - - #if indirect_effect == 1 - ssao_RESULT += texelFetch2D(tex2, posColor + radius + pos, 0).rg * EDGES; - #endif - - SUM += EDGES; + + RESULT += texelFetch2D(tex, posColor + radius + pos, 0) * EDGES; + + SUM += EDGES; } - // #ifdef Variable_Penumbra_Shadows - filteredShadow = shadow_RESULT/SUM; - // #endif - #if indirect_effect == 1 - ambientEffects = ssao_RESULT/SUM; - #endif + + return RESULT / SUM; } #ifdef OVERWORLD_SHADER @@ -617,8 +672,8 @@ float ComputeShadowMap(in vec3 projectedShadowPosition, float distortFactor, flo #endif // return maxDistFade; - - return mix(1.0, shadowmap / samples, maxDistFade); + return shadowmap / samples; + // return mix(1.0, shadowmap / samples, maxDistFade); } #endif @@ -632,7 +687,7 @@ float CustomPhase(float LightPos){ return Final; } -vec3 SubsurfaceScattering_sun(vec3 albedo, float Scattering, float Density, float lightPos, float shadows, bool distantSSS){ +vec3 SubsurfaceScattering_sun(vec3 albedo, float Scattering, float Density, float lightPos, float shadows, float distantSSS){ Scattering *= sss_density_multiplier; @@ -641,7 +696,7 @@ vec3 SubsurfaceScattering_sun(vec3 albedo, float Scattering, float Density, floa float scatterDepth = max(1.0 - Scattering/density,0.0); scatterDepth = exp((1.0-scatterDepth) * -7.0); - if(distantSSS) scatterDepth = exp(Scattering * -10.0); + scatterDepth = mix(exp(Scattering * -10.0), scatterDepth, distantSSS); // this is for SSS when there is no shadow blocker depth #if defined BASIC_SHADOW_FILTER && defined Variable_Penumbra_Shadows @@ -851,9 +906,9 @@ void main() { vec2 SSAO_SSS = vec2(1.0); #if defined DISTANT_HORIZONS && defined DH_AMBIENT_OCCLUSION - BilateralUpscale_REUSE_Z(colortex3, colortex14, colortex12, gl_FragCoord.xy, DH_mixedLinearZ, SSAO_SSS, filteredShadow, hand); + BilateralUpscale_REUSE_Z(colortex3, colortex14, colortex12, gl_FragCoord.xy-1.5, DH_mixedLinearZ, SSAO_SSS, filteredShadow, hand); #else - BilateralUpscale_REUSE_Z(colortex3, colortex14, depthtex0, gl_FragCoord.xy, ld(z0), SSAO_SSS, filteredShadow, hand); + BilateralUpscale_REUSE_Z(colortex3, colortex14, depthtex0, gl_FragCoord.xy-1.5, ld(z0), SSAO_SSS, filteredShadow, hand); #endif float ShadowBlockerDepth = filteredShadow.y; @@ -936,8 +991,10 @@ void main() { projectedShadowPosition = diagonal3_old(shadowProjection) * projectedShadowPosition + shadowProjection[3].xyz; #if OPTIMIZED_SHADOW_DISTANCE > 0 - float shadowMapFalloff = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / (shadowDistance+16),0.0)*5.0,1.0)); + + float shadowMapFalloff = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / (shadowDistance+16.0),0.0)*5.0,1.0)); float shadowMapFalloff2 = smoothstep(0.0, 1.0, min(max(1.0 - length(feetPlayerPos) / shadowDistance,0.0)*5.0,1.0)); + #else vec3 shadowEdgePos = projectedShadowPosition * vec3(0.4,0.4,0.5/6.0) + vec3(0.5,0.5,0.12); float fadeLength = max((shadowDistance/256)*30,10.0); @@ -964,7 +1021,8 @@ void main() { float ShadowAlpha = 0.0; // this is for subsurface scattering later. Shadows = ComputeShadowMap(projectedShadowPosition, distortFactor, noise_2, filteredShadow.x, flatNormNdotL, shadowMapFalloff, DirectLightColor, ShadowAlpha, LabSSS > 0.0); - if(!isWater) Shadows *= mix(LM_shadowMapFallback, 1.0, shadowMapFalloff2); + // transition to fallback lightmap shadow mask. + Shadows = mix(isWater ? 1.0 : LM_shadowMapFallback, Shadows, shadowMapFalloff); #ifdef OLD_LIGHTLEAK_FIX if (isEyeInWater == 0) Shadows *= lightLeakFix; // light leak fix @@ -1022,6 +1080,8 @@ void main() { ///////////////////////////////////////////////////////////////////////////////// #if defined OVERWORLD_SHADER && (indirect_effect == 0 || indirect_effect == 1) + Indirect_lighting = AmbientLightColor; + float allDirections = dot(abs(slopednormal),vec3(1.0)); vec3 ambientcoefs = slopednormal / allDirections; float SkylightDir = ambientcoefs.y*1.5; @@ -1034,26 +1094,20 @@ void main() { skylight = min(skylight, mix(0.95, 2.5, pow(1-pow(1-SSAO_SSS.x, 0.5),2.0) )); #endif - Indirect_lighting = AmbientLightColor * skylight; + Indirect_lighting *= skylight; #endif #ifdef NETHER_SHADER - // Indirect_lighting = skyCloudsFromTexLOD2(normal, colortex4, 6).rgb / 15.0; - - // vec3 up = skyCloudsFromTexLOD2(vec3( 0, 1, 0), colortex4, 6).rgb/ 30.0; - // vec3 down = skyCloudsFromTexLOD2(vec3( 0,-1, 0), colortex4, 6).rgb/ 30.0; - - // up *= pow( max( slopednormal.y, 0), 2); - // down *= pow( max(-slopednormal.y, 0), 2); - // Indirect_lighting += up + down; - - Indirect_lighting = vec3(0.05); + Indirect_lighting = skyCloudsFromTexLOD2(normal, colortex4, 6).rgb / 30.0; + vec3 up = skyCloudsFromTexLOD2(vec3(0.0,1.0,0.0), colortex4, 6).rgb / 30.0; + + Indirect_lighting = mix(up, Indirect_lighting, clamp(pow(1.0-pow(1.0-SSAO_SSS.x, 0.5),2.0),0.0,1.0)); #endif #ifdef END_SHADER - Indirect_lighting += (vec3(0.5,0.75,1.0) * 0.9 + 0.1) * 0.1; - - Indirect_lighting *= clamp(1.5 + dot(normal, feetPlayerPos_normalized)*0.5,0,2); + Indirect_lighting = vec3(0.3,0.6,1.0) * 0.5; + + Indirect_lighting = Indirect_lighting + 0.7*mix(-Indirect_lighting, Indirect_lighting * dot(slopednormal, feetPlayerPos_normalized), clamp(pow(1.0-pow(1.0-SSAO_SSS.x, 0.5),2.0),0.0,1.0)); #endif #ifdef IS_LPV_ENABLED @@ -1165,7 +1219,6 @@ void main() { if(entities) sunSSS_density = 0.0; #endif - #ifdef SCREENSPACE_CONTACT_SHADOWS vec2 SS_directLight = SSRT_Shadows(toScreenSpace_DH(texcoord/RENDER_SCALE, z, DH_depth1), isDHrange, normalize(WsunVec*mat3(gbufferModelViewInverse)), interleaved_gradientNoise(), sunSSS_density > 0.0 && shadowMapFalloff2 < 1.0, hand); @@ -1174,12 +1227,12 @@ void main() { // combine shadowmap blocker depth with a minumum determined by the screenspace shadows, starting after the shadowmap ends ShadowBlockerDepth = mix(SS_directLight.g, ShadowBlockerDepth, shadowMapFalloff2); - // ShadowBlockerDepth = SS_directLight.g; #endif - Direct_SSS = SubsurfaceScattering_sun(albedo, ShadowBlockerDepth, sunSSS_density, clamp(dot(feetPlayerPos_normalized, WsunVec),0.0,1.0), SSS_shadow, shadowMapFalloff2 < 1.0); - Direct_SSS *= mix(LM_shadowMapFallback, 1.0, shadowMapFalloff2); + Direct_SSS = SubsurfaceScattering_sun(albedo, ShadowBlockerDepth, sunSSS_density, clamp(dot(feetPlayerPos_normalized, WsunVec),0.0,1.0), SSS_shadow, shadowMapFalloff2); + // Direct_SSS = vec3(1.0); + if (isEyeInWater == 0) Direct_SSS *= lightLeakFix; #ifndef SCREENSPACE_CONTACT_SHADOWS @@ -1206,7 +1259,7 @@ void main() { #ifdef OVERWORLD_SHADER Direct_lighting = max(DirectLightColor * NdotL * Shadows, DirectLightColor * Direct_SSS); - // Direct_lighting = 0.5 + DirectLightColor * exp(-7*SS_directLight.g); + // Direct_lighting = DirectLightColor * Direct_SSS; #endif gl_FragData[0].rgb = (Indirect_lighting + Direct_lighting) * albedo; @@ -1222,35 +1275,21 @@ void main() { gl_FragData[0].rgb *= Absorbtion; } - if(translucentMasks > 0.0){ #ifdef DISTANT_HORIZONS - vec4 vlBehingTranslucents = BilateralUpscale_DH(colortex13, colortex12, gl_FragCoord.xy, sqrt(texture2D(colortex12,texcoord).a/65000.0)); + vec4 vlBehingTranslucents = BilateralUpscale_VLFOG(colortex13, colortex12, gl_FragCoord.xy - 1.5, sqrt(texture2D(colortex12,texcoord).a/65000.0)); #else - vec4 vlBehingTranslucents = BilateralUpscale(colortex13, depthtex1, gl_FragCoord.xy, ld(z)); + vec4 vlBehingTranslucents = BilateralUpscale_VLFOG(colortex13, depthtex1, gl_FragCoord.xy - 1.5, ld(z)); #endif gl_FragData[0].rgb = gl_FragData[0].rgb * vlBehingTranslucents.a + vlBehingTranslucents.rgb; } - // #if defined VOLUMETRIC_CLOUDS && defined CLOUDS_INTERSECT_TERRAIN - // vec4 Clouds = texture2D_bicubic_offset(colortex0, ((gl_FragCoord.xy + 0.5)*texelSize)*CLOUDS_QUALITY, noise, RENDER_SCALE.x); - // // vec4 Clouds = BilateralUpscale_REUSE_Z_clouds(colortex0, colortex12, DH_mixedLinearZ, gl_FragCoord.xy*CLOUDS_QUALITY, texcoord*CLOUDS_QUALITY); - - // gl_FragData[1] = texture2D(colortex2, texcoord); - // gl_FragData[0].rgb = gl_FragData[0].rgb * Clouds.a + Clouds.rgb; - // gl_FragData[1].a = gl_FragData[1].a * pow(Clouds.a,5.0); - // #endif - - // gl_FragData[0].rgb = vec3(1.0) * clamp(1.0 - filteredShadow.y/1,0,1); - // if(hideGUI > 0) gl_FragData[0].rgb = vec3(1.0) * Shadows; ////// DEBUG VIEW STUFF - // #if DEBUG_VIEW == debug_SHADOWMAP - // vec3 OutsideShadowMap_and_DH_shadow = (shadowMapFalloff > 0.0 && z >= 1.0) ? vec3(0.25,1.0,0.25) : vec3(1.0,0.25,0.25); - // vec3 Normal_Shadowmap = z < 1.0 ? vec3(1.0,1.0,1.0) : OutsideShadowMap_and_DH_shadow; - // gl_FragData[0].rgb = mix(vec3(0.1) * (normal.y * 0.1 +0.9), Normal_Shadowmap, shadowMap) * 30.0; - // #endif + #if DEBUG_VIEW == debug_SHADOWMAP + gl_FragData[0].rgb = vec3(0.5) + vec3(1.0) * Shadows * 30.0; + #endif #if DEBUG_VIEW == debug_NORMALS if(swappedDepth >= 1.0) Direct_lighting = vec3(1.0); gl_FragData[0].rgb = normalize(worldToView(normal)); @@ -1271,11 +1310,11 @@ void main() { gl_FragData[0].rgb = viewPos * 0.001; #endif #if DEBUG_VIEW == debug_FILTERED_STUFF - if(hideGUI == 1) gl_FragData[0].rgb = vec3(1) * (1.0 - SSAO_SSS.y); - if(hideGUI == 0) gl_FragData[0].rgb = vec3(1) * (1.0 - SSAO_SSS.x); - // if(hideGUI == 0) gl_FragData[0].rgb = vec3(1) * filteredShadow.z;//exp(-7*(1-clamp(1.0 - filteredShadow.x,0.0,1.0))); + // if(hideGUI == 1) gl_FragData[0].rgb = vec3(1) * (1.0 - SSAO_SSS.y); + // if(hideGUI == 0) gl_FragData[0].rgb = vec3(1) * (1.0 - SSAO_SSS.x); + if(hideGUI == 0) gl_FragData[0].rgb = vec3(1) * exp(-10*filteredShadow.y);//exp(-7*(1-clamp(1.0 - filteredShadow.x,0.0,1.0))); #endif - // gl_FragData[0].rgb = vec3(1) * lightmap.y; + // gl_FragData[0].rgb = vec3(1) * Shadows; // if(swappedDepth >= 1.0) gl_FragData[0].rgb = vec3(0.1); // gl_FragData[0].rgb = vec3(1) * ld(texture2D(depthtex1, texcoord).r); // if(texcoord.x > 0.5 )gl_FragData[0].rgb = vec3(1) * ld(texture2D(depthtex0, texcoord).r); diff --git a/shaders/dimensions/composite12.fsh b/shaders/dimensions/composite12.fsh index 9b328b1..06a6e0a 100644 --- a/shaders/dimensions/composite12.fsh +++ b/shaders/dimensions/composite12.fsh @@ -1,32 +1,26 @@ #include "/lib/settings.glsl" varying vec2 texcoord; +uniform vec2 texelSize; uniform sampler2D colortex7; uniform sampler2D colortex14; uniform sampler2D depthtex0; -uniform vec2 texelSize; -uniform float frameTimeCounter; +uniform sampler2D noisetex; + uniform float viewHeight; uniform float viewWidth; uniform float aspectRatio; -uniform sampler2D shadow; -uniform sampler2D shadowcolor0; -uniform sampler2D shadowcolor1; -uniform sampler2D shadowtex0; -uniform sampler2D shadowtex1; -uniform sampler2D noisetex; +uniform float frameTimeCounter; -uniform vec3 previousCameraPosition; -uniform vec3 cameraPosition; +uniform int hideGUI; #include "/lib/color_transforms.glsl" #include "/lib/color_dither.glsl" #include "/lib/res_params.glsl" -uniform int hideGUI; - +/* vec4 SampleTextureCatmullRom(sampler2D tex, vec2 uv, vec2 texSize ) { // We're going to sample a a 4x4 grid of texels surrounding the target UV coordinate. We'll do this by rounding @@ -76,21 +70,19 @@ vec4 SampleTextureCatmullRom(sampler2D tex, vec2 uv, vec2 texSize ) return result; } - -/// thanks stackoverflow https://stackoverflow.com/questions/944713/help-with-pixel-shader-effect-for-brightness-and-contrast#3027595 -void applyContrast(inout vec3 color, float contrast){ - color = (color - 0.5) * contrast + 0.5; -} +*/ float lowerCurve(float x) { float y = 16 * x * (0.5 - x) * 0.1; return clamp(y, 0.0, 1.0); } + float upperCurve(float x) { float y = 16 * (0.5 - x) * (x - 1.0) * 0.1; return clamp(y, 0.0, 1.0); } -vec3 toneCurve(vec3 color){ + +vec3 luminanceCurve(vec3 color){ color.r += LOWER_CURVE * lowerCurve(color.r) + UPPER_CURVE * upperCurve(color.r); color.g += LOWER_CURVE * lowerCurve(color.g) + UPPER_CURVE * upperCurve(color.g); color.b += LOWER_CURVE * lowerCurve(color.b) + UPPER_CURVE * upperCurve(color.b); @@ -110,49 +102,57 @@ vec3 colorGrading(vec3 color) { return saturate(graded_shadows * shadows_amount + graded_mids * mids_amount + graded_highlights * highlights_amount); } +vec3 contrastAdaptiveSharpening(vec3 color, vec2 texcoord){ + + //Weights : 1 in the center, 0.5 middle, 0.25 corners + vec3 albedoCurrent1 = texture2D(colortex7, texcoord + vec2(texelSize.x,texelSize.y)/MC_RENDER_QUALITY*0.5).rgb; + vec3 albedoCurrent2 = texture2D(colortex7, texcoord + vec2(texelSize.x,-texelSize.y)/MC_RENDER_QUALITY*0.5).rgb; + vec3 albedoCurrent3 = texture2D(colortex7, texcoord + vec2(-texelSize.x,-texelSize.y)/MC_RENDER_QUALITY*0.5).rgb; + vec3 albedoCurrent4 = texture2D(colortex7, texcoord + vec2(-texelSize.x,texelSize.y)/MC_RENDER_QUALITY*0.5).rgb; + + vec3 m1 = -0.5/3.5*color + albedoCurrent1/3.5 + albedoCurrent2/3.5 + albedoCurrent3/3.5 + albedoCurrent4/3.5; + + vec3 std = abs(color - m1) + abs(albedoCurrent1 - m1) + abs(albedoCurrent2 - m1) + + abs(albedoCurrent3 - m1) + abs(albedoCurrent3 - m1) + abs(albedoCurrent4 - m1); + + float contrast = 1.0 - luma(std)/5.0; + + color = color*(1.0+(SHARPENING+UPSCALING_SHARPNENING)*contrast) - + (SHARPENING+UPSCALING_SHARPNENING)/(1.0-0.5/3.5)*contrast*(m1 - 0.5/3.5*color); + + return color; +} + +vec3 saturationAndCrosstalk(vec3 color){ + + float luminance = luma(color); + + vec3 lumaColDiff = color - luminance; + + color = color + lumaColDiff*(-luminance*CROSSTALK + SATURATION); + + return color; +} + void main() { /* DRAWBUFFERS:7 */ - #ifdef BICUBIC_UPSCALING - vec3 col = SampleTextureCatmullRom(colortex7,texcoord,1.0/texelSize).rgb; - #else - vec3 col = texture2D(colortex7,texcoord).rgb; - #endif - + vec3 color = texture2D(colortex7,texcoord).rgb; #ifdef CONTRAST_ADAPTATIVE_SHARPENING - //Weights : 1 in the center, 0.5 middle, 0.25 corners - vec3 albedoCurrent1 = texture2D(colortex7, texcoord + vec2(texelSize.x,texelSize.y)/MC_RENDER_QUALITY*0.5).rgb; - vec3 albedoCurrent2 = texture2D(colortex7, texcoord + vec2(texelSize.x,-texelSize.y)/MC_RENDER_QUALITY*0.5).rgb; - vec3 albedoCurrent3 = texture2D(colortex7, texcoord + vec2(-texelSize.x,-texelSize.y)/MC_RENDER_QUALITY*0.5).rgb; - vec3 albedoCurrent4 = texture2D(colortex7, texcoord + vec2(-texelSize.x,texelSize.y)/MC_RENDER_QUALITY*0.5).rgb; - - vec3 m1 = -0.5/3.5*col + albedoCurrent1/3.5 + albedoCurrent2/3.5 + albedoCurrent3/3.5 + albedoCurrent4/3.5; - vec3 std = abs(col - m1) + abs(albedoCurrent1 - m1) + abs(albedoCurrent2 - m1) + - - abs(albedoCurrent3 - m1) + abs(albedoCurrent3 - m1) + abs(albedoCurrent4 - m1); - - float contrast = 1.0 - luma(std)/5.0; - col = col*(1.0+(SHARPENING+UPSCALING_SHARPNENING)*contrast) - - (SHARPENING+UPSCALING_SHARPNENING)/(1.0-0.5/3.5)*contrast*(m1 - 0.5/3.5*col); + color = contrastAdaptiveSharpening(color, texcoord); #endif - - float lum = luma(col); - vec3 diff = col-lum; - col = col + diff*(-lum*CROSSTALK + SATURATION); - - vec3 FINAL_COLOR = clamp(int8Dither(col,texcoord),0.0,1.0); - - #ifdef TONE_CURVE - FINAL_COLOR = toneCurve(FINAL_COLOR); + + color = saturationAndCrosstalk(color); + + #ifdef LUMINANCE_CURVE + color = luminanceCurve(color); #endif #ifdef COLOR_GRADING_ENABLED - FINAL_COLOR = colorGrading(FINAL_COLOR); + color = colorGrading(color); #endif - applyContrast(FINAL_COLOR, CONTRAST); // for fun - - gl_FragData[0].rgb = FINAL_COLOR; + gl_FragData[0].rgb = clamp(int8Dither(color, texcoord),0.0,1.0); } diff --git a/shaders/dimensions/composite2.fsh b/shaders/dimensions/composite2.fsh index f61a4ed..c0e086d 100644 --- a/shaders/dimensions/composite2.fsh +++ b/shaders/dimensions/composite2.fsh @@ -1,9 +1,12 @@ #include "/lib/settings.glsl" +#define EXCLUDE_WRITE_TO_LUT + flat varying vec4 lightCol; flat varying vec3 averageSkyCol; flat varying vec3 averageSkyCol_Clouds; + uniform sampler2D noisetex; uniform sampler2D depthtex0; uniform sampler2D depthtex1; @@ -41,6 +44,7 @@ uniform ivec2 eyeBrightnessSmooth; uniform float eyeAltitude; uniform float caveDetection; +// uniform int dhRenderDistance; #define DHVLFOG #define diagonal3(m) vec3((m)[0].x, (m)[1].y, m[2].z) #define projMAD(m, v) (diagonal3(m) * (v) + (m)[3].xyz) @@ -66,6 +70,60 @@ float linearizeDepthFast(const in float depth, const in float near, const in flo return (near * far) / (depth * (near - far) + far); } +#if defined LPV_VL_FOG_ILLUMINATION && defined IS_LPV_ENABLED + + flat varying float exposure; + + #ifdef IS_LPV_ENABLED + #extension GL_ARB_shader_image_load_store: enable + #extension GL_ARB_shading_language_packing: enable + #endif + + #ifdef IS_LPV_ENABLED + uniform usampler1D texBlockData; + uniform sampler3D texLpv1; + uniform sampler3D texLpv2; + #endif + + // #ifdef IS_LPV_ENABLED + // uniform int heldItemId; + // uniform int heldItemId2; + // #endif + + #ifdef IS_LPV_ENABLED + #include "/lib/hsv.glsl" + #include "/lib/lpv_common.glsl" + #include "/lib/lpv_render.glsl" + #endif + + + vec3 LPV_FOG_ILLUMINATION(in vec3 playerPos, float dd, float dL){ + vec3 color = vec3(0.0); + + vec3 lpvPos = GetLpvPosition(playerPos); + + float fadeLength = 10.0; // in blocks + vec3 cubicRadius = clamp( min(((LpvSize3-1.0) - lpvPos)/fadeLength, lpvPos/fadeLength) ,0.0,1.0); + float LpvFadeF = cubicRadius.x*cubicRadius.y*cubicRadius.z; + + if(LpvFadeF > 0.0){ + + vec4 lpvSample = SampleLpvLinear(lpvPos); + + if(length(lpvSample.xyz) > 1e-5){ + vec3 LpvTorchLight = GetLpvBlockLight(lpvSample); + + vec3 lighting = LpvTorchLight; + float density = exp(-5.0 * clamp( 1.0 - length(lpvSample.xyz) / 16.0,0.0,1.0)) * (LPV_VL_FOG_ILLUMINATION_BRIGHTNESS/100) * LpvFadeF; + + color = lighting - lighting * exp(-density*dd*dL); + } + } + + return color; + } + +#endif #ifdef OVERWORLD_SHADER const bool shadowHardwareFiltering = true; @@ -77,12 +135,11 @@ float linearizeDepthFast(const in float depth, const in float near, const in flo #endif flat varying vec3 refractedSunVec; + // uniform int dhRenderDistance; #define TIMEOFDAYFOG #include "/lib/lightning_stuff.glsl" - - - #include "/lib/volumetricClouds.glsl" // #define CLOUDS_INTERSECT_TERRAIN + #include "/lib/volumetricClouds.glsl" #include "/lib/overworld_fog.glsl" #endif #ifdef NETHER_SHADER @@ -105,12 +162,10 @@ float interleaved_gradientNoise(){ return noise; } -// float interleaved_gradientNoise(){ -// return fract(52.9829189*fract(0.06711056*gl_FragCoord.x + 0.00583715*gl_FragCoord.y)+ 1.0/1.6180339887 * frameCounter); -// } float blueNoise(){ return fract(texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a+ 1.0/1.6180339887 * frameCounter ); } + float R2_dither(){ #ifdef TAA vec2 coord = gl_FragCoord.xy + (frameCounter%40000) * 2.0; @@ -166,75 +221,6 @@ void waterVolumetrics_notoverworld(inout vec3 inColor, vec3 rayStart, vec3 rayEn } -// #ifdef OVERWORLD_SHADER -// vec4 waterVolumetrics_test( vec3 rayStart, vec3 rayEnd, float estEndDepth, float estSunDepth, float rayLength, float dither, vec3 waterCoefs, vec3 scatterCoef, vec3 ambient, vec3 lightSource, float VdotL){ -// int spCount = rayMarchSampleCount; - -// vec3 start = toShadowSpaceProjected(rayStart); -// vec3 end = toShadowSpaceProjected(rayEnd); -// vec3 dV = (end-start); - -// //limit ray length at 32 blocks for performance and reducing integration error -// //you can't see above this anyway -// float maxZ = min(rayLength,12.0)/(1e-8+rayLength); -// dV *= maxZ; -// rayLength *= maxZ; -// estEndDepth *= maxZ; -// estSunDepth *= maxZ; - -// vec3 wpos = mat3(gbufferModelViewInverse) * rayStart + gbufferModelViewInverse[3].xyz; -// vec3 dVWorld = (wpos - gbufferModelViewInverse[3].xyz); - -// vec3 newabsorbance = exp(-rayLength * waterCoefs); // No need to take the integrated value - -// float phase = fogPhase(VdotL) * 5.0; -// vec3 absorbance = vec3(1.0); -// vec3 vL = vec3(0.0); - - -// float expFactor = 11.0; -// for (int i=0;i 0.99; - float z0 = texture2D(depthtex0,tc).x; + float z0 = texture2D(depthtex0, tc).x; #ifdef DISTANT_HORIZONS float DH_z0 = texture2D(dhDepthTex,tc).x; @@ -373,22 +376,8 @@ void main() { float DH_z0 = 0.0; #endif - float z = texture2D(depthtex1,tc).x; - - #ifdef DISTANT_HORIZONS - float DH_z = texture2D(dhDepthTex1,tc).x; - #else - float DH_z = 0.0; - #endif - - vec3 viewPos1 = toScreenSpace_DH(tc/RENDER_SCALE, z, DH_z); vec3 viewPos0 = toScreenSpace_DH(tc/RENDER_SCALE, z0, DH_z0); - vec3 playerPos = normalize(mat3(gbufferModelViewInverse) * viewPos1); - // vec3 lightningColor = (lightningEffect / 3) * (max(eyeBrightnessSmooth.y,0)/240.); - - - float dirtAmount = Dirt_Amount + 0.01; vec3 waterEpsilon = vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B); vec3 dirtEpsilon = vec3(Dirt_Absorb_R, Dirt_Absorb_G, Dirt_Absorb_B); @@ -399,24 +388,28 @@ void main() { vec3 indirectLightColor = averageSkyCol/30.0; vec3 indirectLightColor_dynamic = averageSkyCol_Clouds/30.0; + vec3 cloudDepth = vec3(0.0); + vec3 fogDepth = vec3(0.0); + + #if defined OVERWORLD_SHADER && defined CLOUDS_INTERSECT_TERRAIN + vec4 VolumetricClouds = renderClouds(viewPos0, vec2(noise_1,noise_2), directLightColor, indirectLightColor, cloudDepth); + #endif + #ifdef OVERWORLD_SHADER - vec4 VolumetricFog = GetVolumetricFog(viewPos0, vec2(noise_1,noise_2), directLightColor, indirectLightColor, averageSkyCol_Clouds/30.0); + vec4 VolumetricFog = GetVolumetricFog(viewPos0, vec2(noise_2,noise_1), directLightColor, indirectLightColor, averageSkyCol_Clouds/30.0, cloudDepth); #endif #if defined NETHER_SHADER || defined END_SHADER vec4 VolumetricFog = GetVolumetricFog(viewPos0, noise_1, noise_2); #endif - #if defined VOLUMETRIC_CLOUDS && defined CLOUDS_INTERSECT_TERRAIN - vec4 Clouds = texture2D(colortex0, (gl_FragCoord.xy*texelSize) / (VL_RENDER_RESOLUTION/CLOUDS_QUALITY)); - - VolumetricFog.rgb = Clouds.rgb * VolumetricFog.a + VolumetricFog.rgb; - - VolumetricFog.a = VolumetricFog.a*Clouds.a; + #if defined OVERWORLD_SHADER && defined CLOUDS_INTERSECT_TERRAIN + VolumetricFog = vec4(VolumetricClouds.rgb * VolumetricFog.a + VolumetricFog.rgb, VolumetricFog.a); #endif gl_FragData[0] = clamp(VolumetricFog, 0.0, 65000.0); + if (isEyeInWater == 1){ float estEyeDepth = clamp(eyeBrightnessSmooth.y/240.0,0.,1.0); @@ -432,4 +425,7 @@ void main() { } + #if defined OVERWORLD_SHADER && defined CLOUDS_INTERSECT_TERRAIN + gl_FragData[1] = vec4(VolumetricClouds.a,0.0,0.0,0.0); + #endif } \ No newline at end of file diff --git a/shaders/dimensions/composite2.vsh b/shaders/dimensions/composite2.vsh index 73b1744..6ca7c7c 100644 --- a/shaders/dimensions/composite2.vsh +++ b/shaders/dimensions/composite2.vsh @@ -6,6 +6,10 @@ flat varying vec4 lightCol; flat varying vec3 averageSkyCol; flat varying vec3 averageSkyCol_Clouds; +#if defined LPV_VL_FOG_ILLUMINATION && defined IS_LPV_ENABLED + flat varying float exposure; +#endif + #if defined Daily_Weather flat varying vec4 dailyWeatherParams0; flat varying vec4 dailyWeatherParams1; @@ -26,6 +30,16 @@ uniform mat4 gbufferModelViewInverse; uniform int frameCounter; +flat varying vec2 TAA_Offset; +uniform int framemod8; +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.); //////////////////////////////VOID MAIN////////////////////////////// //////////////////////////////VOID MAIN////////////////////////////// @@ -40,15 +54,8 @@ uniform float frameTimeCounter; void main() { gl_Position = ftransform(); - // gl_Position.xy = (gl_Position.xy*0.5+0.5)*0.51*2.0-1.0; gl_Position.xy = (gl_Position.xy*0.5+0.5)*(0.01+VL_RENDER_RESOLUTION)*2.0-1.0; - // #ifdef TAA - // tempOffsets = HaltonSeq2(frameCounter%10000); - // #else - // tempOffsets = 0.0; - // #endif - #ifdef OVERWORLD_SHADER lightCol.rgb = texelFetch2D(colortex4,ivec2(6,37),0).rgb; averageSkyCol = texelFetch2D(colortex4,ivec2(1,37),0).rgb; @@ -79,6 +86,16 @@ void main() { lightCol.a = float(sunElevation > 1e-5)*2.0 - 1.0; WsunVec = lightCol.a * normalize(mat3(gbufferModelViewInverse) * sunPosition); - refractedSunVec = refract(WsunVec, -vec3(0.0,1.0,0.0), 1.0/1.33333); + + #if defined LPV_VL_FOG_ILLUMINATION && defined IS_LPV_ENABLED + exposure = texelFetch2D(colortex4,ivec2(10,37),0).r; + #endif + + #ifdef TAA + TAA_Offset = offsets[framemod8]; + #else + TAA_Offset = vec2(0.0); + #endif + } diff --git a/shaders/dimensions/composite3.fsh b/shaders/dimensions/composite3.fsh index 9d85b2f..ecc4f9c 100644 --- a/shaders/dimensions/composite3.fsh +++ b/shaders/dimensions/composite3.fsh @@ -31,6 +31,7 @@ uniform sampler2D colortex10; uniform sampler2D colortex11; uniform sampler2D colortex12; uniform sampler2D colortex13; +uniform sampler2D colortex14; uniform sampler2D colortex15; uniform vec2 texelSize; @@ -71,7 +72,7 @@ uniform float caveDetection; #include "/lib/sky_gradient.glsl" #include "/lib/lightning_stuff.glsl" #include "/lib/climate_settings.glsl" - + //#define CLOUDS_INTERSECT_TERRAIN // #define CLOUDSHADOWSONLY // #include "/lib/volumetricClouds.glsl" #endif @@ -99,78 +100,6 @@ vec3 toScreenSpace(vec3 p) { #include "/lib/DistantHorizons_projections.glsl" -float DH_ld(float dist) { - return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane)); -} -float DH_inv_ld (float lindepth){ - return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane); -} -float linearizeDepthFast(const in float depth, const in float near, const in float far) { - return (near * far) / (depth * (near - far) + far); -} - -vec4 BilateralUpscale(sampler2D tex, sampler2D depth, vec2 coord, float referenceDepth){ - ivec2 scaling = ivec2(1.0/VL_RENDER_RESOLUTION); - ivec2 posDepth = ivec2(coord*VL_RENDER_RESOLUTION) * scaling; - ivec2 posColor = ivec2(coord*VL_RENDER_RESOLUTION); - ivec2 pos = ivec2(gl_FragCoord.xy*texelSize + 1); - ivec2 getRadius[4] = ivec2[]( - ivec2(-2,-2), - ivec2(-2, 0), - ivec2( 0, 0), - ivec2( 0,-2) - ); - - #ifdef DISTANT_HORIZONS - float diffThreshold = 0.01; - #else - float diffThreshold = zMults.x; - #endif - - - vec4 RESULT = vec4(0.0); - float SUM = 0.0; - - for (int i = 0; i < 4; i++) { - - ivec2 radius = getRadius[i]; - - #ifdef DISTANT_HORIZONS - float offsetDepth = sqrt(texelFetch2D(depth, posDepth + radius * scaling + pos * scaling,0).a/65000.0); - #else - float offsetDepth = ld(texelFetch2D(depth, posDepth + radius * scaling + pos * scaling, 0).r); - #endif - - float EDGES = abs(offsetDepth - referenceDepth) < diffThreshold ? 1.0 : 1e-5; - - RESULT += texelFetch2D(tex, posColor + radius + pos, 0) * EDGES; - - SUM += EDGES; - } - // return vec4(1) * SUM; - return RESULT / SUM; - -} - -vec3 decode (vec2 encn){ - vec3 n = vec3(0.0); - encn = encn * 2.0 - 1.0; - n.xy = abs(encn); - n.z = 1.0 - n.x - n.y; - n.xy = n.z <= 0.0 ? (1.0 - n.yx) * sign(encn) : encn; - return clamp(normalize(n.xyz),-1.0,1.0); -} -vec2 decodeVec2(float a){ - const vec2 constant1 = 65535. / vec2( 256., 65536.); - const float constant2 = 256. / 255.; - return fract( a * constant1 ) * constant2 ; -} - -vec3 worldToView(vec3 worldPos) { - vec4 pos = vec4(worldPos, 0.0); - pos = gbufferModelView * pos; - return pos.xyz; -} float blueNoise(){ return fract(texelFetch2D(noisetex, ivec2(gl_FragCoord.xy)%512, 0).a + 1.0/1.6180339887 * frameCounter); } @@ -186,6 +115,87 @@ float interleaved_gradientNoise(){ float noise = fract(52.9829189*fract(0.06711056*coord.x + 0.00583715*coord.y)); return noise; } + +float DH_ld(float dist) { + return (2.0 * dhNearPlane) / (dhFarPlane + dhNearPlane - dist * (dhFarPlane - dhNearPlane)); +} +float DH_inv_ld (float lindepth){ + return -((2.0*dhNearPlane/lindepth)-dhFarPlane-dhNearPlane)/(dhFarPlane-dhNearPlane); +} +float linearizeDepthFast(const in float depth, const in float near, const in float far) { + return (near * far) / (depth * (near - far) + far); +} +vec2 decodeVec2(float a){ + const vec2 constant1 = 65535. / vec2( 256., 65536.); + const float constant2 = 256. / 255.; + return fract( a * constant1 ) * constant2 ; +} +vec4 BilateralUpscale(sampler2D tex, sampler2D tex2, sampler2D depth, vec2 coord, float referenceDepth, inout float CLOUDALPHA){ + ivec2 scaling = ivec2(1.0/VL_RENDER_RESOLUTION); + ivec2 posDepth = ivec2(coord*VL_RENDER_RESOLUTION) * scaling; + ivec2 posColor = ivec2(coord*VL_RENDER_RESOLUTION); + ivec2 pos = ivec2(gl_FragCoord.xy*texelSize + 1); + + ivec2 getRadius[5] = ivec2[]( + ivec2(-1,-1), + ivec2( 1, 1), + ivec2(-1, 1), + ivec2( 1,-1), + ivec2( 0, 0) + ); + + #ifdef DISTANT_HORIZONS + float diffThreshold = 0.01; + #else + float diffThreshold = zMults.x; + #endif + + vec4 RESULT = vec4(0.0); + float SUM = 0.0; + + for (int i = 0; i < 5; i++) { + + ivec2 radius = getRadius[i]; + + #ifdef DISTANT_HORIZONS + float offsetDepth = sqrt(texelFetch2D(depth, posDepth + radius * scaling + pos * scaling,0).a/65000.0); + #else + float offsetDepth = ld(texelFetch2D(depth, posDepth + radius * scaling + pos * scaling, 0).r); + #endif + + float EDGES = abs(offsetDepth - referenceDepth) < diffThreshold ? 1.0 : 1e-5; + + RESULT += texelFetch2D(tex, posColor + radius + pos, 0) * EDGES; + + #if defined OVERWORLD_SHADER && defined CLOUDS_INTERSECT_TERRAIN + CLOUDALPHA += texelFetch2D(tex2, posColor + radius + pos, 0).x * EDGES; + #endif + + SUM += EDGES; + } + + #if defined OVERWORLD_SHADER && defined CLOUDS_INTERSECT_TERRAIN + CLOUDALPHA = CLOUDALPHA / SUM; + #endif + + return RESULT / SUM; +} + +vec3 decode (vec2 encn){ + vec3 n = vec3(0.0); + encn = encn * 2.0 - 1.0; + n.xy = abs(encn); + n.z = 1.0 - n.x - n.y; + n.xy = n.z <= 0.0 ? (1.0 - n.yx) * sign(encn) : encn; + return clamp(normalize(n.xyz),-1.0,1.0); +} + + +vec3 worldToView(vec3 worldPos) { + vec4 pos = vec4(worldPos, 0.0); + pos = gbufferModelView * pos; + return pos.xyz; +} vec3 viewToWorld(vec3 viewPosition) { vec4 pos; pos.xyz = viewPosition; @@ -293,14 +303,18 @@ void main() { bool isEntity = abs(translucentMasks - 0.9) < 0.01 || isReflectiveEntity; ////// --------------- get volumetrics - #ifdef TOGGLE_VL_FOG - #ifdef DISTANT_HORIZONS - vec4 vl = BilateralUpscale(colortex0, colortex12, gl_FragCoord.xy - 1.5, sqrt(texture2D(colortex12,texcoord).a/65000.0)); - #else - vec4 vl = BilateralUpscale(colortex0, depthtex0, gl_FragCoord.xy - 1.5, frDepth); - #endif + + + #if defined OVERWORLD_SHADER && defined CLOUDS_INTERSECT_TERRAIN + float cloudAlpha = 0.0; #else - vec4 vl = vec4(0,0,0,1); + float cloudAlpha = 1.0; + #endif + + #ifdef DISTANT_HORIZONS + vec4 vl = BilateralUpscale(colortex0, colortex14, colortex12, gl_FragCoord.xy - 1.5, sqrt(texture2D(colortex12,texcoord).a/65000.0), cloudAlpha); + #else + vec4 vl = BilateralUpscale(colortex0, colortex14, depthtex0, gl_FragCoord.xy - 1.5, frDepth,cloudAlpha); #endif float bloomyFogMult = 1.0; @@ -330,11 +344,9 @@ void main() { fog *= exp(-10.0 * pow(clamp(np3.y,0.0,1.0)*4.0,2.0)); - fog *= caveDetection; + fog *= (1.0-caveDetection); if(swappedDepth >= 1.0 || isEyeInWater != 0) fog = 0.0; - - #ifdef SKY_GROUND vec3 borderFogColor = skyGroundColor; @@ -366,32 +378,33 @@ void main() { #if defined OVERWORLD_SHADER && defined CAVE_FOG if (isEyeInWater == 0 && eyeAltitude < 1500){ - float cavefog = pow(1.0 - max(1.0 - linearDistance/far,0.0),2.0); - - vec3 cavefogCol = vec3(CaveFogColor_R, CaveFogColor_G, CaveFogColor_B) * cavefog; - - cavefogCol *= exp(-7.0*clamp(normalize(np3).y*0.5+0.5,0.0,1.0)) * 0.999 + 0.001; + vec3 cavefogCol = vec3(CaveFogColor_R, CaveFogColor_G, CaveFogColor_B); #ifdef PER_BIOME_ENVIRONMENT BiomeFogColor(cavefogCol); #endif + cavefogCol *= pow(1.0 - max(1.0 - linearDistance/far,0.0),2.0); + cavefogCol *= exp(-7.0*clamp(normalize(np3).y*0.5+0.5,0.0,1.0)) * 0.999 + 0.001; + float skyhole = pow(clamp(1.0-pow(max(np3.y - 0.6,0.0)*5.0,2.0),0.0,1.0),2); color.rgb = mix(color.rgb + cavefogCol * caveDetection, cavefogCol, z >= 1.0 ? skyhole * caveDetection : 0.0); } #endif -////// --------------- Distance fog for the end shader #ifdef END_SHADER - if (isEyeInWater == 0){ - vec3 hazeColor = vec3(0.3,0.75,1.0) * 0.3; + // create a point that "glows" but in worldspace. + + // this is not correct but whatever + float CenterdotV = dot(normalize(vec3(0.0,400.0,0.0) - cameraPosition), normalize(p3 + cameraPosition)); - float hazeDensity = clamp(1.0 - linearDistance / max(far, 32.0 * 24.0),0.0,1.0); - color.rgb = mix(hazeColor, color.rgb, hazeDensity) ; - } + float distanceFadeOff = pow(min(max(length(cameraPosition)-300.0,0.0)/100.0,1.0),2.0); + + color.rgb += vec3(0.1,0.5,1.0) * (exp2(-10.0 * max(-CenterdotV*0.5+0.5,0.0)) + exp(-150.0 * max(-CenterdotV*0.5+0.5,0.0))) * distanceFadeOff; #endif + ////// --------------- underwater fog if (isEyeInWater == 1){ float dirtAmount = Dirt_Amount + 0.01; @@ -421,9 +434,7 @@ void main() { ////// --------------- BLEND FOG INTO SCENE //////////// apply VL fog over opaque and translucents - // color += skyGroundColor * (1.0 - pow(max(1.0 - linearDistance/far,0.0),3.0)) * rainStrength; - - color *= vl.a; + color *= vl.a*cloudAlpha; color += vl.rgb; bloomyFogMult *= mix(vl.a,vl.a*0.5 + 0.5, rainStrength); @@ -462,7 +473,7 @@ void main() { vl.a = 1.0; } #endif - + gl_FragData[0].r = bloomyFogMult; // pass fog alpha so bloom can do bloomy fog gl_FragData[1].rgb = clamp(color.rgb, 0.0,68000.0); // gl_FragData[1].rgb = vec3(tangentNormals.xy,0.0) ; diff --git a/shaders/dimensions/deferred.fsh b/shaders/dimensions/deferred.fsh index bb8a0df..3009a88 100644 --- a/shaders/dimensions/deferred.fsh +++ b/shaders/dimensions/deferred.fsh @@ -117,7 +117,6 @@ float DH_inv_ld (float lindepth){ float linearizeDepthFast(const in float depth, const in float near, const in float far) { return (near * far) / (depth * (near - far) + far); } - #ifdef OVERWORLD_SHADER // uniform sampler2D colortex12; @@ -280,12 +279,13 @@ if (gl_FragCoord.x > 18.+257. && gl_FragCoord.y > 1. && gl_FragCoord.x < 18+257+ #ifdef ambientLight_only suncol = vec3(0.0); #endif + vec3 cloudDepth = vec3(0.0); - vec4 clouds = renderClouds(mat3(gbufferModelView)*viewVector*1024., vec2(fract(frameCounter/1.6180339887),1-fract(frameCounter/1.6180339887)), suncol*2.0, skyGroundCol/30.0); + vec4 clouds = renderClouds(mat3(gbufferModelView)*viewVector*1024., vec2(fract(frameCounter/1.6180339887),1-fract(frameCounter/1.6180339887)), suncol*2.0, skyGroundCol/30.0,cloudDepth); sky = sky*clouds.a + clouds.rgb / 5.0; sky = mix(dot(sky, vec3(0.333)) * vec3(0.5), sky, pow(clamp(viewVector.y+1.0,0.0,1.0),5)); - vec4 VL_Fog = GetVolumetricFog(mat3(gbufferModelView)*viewVector*1024., vec2(fract(frameCounter/1.6180339887),1-fract(frameCounter/1.6180339887)), suncol*1.75, skyGroundCol/30.0, averageSkyCol_Clouds/30.0); + vec4 VL_Fog = GetVolumetricFog(mat3(gbufferModelView)*viewVector*1024., vec2(fract(frameCounter/1.6180339887),1-fract(frameCounter/1.6180339887)), suncol*1.75, skyGroundCol/30.0, averageSkyCol_Clouds/30.0,cloudDepth); sky = sky * VL_Fog.a + VL_Fog.rgb / 5.0; diff --git a/shaders/dimensions/deferred.vsh b/shaders/dimensions/deferred.vsh index e8037a6..567572a 100644 --- a/shaders/dimensions/deferred.vsh +++ b/shaders/dimensions/deferred.vsh @@ -1,6 +1,7 @@ #include "/lib/settings.glsl" #include "/lib/res_params.glsl" +// uniform int dhRenderDistance; uniform float frameTimeCounter; #include "/lib/Shadow_Params.glsl" @@ -145,7 +146,8 @@ void main() { } // maximum control of color and luminance - vec3 minimumlight = vec3(0.5,0.75,1.0) * (MIN_LIGHT_AMOUNT*0.001 + nightVision); + // vec3 minimumlight = vec3(0.5,0.75,1.0) * (MIN_LIGHT_AMOUNT*0.001 + nightVision); + vec3 minimumlight = vec3(0.5,0.75,1.0) * nightVision; averageSkyCol_Clouds = max( normalize(averageSkyCol_Clouds) * min(luma(averageSkyCol_Clouds) * 3.0,2.5) * (1.0-rainStrength*0.3), minimumlight); averageSkyCol = max(averageSkyCol * PLANET_GROUND_BRIGHTNESS, minimumlight); @@ -251,7 +253,10 @@ void main() { float targetrodExposure = max(0.012/log2(avgL2+1.002)-0.1,0.0)*1.2; - exposure = max(targetExposure*EXPOSURE_MULTIPLIER, 0); + exposure = max(targetExposure*EXPOSURE_MULTIPLIER, 0.0); + // exposure = mix(0.0, 1.0, min(targetExposure,1.0)); + // exposure = 1; + float currCenterDepth = ld(texture2D(depthtex2, vec2(0.5)).r); centerDepth = mix(sqrt(texelFetch2D(colortex4,ivec2(14,37),0).g/65000.0), currCenterDepth, clamp(DoF_Adaptation_Speed*exp(-0.016/frameTime+1.0)/(6.0+currCenterDepth*far),0.0,1.0)); centerDepth = centerDepth * centerDepth * 65000.0; diff --git a/shaders/dimensions/deferred2.fsh b/shaders/dimensions/deferred2.fsh index 760bb1c..526127d 100644 --- a/shaders/dimensions/deferred2.fsh +++ b/shaders/dimensions/deferred2.fsh @@ -105,7 +105,7 @@ uniform int dhRenderDistance; #include "/lib/res_params.glsl" // #define CLOUDS_INTERSECT_TERRAIN - +uniform float eyeAltitude; #include "/lib/volumetricClouds.glsl" @@ -123,7 +123,10 @@ uniform int dhRenderDistance; void main() { /* DRAWBUFFERS:0 */ - #if defined OVERWORLD_SHADER && defined VOLUMETRIC_CLOUDS + + + + #if defined OVERWORLD_SHADER && defined VOLUMETRIC_CLOUDS && !defined CLOUDS_INTERSECT_TERRAIN vec2 halfResTC = vec2(floor(gl_FragCoord.xy)/CLOUDS_QUALITY/RENDER_SCALE+0.5+offsets[framemod8]*CLOUDS_QUALITY*RENDER_SCALE*0.5); vec2 halfResTC2 = vec2(floor(gl_FragCoord.xy)/CLOUDS_QUALITY+0.5+offsets[framemod8]*CLOUDS_QUALITY*0.5); @@ -141,8 +144,8 @@ void main() { vec3 viewPos = toScreenSpace(vec3(halfResTC*texelSize, 1.0)); #endif - - vec4 VolumetricClouds = renderClouds(viewPos, vec2(R2_dither(), blueNoise()), sunColor/80.0, averageSkyCol/30.0); + vec3 tesvar = vec3(0.0); + vec4 VolumetricClouds = renderClouds(viewPos, vec2(R2_dither(), blueNoise()), sunColor/80.0, averageSkyCol/30.0,tesvar); gl_FragData[0] = VolumetricClouds; #else diff --git a/shaders/dimensions/deferred2.vsh b/shaders/dimensions/deferred2.vsh index e0a9b1b..cc7f26b 100644 --- a/shaders/dimensions/deferred2.vsh +++ b/shaders/dimensions/deferred2.vsh @@ -1,5 +1,6 @@ #include "/lib/settings.glsl" +// uniform int dhRenderDistance; #if defined Daily_Weather flat varying vec4 dailyWeatherParams0; flat varying vec4 dailyWeatherParams1; diff --git a/shaders/dimensions/final.fsh b/shaders/dimensions/final.fsh index 98a5c1e..12d3420 100644 --- a/shaders/dimensions/final.fsh +++ b/shaders/dimensions/final.fsh @@ -85,6 +85,8 @@ vec3 doMotionBlur(vec2 texcoord, float depth, float noise){ return color / samples; } +uniform sampler2D shadowcolor1; + void main() { float depth = texture2D(depthtex0,texcoord*RENDER_SCALE).r; @@ -105,5 +107,13 @@ void main() { doCameraGridLines(COLOR, texcoord); #endif + #if DEBUG_VIEW == debug_SHADOWMAP + + vec2 shadowUV = texcoord * vec2(2.0, 1.0); + + if(shadowUV.x < 1.0 && shadowUV.y < 1.0 && hideGUI == 1)COLOR = texture2D(shadowcolor1,shadowUV).rgb; + #endif + + gl_FragColor.rgb = COLOR; } diff --git a/shaders/dimensions/fogBehindTranslucent_pass.fsh b/shaders/dimensions/fogBehindTranslucent_pass.fsh index de96cbb..6f1ffb1 100644 --- a/shaders/dimensions/fogBehindTranslucent_pass.fsh +++ b/shaders/dimensions/fogBehindTranslucent_pass.fsh @@ -11,6 +11,7 @@ flat varying vec3 averageSkyCol; flat varying vec3 averageSkyCol_Clouds; flat varying float exposure; +// uniform int dhRenderDistance; uniform sampler2D noisetex; uniform sampler2D depthtex0; uniform sampler2D depthtex1; @@ -91,6 +92,7 @@ float linearizeDepthFast(const in float depth, const in float near, const in flo #define TIMEOFDAYFOG #include "/lib/lightning_stuff.glsl" + // #define CLOUDS_INTERSECT_TERRAIN // #define CLOUDSHADOWSONLY #include "/lib/volumetricClouds.glsl" #include "/lib/overworld_fog.glsl" @@ -286,42 +288,45 @@ vec2 decodeVec2(float a){ void main() { /* RENDERTARGETS:13 */ - float noise_1 = R2_dither(); - float noise_2 = blueNoise(); - + gl_FragData[0] = vec4(0,0,0,1); vec2 tc = floor(gl_FragCoord.xy)/VL_RENDER_RESOLUTION*texelSize+0.5*texelSize; bool iswater = texture2D(colortex7,tc).a > 0.99; - float z0 = texture2D(depthtex0,tc).x; - - #ifdef DISTANT_HORIZONS - float DH_z0 = texture2D(dhDepthTex,tc).x; - #else - float DH_z0 = 0.0; - #endif - - float z = texture2D(depthtex1,tc).x; + ////////////////////////////////////////////////////////// + ///////////////// BEHIND OF TRANSLUCENTS ///////////////// + ////////////////////////////////////////////////////////// - #ifdef DISTANT_HORIZONS - float DH_z = texture2D(dhDepthTex1,tc).x; - #else - float DH_z = 0.0; - #endif - - vec3 viewPos1 = toScreenSpace_DH(tc/RENDER_SCALE, z, DH_z); - vec3 viewPos0 = toScreenSpace_DH(tc/RENDER_SCALE, z0, DH_z0); + if(texture2D(colortex2, tc).a > 0.0 || iswater){ + + float noise_1 = R2_dither(); + float noise_2 = blueNoise(); - vec3 playerPos = normalize(mat3(gbufferModelViewInverse) * viewPos1); - // vec3 lightningColor = (lightningEffect / 3) * (max(eyeBrightnessSmooth.y,0)/240.); - - float dirtAmount = Dirt_Amount + 0.1; - // float dirtAmount = Dirt_Amount + 0.01; - vec3 waterEpsilon = vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B); - vec3 dirtEpsilon = vec3(Dirt_Absorb_R, Dirt_Absorb_G, Dirt_Absorb_B); - vec3 totEpsilon = dirtEpsilon*dirtAmount + waterEpsilon; - vec3 scatterCoef = dirtAmount * vec3(Dirt_Scatter_R, Dirt_Scatter_G, Dirt_Scatter_B) / 3.14; + float z0 = texture2D(depthtex0,tc).x; + + #ifdef DISTANT_HORIZONS + float DH_z0 = texture2D(dhDepthTex,tc).x; + #else + float DH_z0 = 0.0; + #endif + + float z = texture2D(depthtex1,tc).x; + + #ifdef DISTANT_HORIZONS + float DH_z = texture2D(dhDepthTex1,tc).x; + #else + float DH_z = 0.0; + #endif + + // vec3 lightningColor = (lightningEffect / 3) * (max(eyeBrightnessSmooth.y,0)/240.); + + float dirtAmount = Dirt_Amount + 0.1; + // float dirtAmount = Dirt_Amount + 0.01; + vec3 waterEpsilon = vec3(Water_Absorb_R, Water_Absorb_G, Water_Absorb_B); + vec3 dirtEpsilon = vec3(Dirt_Absorb_R, Dirt_Absorb_G, Dirt_Absorb_B); + vec3 totEpsilon = dirtEpsilon*dirtAmount + waterEpsilon; + vec3 scatterCoef = dirtAmount * vec3(Dirt_Scatter_R, Dirt_Scatter_G, Dirt_Scatter_B) / 3.14; #ifdef BIOME_TINT_WATER // yoink the biome tint written in this buffer for water only. @@ -332,17 +337,14 @@ void main() { } #endif - vec3 directLightColor = lightCol.rgb/80.0; - vec3 indirectLightColor = averageSkyCol/30.0; - vec3 indirectLightColor_dynamic = averageSkyCol_Clouds/30.0; + vec3 directLightColor = lightCol.rgb/80.0; + vec3 indirectLightColor = averageSkyCol/30.0; + vec3 indirectLightColor_dynamic = averageSkyCol_Clouds/30.0; - ////////////////////////////////////////////////////////// - ///////////////// BEHIND OF TRANSLUCENTS ///////////////// - ////////////////////////////////////////////////////////// + vec3 viewPos1 = toScreenSpace_DH(tc/RENDER_SCALE, z, DH_z); + vec3 viewPos0 = toScreenSpace_DH(tc/RENDER_SCALE, z0, DH_z0); + vec3 playerPos = normalize(mat3(gbufferModelViewInverse) * viewPos1); - - if(texture2D(colortex2, tc).a > 0.0 || iswater){ - #ifdef OVERWORLD_SHADER // vec2 lightmap = decodeVec2(texture2D(colortex14, tc).a); @@ -365,19 +367,30 @@ void main() { // float TorchBrightness_autoAdjust = mix(1.0, 30.0, clamp(exp(-10.0*exposure),0.0,1.0)) ; // indirectLightColor_dynamic += vec3(TORCH_R,TORCH_G,TORCH_B) * TorchBrightness_autoAdjust * pow(1.0-sqrt(1.0-clamp(lightmap.x,0.0,1.0)),2.0) * 2.0; + vec3 cloudDepth = vec3(0.0); vec4 VolumetricFog2 = vec4(0,0,0,1); + vec4 VolumetricClouds = vec4(0,0,0,1); + #ifdef OVERWORLD_SHADER - if(!iswater) VolumetricFog2 = GetVolumetricFog(viewPos1, vec2(noise_1, noise_2), directLightColor, indirectLightColor,indirectLightColor_dynamic); + if(!iswater){ + + #if defined CLOUDS_INTERSECT_TERRAIN + VolumetricClouds = renderClouds(viewPos1, vec2(noise_1,noise_2), directLightColor, indirectLightColor, cloudDepth); + #endif + + VolumetricFog2 = GetVolumetricFog(viewPos1, vec2(noise_1, noise_2), directLightColor, indirectLightColor,indirectLightColor_dynamic,cloudDepth); + + #if defined CLOUDS_INTERSECT_TERRAIN + VolumetricFog2 = vec4(VolumetricClouds.rgb * VolumetricFog2.a + VolumetricFog2.rgb, VolumetricFog2.a*VolumetricClouds.a); + #endif + } #endif vec4 underwaterVlFog = vec4(0,0,0,1); if(iswater) underwaterVlFog = waterVolumetrics_test(viewPos0, viewPos1, estimatedDepth, estimatedSunDepth, Vdiff, noise_1, totEpsilon, scatterCoef, indirectLightColor_dynamic, directLightColor, dot(normalize(viewPos1), normalize(sunVec*lightCol.a)) ); - + vec4 fogFinal = vec4(underwaterVlFog.rgb * VolumetricFog2.a + VolumetricFog2.rgb, VolumetricFog2.a * underwaterVlFog.a); gl_FragData[0] = clamp(fogFinal, 0.0, 65000.0); - - }else{ - gl_FragData[0] = vec4(0,0,0,1); } } \ No newline at end of file diff --git a/shaders/dimensions/setup.csh b/shaders/dimensions/setup.csh index 43c599e..ce87bdb 100644 --- a/shaders/dimensions/setup.csh +++ b/shaders/dimensions/setup.csh @@ -441,7 +441,8 @@ void main() { } if (blockId == BLOCK_CAVE_VINE_BERRIES || blockId == ITEM_GLOW_BERRIES) { - lightColor = vec3(0.651, 0.369, 0.157); + lightColor = vec3(1.0, 1.0, 0.5); + lightRange = 14.0; mixWeight = 1.0; } @@ -524,7 +525,7 @@ void main() { } if (blockId == BLOCK_GLOW_LICHEN || blockId == ITEM_GLOW_LICHEN) { - lightColor = vec3(0.092, 0.217, 0.126); + lightColor = vec3(0.1, 0.2, 0.12); lightRange = 7.0; } diff --git a/shaders/lang/en_us.lang b/shaders/lang/en_us.lang index 45bf847..c53192b 100644 --- a/shaders/lang/en_us.lang +++ b/shaders/lang/en_us.lang @@ -1,20 +1,19 @@ -option.BLISS_SHADERS=Bliss - value.BLISS_SHADERS.0=A Chocapic13 Edit - value.BLISS_SHADERS.1=By Xonk - value.BLISS_SHADERS.2=Version GIT-HEAD +option.SHADER_VERSION_LABEL = Bliss In-Dev Commit Number # if you're here to translate, this is a joke, these don't do what they say profile.QUALITY=Quality profile.PERFORMANCE=Performance -screen.Misc_Settings = Misc. Settings +screen.Misc_Settings = §cDebugging§r/Experimental Settings screen.Sun_and_Moon_Colors = Sun/Moon Colors option.sunPathRotation = Sun Angle option.sun_illuminance = Sun Illuminance option.moon_illuminance = Moon Illuminance option.MOONPHASE_BASED_MOONLIGHT = Moonphase brightness levels -option.RESOURCEPACK_SKY = ResourcePack Sky +screen.Mod_support = Settings For Supported Mods + +option.RESOURCEPACK_SKY = Resource Pack Sky value.RESOURCEPACK_SKY.0 = Do not use value.RESOURCEPACK_SKY.1 = Sky + Shader sun/moon value.RESOURCEPACK_SKY.2 = Full sky @@ -109,6 +108,9 @@ screen.Direct_Light = Direct Light option.LPV_REDSTONE_LIGHTS = Redstone Lights option.LPV_COLORED_CANDLES = Colored Candles option.LPV_NOSHADOW_HACK = Iris <= 1.7.0 Fix + option.LPV_VL_FOG_ILLUMINATION = Fog Light Propagation + option.LPV_VL_FOG_ILLUMINATION_BRIGHTNESS = Fog Light Propagation Brightness + suffix.LPV_VL_FOG_ILLUMINATION_BRIGHTNESS=% screen.Subsurface_Scattering = Sub-Surface Scattering option.LabSSS_Curve = LabSSS Curve @@ -417,7 +419,7 @@ screen.Post_Processing = Post Processing option.TAA_UPSCALING = Temporal Upscaling option.SCALE_FACTOR = Scale Factor screen.COLOR_GRADING = Color Grading - option.TONE_CURVE = Tone Curve + option.LUMINANCE_CURVE = Tone Curve option.LOWER_CURVE = Lower Curve option.UPPER_CURVE = Upper Curve option.COLOR_GRADING_ENABLED=Color Grading @@ -552,7 +554,9 @@ screen.Ambient_light.comment = Configure settings related to the lighting in sha option.LPV_REDSTONE_LIGHTS.comment = Allows redstone blocks to contribute to colored lighting. option.LPV_COLORED_CANDLES.comment = Allows colored candles to emit matching colored lighting. option.LPV_NOSHADOW_HACK.comment = Fix for Iris 1.7.0 and lower! Allows floodfill to work in Nether & End, but disables entity & dropped item lights. - + option.LPV_VL_FOG_ILLUMINATION.comment = Allow the colored lighting to light up the air around it. + option.LPV_VL_FOG_ILLUMINATION_BRIGHTNESS.comment = Configure the brightness of lit up fog. + screen.Resource_Pack_Support.comment = A handfull of effects that use information provided by a resourcepack. screen.Reflections.comment = Configure the reflections that use information provided by a LabPBR resourcepack. option.Specular_Reflections.comment = Toggle all reflections for Labpbr packs. This enables the sun reflection, and allows other settings to be enabled below. §aPERFORMANCE COST:§r low @@ -668,7 +672,7 @@ screen.Post_Processing.comment = Configure settings for all post processing effe option.TAA_UPSCALING.comment = Toggle temporal upscaling. This retains a good amount of quality from a lower resolution image when it upscales. so you can still have a high looking resolution compared to typical upsanpling and still have better performance. option.SCALE_FACTOR.comment = Configure from what fraction of your resolution to upscale from. Below 0.5 is not recommended at all i only have it as an option because it's funny :P screen.COLOR_GRADING.comment = Advanced color grading options - option.TONE_CURVE.comment = Enable the tone curve. This is independent from color grading and is applied first. + option.LUMINANCE_CURVE.comment = Enable the tone curve. This is independent from color grading and is applied first. option.COLOR_GRADING_ENABLED.comment = Enable color grading. The RGB sliders will not affect the brightness. This is applied after the tone curve option.RESOURCEPACK_SKY.comment = Toggle resourcepack sky support. Configure settings to use the whole resourcepack sky, or keep the shader's sun and moon. §aPERFORMANCE COST:§r very low diff --git a/shaders/lang/pt_br.lang b/shaders/lang/pt_br.lang index ae30615..ef7718c 100644 --- a/shaders/lang/pt_br.lang +++ b/shaders/lang/pt_br.lang @@ -1,3 +1,5 @@ +option.SHADER_VERSION_LABEL = Bliss In-Dev Commit Number + screen.Misc_Settings = Configurações Diversas screen.the_orb = O Orb option.THE_ORB = O Orb diff --git a/shaders/lang/ru_RU.lang b/shaders/lang/ru_RU.lang index fea8fb0..d612ebd 100644 --- a/shaders/lang/ru_RU.lang +++ b/shaders/lang/ru_RU.lang @@ -1,8 +1,4 @@ -option.BLISS_SHADERS = Шейдер Bliss - value.BLISS_SHADERS.0 = Редакция Chocapic13 - value.BLISS_SHADERS.1 = Автор Xonk - value.BLISS_SHADERS.2 = Версия GIT-HEAD - option.BLISS_SHADERS.comment = Информация о шейдере +option.SHADER_VERSION_LABEL = Bliss In-Dev Commit Number profile.QUALITY = Качество profile.PERFORMANCE = Представление @@ -421,7 +417,7 @@ screen.Post_Processing = Постобработка option.DoF_Adaptation_Speed = Скорость адаптации DoF option.FAR_BLUR_ONLY = Только дальнее размытие screen.COLOR_GRADING = Расширенная цветокоррекция - option.TONE_CURVE = Кривая тона + option.LUMINANCE_CURVE = Кривая тона option.LOWER_CURVE = Нижняя кривая option.UPPER_CURVE = Верхняя кривая option.COLOR_GRADING_ENABLED = Расширенная цветокоррекция @@ -704,7 +700,7 @@ screen.Post_Processing.comment = Настройте параметры для в option.TAA_UPSCALING.comment = Переключите временное масштабирование. Это позволяет сохранить хорошее качество изображения с более низким разрешением при увеличении масштаба. таким образом, вы все равно можете получить высокое разрешение по сравнению с обычным увеличением и при этом получить лучшую производительность option.SCALE_FACTOR.comment = Настройте, с какой доли вашего разрешения увеличивать масштаб. Ниже 0,5 вообще не рекомендуется, я использую это только как опцию, потому что это забавно :P screen.COLOR_GRADING.comment = Расширенные возможности цветокоррекции - option.TONE_CURVE.comment = Включите кривую тона. Это не зависит от цветокоррекции и применяется в первую очередь + option.LUMINANCE_CURVE.comment = Включите кривую тона. Это не зависит от цветокоррекции и применяется в первую очередь option.COLOR_GRADING_ENABLED.comment = Включите цветовую градацию. Ползунки RGB не будут влиять на яркость. Это применяется после кривой тона option.RESOURCEPACK_SKY.comment = Включите поддержку неба пакета ресурсов. Настройте параметры так, чтобы использовать все небо пакета ресурсов или сохранить солнце и луну шейдера. §aНАГРУЗКА:§r очень низкая diff --git a/shaders/lang/zh_cn.lang b/shaders/lang/zh_cn.lang index 22460f4..148158f 100644 --- a/shaders/lang/zh_cn.lang +++ b/shaders/lang/zh_cn.lang @@ -1,7 +1,4 @@ -option.BLISS_SHADERS=Bliss - value.BLISS_SHADERS.0=A Chocapic13 Edit - value.BLISS_SHADERS.1=作者: Xonk - value.BLISS_SHADERS.2=版本: GIT-HEAD +option.SHADER_VERSION_LABEL = Bliss In-Dev Commit Number # if you're here to translate, this is a joke, these don't do what they say profile.QUALITY=质量 @@ -408,7 +405,7 @@ screen.Post_Processing = 后期处理 option.TAA_UPSCALING = TAA 升采样 option.SCALE_FACTOR = 放大倍率 screen.COLOR_GRADING = 颜色分级 - option.TONE_CURVE = 色调曲线 + option.LUMINANCE_CURVE = 色调曲线 option.LOWER_CURVE = 下部曲线 option.UPPER_CURVE = 上部曲线 option.COLOR_GRADING_ENABLED = 颜色分级 @@ -649,7 +646,7 @@ screen.Post_Processing.comment = 配置所有后处理效果设置, 从抗锯齿 option.TAA_UPSCALING.comment = 时间性升分辨率. 升分辨率时, 可以从低分辨率的图像中保留大多数质量. 因此与常规升分辨率相比, 可以开启一个看起来很高的分辨率的同时也能有更好的性能. option.SCALE_FACTOR.comment = 配置以原有分辨率的多大一部分来开始升分辨率. 不推荐低于0.5, 只把它作为一个选项, 因为它很有趣. :P screen.COLOR_GRADING.comment = 高级调色选项. - option.TONE_CURVE.comment = 启用色调曲线. 独立于颜色分级且首先应用. + option.LUMINANCE_CURVE.comment = 启用色调曲线. 独立于颜色分级且首先应用. option.COLOR_GRADING_ENABLED.comment = 启用颜色分级. RGB 滑块不会影响亮度. 在色调曲线之后应用. option.RESOURCEPACK_SKY.comment = 开关资源包天空支持. 配置设置来使用完整的资源包天空, 或保持光影的日月. §a性能消耗水平:§r 非常低. diff --git a/shaders/lib/Shadow_Params.glsl b/shaders/lib/Shadow_Params.glsl index 7e87e75..1c355e3 100644 --- a/shaders/lib/Shadow_Params.glsl +++ b/shaders/lib/Shadow_Params.glsl @@ -1,8 +1,16 @@ +uniform float far; +uniform int dhRenderDistance; + const float k = 1.8; -const float d0 = 0.04 + max(64.0 - shadowDistance, 0.0)/64.0 * 0.26; +const float d0 = 0.04 + max(64.0 - shadowDistance, 0.0)/64.0 * 0.26; const float d1 = 0.61; float a = exp(d0); -float b = (exp(d1)-a)*150./128.0; +// thank you Espen +#ifdef DISTANT_HORIZONS_SHADOWMAP + float b = (exp(d1)-a)*min(dhRenderDistance, shadowDistance)/shadowDistance; +#else + float b = (exp(d1)-a)*min(far+16.0*3.5, shadowDistance)/shadowDistance; +#endif vec4 BiasShadowProjection(in vec4 projectedShadowSpacePosition) { @@ -13,67 +21,4 @@ vec4 BiasShadowProjection(in vec4 projectedShadowSpacePosition) { float calcDistort(vec2 worldpos){ return 1.0/(log(length(worldpos)*b+a)*k); -} - -uniform float far; - -/* -mat4 BuildOrthoProjectionMatrix(const in float width, const in float height, const in float zNear, const in float zFar) { - return mat4( - vec4(2.0 / width, 0.0, 0.0, 0.0), - vec4(0.0, 2.0 / height, 0.0, 0.0), - vec4(0.0, 0.0, -2.0 / (zFar - zNear), 0.0), - vec4(0.0, 0.0, -(zFar + zNear)/(zFar - zNear), 1.0)); -} - -mat4 BuildTranslationMatrix(const in vec3 delta) { - return mat4( - vec4(1.0, 0.0, 0.0, 0.0), - vec4(0.0, 1.0, 0.0, 0.0), - vec4(0.0, 0.0, 1.0, 0.0), - vec4(delta, 1.0)); -} - -uniform vec3 CamPos; - -// vec3 LightDir = vec3(1.0, 0.5, 1.0); - -float rate = frameTimeCounter; -vec3 LightDir = vec3(sin(rate), 0.3, cos(rate)); -// vec3 LightDir = vec3(cos(rate),sin(rate),cos(rate)); - -const float shadowIntervalSize = 2.0f; -vec3 GetShadowIntervalOffset() { - return fract(CamPos / shadowIntervalSize) * shadowIntervalSize - vec3(3,0,1); -} - -mat4 BuildShadowViewMatrix(const in vec3 localLightDir) { - const vec3 worldUp = vec3(1, 0, 0); - - vec3 zaxis = localLightDir; - - // float check = localLightDir.y; - // if(check < 0.0) zaxis.y = -zaxis.y; - - vec3 xaxis = normalize(cross(worldUp, zaxis)); - vec3 yaxis = normalize(cross(zaxis, xaxis)); - - mat4 shadowModelViewEx = mat4(1.0); - shadowModelViewEx[0].xyz = vec3(xaxis.x, yaxis.x, zaxis.x); - shadowModelViewEx[1].xyz = vec3(xaxis.y, yaxis.y, zaxis.y); - shadowModelViewEx[2].xyz = vec3(xaxis.z, yaxis.z, zaxis.z); - - vec3 intervalOffset = GetShadowIntervalOffset(); - mat4 translation = BuildTranslationMatrix(intervalOffset); - - return shadowModelViewEx * translation; -} - -mat4 BuildShadowProjectionMatrix() { - float maxDist = min(shadowDistance, far); - return BuildOrthoProjectionMatrix(maxDist, maxDist, -far, far); -} - -// mat4 Custom_ViewMatrix = BuildShadowViewMatrix(LightDir); -// mat4 Custom_ProjectionMatrix = BuildShadowProjectionMatrix(); -*/ \ No newline at end of file +} \ No newline at end of file diff --git a/shaders/lib/Shadows.glsl b/shaders/lib/Shadows.glsl index dde76b3..ec6f0ec 100644 --- a/shaders/lib/Shadows.glsl +++ b/shaders/lib/Shadows.glsl @@ -7,28 +7,20 @@ void GriAndEminShadowFix( float VanillaAO, float SkyLightmap ){ + // #ifdef DISTANT_HORIZONS_SHADOWMAP + // float minimumValue = 0.3; + // #else + float minimumValue = 0.05; + // #endif - float minvalue = 0.007; + float DistanceOffset = max(length(WorldPos) * 0.005, minimumValue); - #ifdef DISTANT_HORIZONS_SHADOWMAP - minvalue = 0.035; - #endif - - // float DistanceOffset = clamp(0.17 + length(WorldPos) / (shadowMapResolution*0.20), 0.0,1.0) ; - // float DistanceOffset = clamp(0.17 + length(WorldPos) / (shadowMapResolution*0.20), 0.0,1.0) ; - float shadowResScale = (2048.0/shadowMapResolution) / 4.0; - float DistanceOffset = (length(WorldPos)+4.0) * (minvalue + shadowResScale*0.015); - - - - vec3 Bias = FlatNormal * DistanceOffset; // adjust the bias thingy's strength as it gets farther away. - - vec3 finalBias = Bias; + vec3 Bias = FlatNormal * DistanceOffset; // stop lightleaking by zooming up, centered on blocks vec2 scale = vec2(0.5); scale.y *= 0.5; vec3 zoomShadow = scale.y - scale.x * fract(WorldPos + cameraPosition + Bias*scale.y); - if(SkyLightmap < 0.1) finalBias = mix(Bias, zoomShadow, clamp(VanillaAO*5,0,1)); + if(SkyLightmap < 0.1) Bias = zoomShadow; - WorldPos += finalBias; + WorldPos += Bias; } \ No newline at end of file diff --git a/shaders/lib/diffuse_lighting.glsl b/shaders/lib/diffuse_lighting.glsl index 0247ac6..29e37fc 100644 --- a/shaders/lib/diffuse_lighting.glsl +++ b/shaders/lib/diffuse_lighting.glsl @@ -40,8 +40,9 @@ vec3 DoAmbientLightColor( // do torch lighting float TorchLM = pow(1.0-sqrt(1.0-clamp(Lightmap.x,0.0,1.0)),2.0) * 2.0; - float TorchBrightness_autoAdjust = mix(1.0, 30.0, clamp(exp(-10.0*Exposure),0.0,1.0)) ; - vec3 TorchLight = TorchColor * TorchLM * TORCH_AMOUNT ; + float TorchBrightness_autoAdjust = mix(1.0, 30.0, clamp(exp(-10.0*Exposure),0.0,1.0)); + + vec3 TorchLight = TorchColor * TorchLM * TORCH_AMOUNT; #if defined IS_LPV_ENABLED && defined MC_GL_EXT_shader_image_load_store vec4 lpvSample = SampleLpvLinear(lpvPos); @@ -54,7 +55,7 @@ vec3 DoAmbientLightColor( LpvFadeF = 1.0 - pow(1.0-pow(LpvFadeF,1.5),3.0); // make it nice and soft :) - TorchLight = mix(TorchLight,LpvTorchLight/5.0, LpvFadeF); + TorchLight = mix(TorchLight, LpvTorchLight/5.0, LpvFadeF); const vec3 normal = vec3(0.0); // TODO diff --git a/shaders/lib/end_fog.glsl b/shaders/lib/end_fog.glsl index f909583..79918d2 100644 --- a/shaders/lib/end_fog.glsl +++ b/shaders/lib/end_fog.glsl @@ -34,7 +34,7 @@ SOFTWARE.*/ p *= p + p; return fract(p); } - + //---------------------------------------------------------------------------------------- // Integer Hash - II @@ -142,11 +142,11 @@ void VolumeBounds(inout float Volume, vec3 Origin){ // create the volume shape float fogShape(in vec3 pos){ + float vortexBounds = clamp(vortexBoundRange - length(pos), 0.0,1.0); vec3 samplePos = pos*vec3(1.0,1.0/48.0,1.0); float fogYstart = -60; - // this is below down where you fall to your death. float voidZone = max(exp2(-1.0 * sqrt(max(pos.y - -60,0.0))) ,0.0) ; @@ -207,7 +207,11 @@ vec3 LightSourceLighting(vec3 startPos, vec3 lightPos, float noise, float densit return finalLighting; } - +//Mie phase function +float phaseEND(float x, float g){ + float gg = g * g; + return (gg * -0.25 + 0.25) * pow(-2.0 * (g * x) + (gg + 1.0), -1.5) / 3.14; +} vec4 GetVolumetricFog( vec3 viewPosition, float dither, @@ -216,82 +220,115 @@ vec4 GetVolumetricFog( #ifndef TOGGLE_VL_FOG return vec4(0.0,0.0,0.0,1.0); #endif + + /// ------------- RAYMARCHING STUFF ------------- \\\ - int SAMPLES = 16; - - //project pixel position into projected shadowmap space vec3 wpos = mat3(gbufferModelViewInverse) * viewPosition + gbufferModelViewInverse[3].xyz; - vec3 fragposition = mat3(shadowModelView) * wpos + shadowModelView[3].xyz; - fragposition = diagonal3(shadowProjection) * fragposition + shadowProjection[3].xyz; - - //project view origin into projected shadowmap space - vec3 start = vec3(0.0); - - //rayvector into projected shadow map space - //we can use a projected vector because its orthographic projection - //however we still have to send it to curved shadow map space every step - vec3 dV = fragposition - start; vec3 dVWorld = (wpos-gbufferModelViewInverse[3].xyz); + vec3 progressW = vec3(0.0); float maxLength = min(length(dVWorld),32.0 * 12.0)/length(dVWorld); - dV *= maxLength; + dVWorld *= maxLength; - float dL = length(dVWorld); - vec3 progressW = gbufferModelViewInverse[3].xyz + cameraPosition; + float dL = length(dVWorld); + float expFactor = 11.0; /// ------------- COLOR/LIGHTING STUFF ------------- \\\ - vec3 color = vec3(0.0); - vec3 absorbance = vec3(1.0); + int SAMPLECOUNT = 16; - vec3 fogcolor = (gl_Fog.color.rgb / max(dot(gl_Fog.color.rgb,vec3(0.3333)),0.05)) ; + vec3 color = vec3(0.0); + float absorbance = 1.0; + + float CenterdotV = dot(normalize(vec3(0,100,0)-cameraPosition), normalize(wpos + cameraPosition)); + + // float phsething = phaseEND(CenterdotV, 0.35) + phaseEND(CenterdotV, 0.85) ; + + float skyPhase = 0.5 + pow(clamp(normalize(wpos).y*0.5+0.5,0.0,1.0),4.0)*5.0; + + vec3 hazeColor = normalize(gl_Fog.color.rgb) * 0.1; float lightningflash = texelFetch2D(colortex4,ivec2(1,1),0).x/150.0; - float expFactor = 11.0; - for (int i=0;i shadowPos.z && sh.x < 1.0){ - vec4 translucentShadow = texture2D(shadowcolor0, shadowPos.xy); - if(translucentShadow.a < 0.9) sh = normalize(translucentShadow.rgb+0.0001); - } + //------ SAMPLE SHADOWS FOR FOG EFFECTS + #ifdef DISTORT_SHADOWMAP + float distortFactor = calcDistort(progress.xy); #else - sh = vec3(shadow2D(shadow, shadowPos).x); + float distortFactor = 1.0; #endif - } - #ifdef RAYMARCH_CLOUDS_WITH_FOG - vec3 sh_forClouds = sh; - #endif + vec3 shadowPos = vec3(progress.xy*distortFactor, progress.z); - #ifdef VL_CLOUDS_SHADOWS - sh *= GetCloudShadow_VLFOG(progressW, WsunVec * lightCol.a); - #endif + vec3 sh = vec3(1.0); + if (abs(shadowPos.x) < 1.0-0.5/2048. && abs(shadowPos.y) < 1.0-0.5/2048){ + shadowPos = shadowPos*vec3(0.5,0.5,0.5/6.0)+0.5; + + #ifdef TRANSLUCENT_COLORED_SHADOWS + sh = vec3(shadow2D(shadowtex0, shadowPos).x); + + if(shadow2D(shadowtex1, shadowPos).x > shadowPos.z && sh.x < 1.0){ + vec4 translucentShadow = texture2D(shadowcolor0, shadowPos.xy); + if(translucentShadow.a < 0.9) sh = normalize(translucentShadow.rgb+0.0001); + } + #else + sh = vec3(shadow2D(shadow, shadowPos).x); + #endif + } + #ifdef RAYMARCH_CLOUDS_WITH_FOG + vec3 sh_forClouds = sh; + #endif + + #ifdef VL_CLOUDS_SHADOWS + sh *= GetCloudShadow_VLFOG(progressW, WsunVec * lightCol.a); + #endif #ifdef PER_BIOME_ENVIRONMENT float maxDistance = inBiome * min(max(1.0 - length(d*dVWorld.xz)/(32*8),0.0)*2.0,1.0); @@ -211,37 +216,40 @@ vec4 GetVolumetricFog( float densityVol = cloudVol(progressW, 0.0) * lightleakfix; #endif - //Water droplets(fog) - float density = densityVol; + //------ MAIN FOG EFFECT + float fogDensity = densityVol; + float fogVolumeCoeff = exp(-fogDensity*dd*dL); // this is like beer-lambert law or something - ///// ----- main fog lighting - //Just air - vec2 airCoef = exp2(-max(progressW.y-SEA_LEVEL,0.0)/vec2(8.0e3, 1.2e3)*vec2(6.,7.0)) * (24.0 * atmosphereMult) * Haze_amount * clamp(CloudLayer0_height - progressW.y + max(eyeAltitude-(CloudLayer0_height-100),0),0.0,1.0); - // * clamp(CloudLayer0_height - progressW.y + max(eyeAltitude-(CloudLayer0_height-100),0),0.0,1.0); - // * exp2(-0.05 * max(progressW.y - (CloudLayer0_height + max(eyeAltitude-(CloudLayer0_height-50.0),0)),0.0)); + #ifdef PER_BIOME_ENVIRONMENT + vec3 indirectLight = mix(skyLightPhased, biomeIndirect, maxDistance); + vec3 DirectLight = mix(LightSourcePhased, biomeDirect, maxDistance) * sh; + #else + vec3 indirectLight = skyLightPhased; + vec3 DirectLight = LightSourcePhased * sh; + #endif - //Pbr for air, yolo mix between mie and rayleigh for water droplets - vec3 rL = rC*(airCoef.x); - vec3 m = mC*(airCoef.y+densityVol*300.0); + vec3 Lightning = Iris_Lightningflash_VLfog(progressW-cameraPosition, lightningBoltPosition.xyz); + vec3 lighting = DirectLight * lightleakfix + indirectLight * lightleakfix2 + Lightning; - // calculate the atmosphere haze seperately and purely on color, so visibility is not harmed. - vec3 Atmosphere = LightSourcePhased * sh * (rayL*rL + sunPhase*m) + (AveragedAmbientColor*0.7) * (rL+m) * lightleakfix2; - color += (Atmosphere - Atmosphere*exp(-(rL+m)*dd*dL_alternate)) / (rL+m+1e-6); + color += (lighting - lighting * fogVolumeCoeff) * absorbance; + absorbance *= fogVolumeCoeff; - // calculate lighting - #ifdef PER_BIOME_ENVIRONMENT - vec3 indirectLight = mix(skyLightPhased, biomeIndirect, maxDistance); - vec3 DirectLight = mix(LightSourcePhased, biomeDirect, maxDistance) * sh; - #else - vec3 indirectLight = skyLightPhased; - vec3 DirectLight = LightSourcePhased * sh; - #endif + //------ ATMOSPHERE HAZE EFFECT + // just air + vec2 airCoef = exp2(-max(progressW.y-SEA_LEVEL,0.0)/vec2(8.0e3, 1.2e3)*vec2(6.,7.0)) * (24.0 * atmosphereMult) * Haze_amount * clamp((CloudLayer0_height + max(eyeAltitude-(CloudLayer0_height-100),0)) - progressW.y,0.0,1.0); - vec3 Lightning = Iris_Lightningflash_VLfog(progressW-cameraPosition, lightningBoltPosition.xyz) * (rL + m); - vec3 lighting = DirectLight * lightleakfix + indirectLight * lightleakfix2 + Lightning; + // Pbr for air, yolo mix between mie and rayleigh for water droplets + vec3 rL = rC*airCoef.x; + vec3 m = mC*(airCoef.y+densityVol*300.0); - color += (lighting - lighting * exp(-density*dd*dL))*absorbance; - absorbance *= max(exp(-density*dd*dL),0.0); + // calculate the atmosphere haze seperately and purely additive to color, do not contribute to absorbtion. + vec3 Atmosphere = LightSourcePhased * sh * (rayL*rL + sunPhase*m) + (AveragedAmbientColor*0.7) * (rL+m) * lightleakfix2; + color += (Atmosphere - Atmosphere*exp(-(rL+m)*dd*dL_alternate)) / (rL+m+1e-6) * absorbance; + + //------ LPV FOG EFFECT + #if defined LPV_VL_FOG_ILLUMINATION && defined EXCLUDE_WRITE_TO_LUT + color += LPV_FOG_ILLUMINATION(progressW-cameraPosition, dd, dL) * TorchBrightness_autoAdjust * absorbance; + #endif #ifdef RAYMARCH_CLOUDS_WITH_FOG float otherlayer = max(progressW.y - (CloudLayer0_height+99.5), 0.0) > 0.0 ? 0.0 : 1.0; diff --git a/shaders/lib/settings.glsl b/shaders/lib/settings.glsl index c17a695..a121fae 100644 --- a/shaders/lib/settings.glsl +++ b/shaders/lib/settings.glsl @@ -1,6 +1,6 @@ -#define saturate(x) clamp(x,0.0,1.0) +#define SHADER_VERSION_LABEL 439 // [439] -#define BLISS_SHADERS 0 // [0 1 2] +#define saturate(x) clamp(x,0.0,1.0) //////////////////////////////////////// // ----- WATER RELATED SETTINGS ----- // @@ -403,7 +403,7 @@ uniform int moonPhase; #define cloud_ShadowLevelOfDetail 0 // [-1 0 1 2 3 4 5 6 7 8] #define cloud_LevelOfDetailLQ 1 // [-1 0 1 2 3 4 5 6 7 8] #define cloud_ShadowLevelOfDetailLQ 0 // [-1 0 1 2 3 4 5 6 7 8] -#define minRayMarchSteps 10 // [20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200] +#define minRayMarchSteps 15 // [20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200] #define maxRayMarchSteps 15 // [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200] #define minRayMarchStepsLQ 10 // [5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100] #define maxRayMarchStepsLQ 30 // [ 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100] @@ -551,9 +551,9 @@ uniform int moonPhase; #define SATURATION 0.00 // [-1.0 -0.98 -0.96 -0.94 -0.92 -0.9 -0.88 -0.86 -0.84 -0.82 -0.8 -0.78 -0.76 -0.74 -0.72 -0.7 -0.68 -0.66 -0.64 -0.62 -0.6 -0.58 -0.56 -0.54 -0.52 -0.5 -0.48 -0.46 -0.44 -0.42 -0.4 -0.38 -0.36 -0.34 -0.32 -0.3 -0.28 -0.26 -0.24 -0.22 -0.2 -0.18 -0.16 -0.14 -0.12 -0.1 -0.08 -0.06 -0.04 -0.02 0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 ] #define CROSSTALK 0.0 // [-1.0 -0.98 -0.96 -0.94 -0.92 -0.9 -0.88 -0.86 -0.84 -0.82 -0.8 -0.78 -0.76 -0.74 -0.72 -0.7 -0.68 -0.66 -0.64 -0.62 -0.6 -0.58 -0.56 -0.54 -0.52 -0.5 -0.48 -0.46 -0.44 -0.42 -0.4 -0.38 -0.36 -0.34 -0.32 -0.3 -0.28 -0.26 -0.24 -0.22 -0.2 -0.18 -0.16 -0.14 -0.12 -0.1 -0.08 -0.06 -0.04 -0.02 0.0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 0.16 0.18 0.2 0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4 0.42 0.44 0.46 0.48 0.5 0.52 0.54 0.56 0.58 0.6 0.62 0.64 0.66 0.68 0.7 0.72 0.74 0.76 0.78 0.8 0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98 1.0 ] -// #define TONE_CURVE -#define UPPER_CURVE 0.0 // [-1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] -#define LOWER_CURVE 0.0 // [-1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] +// #define LUMINANCE_CURVE +#define UPPER_CURVE 0.0 // [-2.0 -1.9 -1.8 -1.7 -1.6 -1.5 -1.4 -1.3 -1.2 -1.1 -1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0] +#define LOWER_CURVE 0.0 // [-2.0 -1.9 -1.8 -1.7 -1.6 -1.5 -1.4 -1.3 -1.2 -1.1 -1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0] // #define COLOR_GRADING_ENABLED #define SHADOWS_GRADE_R 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0] @@ -594,11 +594,10 @@ const vec3 HIGHLIGHTS_TARGET = length(vec3(HIGHLIGHTS_GRADE_R, HIGHLIGHTS_GRADE_ #define AEROCHROME_PINKNESS 0.3 // How pink it is from red [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0] const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631), AEROCHROME_PINKNESS); -//#define BICUBIC_UPSCALING // #define CAMERA_GRIDLINES // #define MOTION_BLUR -#define MOTION_BLUR_STRENGTH 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0] +#define MOTION_BLUR_STRENGTH 1.0 // [0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 3.0 4.0 5.0] /////////////////////////////////////////////////////// // ----- GAMEPLAY POST EFFECT RELATED SETTINGS ----- // @@ -688,6 +687,7 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631) // #define DISABLE_VANILLA_EMISSIVES #define PARTICLE_RENDERING_FIX +#define LIGHTING_EFFECTS_BLUR_FILTER /////////////////////////////////////////// // ----- DISTANT HORIZONS SETTINGS ----- // @@ -697,7 +697,7 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631) #define DISTORT_SHADOWMAP // #define DISTANT_HORIZONS_SHADOWMAP #ifdef DISTANT_HORIZONS_SHADOWMAP - #undef DISTORT_SHADOWMAP + // #undef DISTORT_SHADOWMAP const float shadowNearPlane = -1.0; const float shadowFarPlane = -1.0; @@ -724,6 +724,8 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631) #define LPV_ENTITY_LIGHTS #define LPV_REDSTONE_LIGHTS //#define LPV_COLORED_CANDLES +//#define LPV_VL_FOG_ILLUMINATION +#define LPV_VL_FOG_ILLUMINATION_BRIGHTNESS 100 // [0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85 90 95 100 105 110 115 120 125 130 135 140 145 150 155 160 165 170 175 180 185 190 195 200]] // Fix for making nether/end work until next Iris release to fix shadow matrices //#define LPV_NOSHADOW_HACK @@ -780,7 +782,7 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631) #endif #ifdef LIGHTNING_FLASH #endif -#if BLISS_SHADERS == 0 +#if SHADER_VERSION_LABEL > 0 #endif #if DH_KNOWN_ISSUES == 0 #endif @@ -788,3 +790,5 @@ const vec3 aerochrome_color = mix(vec3(1.0, 0.0, 0.0), vec3(0.715, 0.303, 0.631) #endif #ifdef RENDER_PLAYER_SHADOWS #endif +#ifdef LPV_VL_FOG_ILLUMINATION +#endif \ No newline at end of file diff --git a/shaders/lib/specular.glsl b/shaders/lib/specular.glsl index 705d2f3..538105c 100644 --- a/shaders/lib/specular.glsl +++ b/shaders/lib/specular.glsl @@ -191,7 +191,7 @@ void DoSpecularReflections( Roughness = 1.0 - Roughness; Roughness *= Roughness; F0 = F0 == 0.0 ? 0.02 : F0; - // Roughness = 0.1; + // Roughness = 0.0; // F0 = 0.9; mat3 Basis = CoordBase(Normal); diff --git a/shaders/lib/volumetricClouds.glsl b/shaders/lib/volumetricClouds.glsl index a327411..98fe3ab 100644 --- a/shaders/lib/volumetricClouds.glsl +++ b/shaders/lib/volumetricClouds.glsl @@ -256,7 +256,8 @@ vec3 DoCloudLighting( } vec4 renderLayer( - int layer, + int layer, + in vec3 POSITION, in vec3 rayProgress, in vec3 dV_view, in float mult, @@ -276,7 +277,8 @@ vec4 renderLayer( in vec3 indirectScatter, in float distantfog, bool notVisible, - vec3 FragPosition + vec3 FragPosition, + inout vec3 cloudDepth ){ vec3 COLOR = vec3(0.0); float TOTAL_EXTINCTION = 1.0; @@ -332,20 +334,22 @@ if(layer == 2){ }else{ #if defined CloudLayer1 && defined CloudLayer0 - float upperLayerOcclusion = layer == 0 ? GetCumulusDensity(1, rayProgress + vec3(0.0,1.0,0.0) * max((LAYER1_minHEIGHT+30) - rayProgress.y,0.0), 0, LAYER1_minHEIGHT, LAYER1_maxHEIGHT) : 0.0; + float upperLayerOcclusion = layer == 0 ? GetCumulusDensity(1, rayProgress + vec3(0.0,1.0,0.0) * max((LAYER1_minHEIGHT+70*dither) - rayProgress.y,0.0), 0, LAYER1_minHEIGHT, LAYER1_maxHEIGHT) : 0.0; float skylightOcclusion = mix(1.0, (1.0 - LAYER1_DENSITY)*0.8 + 0.2, (1.0 - exp2(-5.0 * (upperLayerOcclusion*upperLayerOcclusion))) * distantfog); #else float skylightOcclusion = 1.0; #endif + float expFactor = 11.0; for(int i = 0; i < QUALITY; i++) { #ifdef CLOUDS_INTERSECT_TERRAIN IntersecTerrain = length(rayProgress - cameraPosition) > lViewPosM; #endif + /// avoid overdraw if(notVisible || IntersecTerrain) break; - + // do not sample anything unless within a clouds bounding box if(clamp(rayProgress.y - maxHeight,0.0,1.0) < 1.0 && clamp(rayProgress.y - minHeight,0.0,1.0) > 0.0){ @@ -353,6 +357,7 @@ if(layer == 2){ float fadedDensity = cloudDensity * pow(clamp((rayProgress.y - minHeight)/25,0.0,1.0),2.0); float CumulusWithDensity = cloudDensity * cumulus; + if(CumulusWithDensity > 1e-5 ){ // make sure no work is done on pixels with no densities float muE = cumulus * fadedDensity; @@ -365,7 +370,7 @@ if(layer == 2){ /// shadows cast from one layer to another /// large cumulus -> small cumulus #if defined CloudLayer1 && defined CloudLayer0 - if(layer == 0) directLight += LAYER1_DENSITY * 2.0 * GetCumulusDensity(1, rayProgress + dV_Sun/abs(dV_Sun.y) * max((LAYER1_minHEIGHT+35) - rayProgress.y,0.0), 0, LAYER1_minHEIGHT, LAYER1_maxHEIGHT); + if(layer == 0) directLight += LAYER1_DENSITY * 2.0 * GetCumulusDensity(1, rayProgress + dV_Sun/abs(dV_Sun.y) * max((LAYER1_minHEIGHT+70*dither) - rayProgress.y,0.0), 0, LAYER1_minHEIGHT, LAYER1_maxHEIGHT); #endif // altostratus -> cumulus #ifdef CloudLayer2 @@ -379,12 +384,15 @@ if(layer == 2){ COLOR += max(lighting - lighting*exp(-mult*muE),0.0) * TOTAL_EXTINCTION; TOTAL_EXTINCTION *= max(exp(-mult*muE),0.0); - + if (TOTAL_EXTINCTION < 1e-5) break; } + } + rayProgress += dV_view; + } return vec4(COLOR, TOTAL_EXTINCTION); } @@ -399,10 +407,10 @@ vec3 layerStartingPosition( float maxHeight ){ // allow passing through/above/below the plane without limits - float flip = mix(max(cameraPos.y - maxHeight,0.0), max(minHeight - cameraPos.y,0), clamp(dV_view.y,0,1)); + float flip = mix(max(cameraPos.y - maxHeight,0.0), max(minHeight - cameraPos.y,0.0), clamp(dV_view.y,0.0,1.0)); // orient the ray to be a flat plane facing up/down - vec3 position = dV_view*dither + cameraPos + dV_view/abs(dV_view.y) * flip; + vec3 position = dV_view*dither + cameraPos + (dV_view/abs(dV_view.y)) * flip; return position; } @@ -410,7 +418,8 @@ vec4 renderClouds( vec3 FragPosition, vec2 Dither, vec3 LightColor, - vec3 SkyColor + vec3 SkyColor, + inout vec3 cloudDepth ){ vec3 SignedWsunvec = WsunVec; vec3 WsunVec = WsunVec * (float(sunElevation > 1e-5)*2.0-1.0); @@ -427,11 +436,10 @@ vec4 renderClouds( ////////////////////////////////////////// ////// Raymarching stuff ////////////////////////////////////////// - //project pixel position into projected shadowmap space vec4 viewPos = normalize(gbufferModelViewInverse * vec4(FragPosition,1.0) ); maxIT_clouds = int(clamp(maxIT_clouds / sqrt(exp2(viewPos.y)),0.0, maxIT)); - // maxIT_clouds = 15; + // maxIT_clouds = 30; vec3 dV_view = normalize(viewPos.xyz); @@ -448,14 +456,18 @@ vec4 renderClouds( vec3 dV_viewTEST = dV_view * (90.0/abs(dV_view.y)/maxIT_clouds); float mult = length(dV_viewTEST); + + ////////////////////////////////////////// ////// lighting stuff ////////////////////////////////////////// - float shadowStep = 1.0; - - vec3 dV_Sun = WsunVec*shadowStep; - float SdotV = dot(mat3(gbufferModelView)*WsunVec, normalize(FragPosition)); + vec3 dV_Sun = WsunVec; + #ifdef EXCLUDE_WRITE_TO_LUT + dV_Sun *= lightCol.a; + #endif + + float SdotV = dot(mat3(gbufferModelView)*WsunVec, normalize(FragPosition)) ; float mieDay = phaseg(SdotV, 0.85) + phaseg(SdotV, 0.75); float mieDayMulti = (phaseg(SdotV, 0.35) + phaseg(-SdotV, 0.35) * 0.5) ; @@ -509,7 +521,9 @@ vec4 renderClouds( #ifdef CloudLayer0 vec3 layer0_dV_view = dV_view * (LAYER0_width/abs(dV_view.y)/maxIT_clouds); vec3 layer0_start = layerStartingPosition(layer0_dV_view, cameraPosition, Dither.y, MinHeight, MaxHeight); + #endif + #ifdef CloudLayer1 vec3 layer1_dV_view = dV_view * (LAYER1_width/abs(dV_view.y)/maxIT_clouds); vec3 layer1_start = layerStartingPosition(layer1_dV_view, cameraPosition, Dither.y, MinHeight1, MaxHeight1); @@ -519,7 +533,7 @@ vec4 renderClouds( #endif #ifdef CloudLayer0 - vec4 layer0 = renderLayer(0, layer0_start, layer0_dV_view, mult, Dither.x, maxIT_clouds, MinHeight, MaxHeight, dV_Sun, LAYER0_DENSITY, SkyColor, directScattering, directMultiScattering, sunIndirectScattering, distantfog, false, FragPosition); + vec4 layer0 = renderLayer(0,dV_view, layer0_start, layer0_dV_view, mult, Dither.x, maxIT_clouds, MinHeight, MaxHeight, dV_Sun, LAYER0_DENSITY, SkyColor, directScattering, directMultiScattering, sunIndirectScattering, distantfog, false, FragPosition, cloudDepth); total_extinction *= layer0.a; // stop overdraw. @@ -531,7 +545,7 @@ vec4 renderClouds( #endif #ifdef CloudLayer1 - vec4 layer1 = renderLayer(1, layer1_start, layer1_dV_view, mult, Dither.x, maxIT_clouds, MinHeight1, MaxHeight1, dV_Sun, LAYER1_DENSITY, SkyColor, directScattering, directMultiScattering, sunIndirectScattering, distantfog, notVisible, FragPosition); + vec4 layer1 = renderLayer(1,dV_view, layer1_start, layer1_dV_view, mult, Dither.x, maxIT_clouds, MinHeight1, MaxHeight1, dV_Sun, LAYER1_DENSITY, SkyColor, directScattering, directMultiScattering, sunIndirectScattering, distantfog, notVisible, FragPosition, cloudDepth); total_extinction *= layer1.a; // stop overdraw. @@ -539,7 +553,7 @@ vec4 renderClouds( #endif #ifdef CloudLayer2 - vec4 layer2 = renderLayer(2, layer2_start, dV_view_Alto, mult_alto, Dither.x, maxIT_clouds, Height2, Height2, dV_Sun, LAYER2_DENSITY, SkyColor, directScattering * (1.0 + rainStrength*3), directMultiScattering* (1.0 + rainStrength*3), sunIndirectScattering, distantfog, altoNotVisible, FragPosition); + vec4 layer2 = renderLayer(2,dV_view,layer2_start, dV_view_Alto, mult_alto, Dither.x, maxIT_clouds, Height2, Height2, dV_Sun, LAYER2_DENSITY, SkyColor, directScattering * (1.0 + rainStrength*3), directMultiScattering* (1.0 + rainStrength*3), sunIndirectScattering, distantfog, altoNotVisible, FragPosition, cloudDepth); total_extinction *= layer2.a; #endif diff --git a/shaders/shaders.properties b/shaders/shaders.properties index c661268..063e0d6 100644 --- a/shaders/shaders.properties +++ b/shaders/shaders.properties @@ -57,6 +57,10 @@ program.world1/gbuffers_block_translucent.enabled = TRANSLUCENT_ENTITIES && IS_I program.world0/dh_terrain.enabled = true program.world0/dh_water.enabled = true + program.world1/dh_terrain.enabled = true + program.world1/dh_water.enabled = true + program.world-1/dh_terrain.enabled = true + program.world-1/dh_water.enabled = true blend.dh_terrain = off blend.dh_water = SRC_ALPHA ONE_MINUS_SRC_ALPHA ONE_MINUS_DST_ALPHA ONE @@ -64,6 +68,20 @@ program.world1/gbuffers_block_translucent.enabled = TRANSLUCENT_ENTITIES && IS_I dhShadow.enabled = false program.world0/dh_terrain.enabled = false program.world0/dh_water.enabled = false + program.world1/dh_terrain.enabled = false + program.world1/dh_water.enabled = false + program.world-1/dh_terrain.enabled = false + program.world-1/dh_water.enabled = false +#endif + + +#ifdef CLOUDS_INTERSECT_TERRAIN + program.world0/deferred2.enabled = false + program.world0/deferred2.enabled = false + program.world1/deferred2.enabled = false + program.world1/deferred2.enabled = false + program.world-1/deferred2.enabled = false + program.world-1/deferred2.enabled = false #endif program.composite5.enabled = TAA_UPSCALING @@ -111,16 +129,16 @@ alphaTest.gbuffers_water = false alphaTest.gbuffers_skybasic = false alphaTest.gbuffers_skytextured = false -sliders = maxRayMarchSteps MOTION_BLUR_STRENGTH OVERDRAW_MAX_DISTANCE DAY0_l0_coverage DAY0_l1_coverage DAY0_l2_coverage DAY0_ufog_density DAY0_l0_density DAY0_l1_density DAY0_l2_density DAY0_cfog_density DAY1_l0_coverage DAY1_l1_coverage DAY1_l2_coverage DAY1_ufog_density DAY1_l0_density DAY1_l1_density DAY1_l2_density DAY1_cfog_density DAY2_l0_coverage DAY2_l1_coverage DAY2_l2_coverage DAY2_ufog_density DAY2_l0_density DAY2_l1_density DAY2_l2_density DAY2_cfog_density DAY3_l0_coverage DAY3_l1_coverage DAY3_l2_coverage DAY3_ufog_density DAY3_l0_density DAY3_l1_density DAY3_l2_density DAY3_cfog_density DAY4_l0_coverage DAY4_l1_coverage DAY4_l2_coverage DAY4_ufog_density DAY4_l0_density DAY4_l1_density DAY4_l2_density DAY4_cfog_density DAY5_l0_coverage DAY5_l1_coverage DAY5_l2_coverage DAY5_ufog_density DAY5_l0_density DAY5_l1_density DAY5_l2_density DAY5_cfog_density DAY6_l0_coverage DAY6_l1_coverage DAY6_l2_coverage DAY6_ufog_density DAY6_l0_density DAY6_l1_density DAY6_l2_density DAY6_cfog_density DAY7_l0_coverage DAY7_l1_coverage DAY7_l2_coverage DAY7_ufog_density DAY7_l0_density DAY7_l1_density DAY7_l2_density DAY7_cfog_density DAY8_l0_coverage DAY8_l1_coverage DAY8_l2_coverage DAY8_ufog_density DAY8_l0_density DAY8_l1_density DAY8_l2_density DAY8_cfog_density DAY9_l0_coverage DAY9_l1_coverage DAY9_l2_coverage DAY9_ufog_density DAY9_l0_density DAY9_l1_density DAY9_l2_density DAY9_cfog_density sss_density_multiplier sss_absorbance_multiplier MOTION_AMOUNT TONEMAP WATER_WAVE_SPEED WATER_CAUSTICS_BRIGHTNESS DEBUG_VIEW entityShadowDistanceMul HANDHELD_LIGHT_RANGE CLOUD_SHADOW_STRENGTH CloudLayer0_coverage CloudLayer0_density CloudLayer0_height CloudLayer1_coverage CloudLayer1_density CloudLayer1_height CloudLayer2_coverage CloudLayer2_density CloudLayer2_height PLANET_GROUND_BRIGHTNESS FOG_START_HEIGHT WATER_WAVE_STRENGTH SWAMP_UNIFORM_DENSITY SWAMP_CLOUDY_DENSITY SWAMP_R SWAMP_G SWAMP_B JUNGLE_UNIFORM_DENSITY JUNGLE_CLOUDY_DENSITY JUNGLE_R JUNGLE_G JUNGLE_B DARKFOREST_UNIFORM_DENSITY DARKFOREST_CLOUDY_DENSITY DARKFOREST_R DARKFOREST_G DARKFOREST_B NETHER_PLUME_DENSITY END_STORM_DENSTIY LIT_PARTICLE_BRIGHTNESS UPPER_CURVE LOWER_CURVE CONTRAST EMISSIVE_TYPE SCALE_FACTOR ambientsss_brightness SSS_TYPE Cloud_Speed ORB_ColMult ORB_X ORB_Y ORB_Z ORB_R ORB_G ORB_B TOD_Fog_mult Morning_Uniform_Fog Noon_Uniform_Fog Evening_Uniform_Fog Night_Uniform_Fog Morning_Cloudy_Fog Noon_Cloudy_Fog Evening_Cloudy_Fog Night_Cloudy_Fog Summer_Leaf_R Summer_Leaf_G Summer_Leaf_B Fall_Leaf_R Fall_Leaf_G Fall_Leaf_B Winter_Leaf_R Winter_Leaf_G Winter_Leaf_B Spring_Leaf_R Spring_Leaf_G Spring_Leaf_B Summer_R Summer_G Summer_B Fall_R Fall_G Fall_B Winter_R Winter_G Winter_B Spring_R Spring_G Spring_B Season_Length CaveFogFallOff CaveFogColor_R CaveFogColor_G CaveFogColor_B indirect_effect GI_Strength ambient_brightness AmbientLight_R AmbientLight_G AmbientLight_B Rain_coverage Moon_temp Haze_amount RainFog_amount Sun_temp Puddle_Size LabSSS_Curve Emissive_Curve Emissive_Brightness AO_Strength BLOOMY_FOG WAVY_SPEED WAVY_STRENGTH BLOOM_STRENGTH shadowDistance Sky_Brightness fog_coefficientMieR fog_coefficientMieG fog_coefficientMieB sun_illuminance sunColorG sunColorB sunColorR sky_mieg sky_coefficientMieB sky_coefficientMieG sky_coefficientMieR sky_coefficientRayleighB sky_coefficientRayleighG sky_coefficientRayleighR CLOUDS_QUALITY EXPOSURE_MULTIPLIER MIN_LIGHT_AMOUNT TORCH_R TORCH_G TORCH_B TORCH_AMOUNT shadowMapResolution sunPathRotation BLEND_FACTOR VL_SAMPLES Exposure_Speed POM_DEPTH MAX_ITERATIONS MAX_DIST SSR_STEPS ambientOcclusionLevel SEA_LEVEL moon_illuminance moonColorR moonColorG moonColorB fog_coefficientRayleighR fog_coefficientRayleighG SATURATION Manual_exposure_value focal aperture MANUAL_FOCUS SHADOW_FILTER_SAMPLE_COUNT Max_Filter_Depth VPS_Search_Samples Min_Shadow_Filter_Radius Max_Shadow_Filter_Radius Water_Top_Layer fog_coefficientRayleighB SHARPENING rayMarchSampleCount Dirt_Amount Dirt_Scatter_R Dirt_Scatter_G Dirt_Scatter_B Dirt_Absorb_R Dirt_Absorb_G Dirt_Absorb_B Water_Absorb_R Water_Absorb_G Water_Absorb_B Purkinje_strength Purkinje_strength Purkinje_R Purkinje_G Purkinje_B Texture_MipMap_Bias DoF_Adaptation_Speed Purkinje_Multiplier CROSSTALK VL_RENDER_RESOLUTION BLOOM_QUALITY VL_RENDER_RESOLUTION RAY_COUNT STEPS STEP_LENGTH cloud_LevelOfDetail cloud_ShadowLevelOfDetail cloud_LevelOfDetailLQ cloud_ShadowLevelOfDetailLQ minRayMarchSteps maxRayMarchSteps minRayMarchStepsLQ maxRayMarchStepsLQ fbmAmount fbmPower1 fbmPower2 Roughness_Threshold Sun_specular_Strength reflection_quality DOF_QUALITY DOF_ANAMORPHIC_RATIO AEROCHROME_PINKNESS DOF_JITTER_FOCUS JITTER_STRENGTH SHADOWS_GRADE_R MIDS_GRADE_R HIGHLIGHTS_GRADE_R SHADOWS_GRADE_G MIDS_GRADE_G HIGHLIGHTS_GRADE_G SHADOWS_GRADE_B MIDS_GRADE_B HIGHLIGHTS_GRADE_B SHADOWS_GRADE_MUL MIDS_GRADE_MUL HIGHLIGHTS_GRADE_MUL LPV_SATURATION LPV_TINT_SATURATION LPV_NORMAL_STRENGTH +sliders = LPV_VL_FOG_ILLUMINATION_BRIGHTNESS minRayMarchSteps MOTION_BLUR_STRENGTH OVERDRAW_MAX_DISTANCE DAY0_l0_coverage DAY0_l1_coverage DAY0_l2_coverage DAY0_ufog_density DAY0_l0_density DAY0_l1_density DAY0_l2_density DAY0_cfog_density DAY1_l0_coverage DAY1_l1_coverage DAY1_l2_coverage DAY1_ufog_density DAY1_l0_density DAY1_l1_density DAY1_l2_density DAY1_cfog_density DAY2_l0_coverage DAY2_l1_coverage DAY2_l2_coverage DAY2_ufog_density DAY2_l0_density DAY2_l1_density DAY2_l2_density DAY2_cfog_density DAY3_l0_coverage DAY3_l1_coverage DAY3_l2_coverage DAY3_ufog_density DAY3_l0_density DAY3_l1_density DAY3_l2_density DAY3_cfog_density DAY4_l0_coverage DAY4_l1_coverage DAY4_l2_coverage DAY4_ufog_density DAY4_l0_density DAY4_l1_density DAY4_l2_density DAY4_cfog_density DAY5_l0_coverage DAY5_l1_coverage DAY5_l2_coverage DAY5_ufog_density DAY5_l0_density DAY5_l1_density DAY5_l2_density DAY5_cfog_density DAY6_l0_coverage DAY6_l1_coverage DAY6_l2_coverage DAY6_ufog_density DAY6_l0_density DAY6_l1_density DAY6_l2_density DAY6_cfog_density DAY7_l0_coverage DAY7_l1_coverage DAY7_l2_coverage DAY7_ufog_density DAY7_l0_density DAY7_l1_density DAY7_l2_density DAY7_cfog_density DAY8_l0_coverage DAY8_l1_coverage DAY8_l2_coverage DAY8_ufog_density DAY8_l0_density DAY8_l1_density DAY8_l2_density DAY8_cfog_density DAY9_l0_coverage DAY9_l1_coverage DAY9_l2_coverage DAY9_ufog_density DAY9_l0_density DAY9_l1_density DAY9_l2_density DAY9_cfog_density sss_density_multiplier sss_absorbance_multiplier MOTION_AMOUNT TONEMAP WATER_WAVE_SPEED WATER_CAUSTICS_BRIGHTNESS DEBUG_VIEW entityShadowDistanceMul HANDHELD_LIGHT_RANGE CLOUD_SHADOW_STRENGTH CloudLayer0_coverage CloudLayer0_density CloudLayer0_height CloudLayer1_coverage CloudLayer1_density CloudLayer1_height CloudLayer2_coverage CloudLayer2_density CloudLayer2_height PLANET_GROUND_BRIGHTNESS FOG_START_HEIGHT WATER_WAVE_STRENGTH SWAMP_UNIFORM_DENSITY SWAMP_CLOUDY_DENSITY SWAMP_R SWAMP_G SWAMP_B JUNGLE_UNIFORM_DENSITY JUNGLE_CLOUDY_DENSITY JUNGLE_R JUNGLE_G JUNGLE_B DARKFOREST_UNIFORM_DENSITY DARKFOREST_CLOUDY_DENSITY DARKFOREST_R DARKFOREST_G DARKFOREST_B NETHER_PLUME_DENSITY END_STORM_DENSTIY LIT_PARTICLE_BRIGHTNESS UPPER_CURVE LOWER_CURVE EMISSIVE_TYPE SCALE_FACTOR ambientsss_brightness SSS_TYPE Cloud_Speed ORB_ColMult ORB_X ORB_Y ORB_Z ORB_R ORB_G ORB_B TOD_Fog_mult Morning_Uniform_Fog Noon_Uniform_Fog Evening_Uniform_Fog Night_Uniform_Fog Morning_Cloudy_Fog Noon_Cloudy_Fog Evening_Cloudy_Fog Night_Cloudy_Fog Summer_Leaf_R Summer_Leaf_G Summer_Leaf_B Fall_Leaf_R Fall_Leaf_G Fall_Leaf_B Winter_Leaf_R Winter_Leaf_G Winter_Leaf_B Spring_Leaf_R Spring_Leaf_G Spring_Leaf_B Summer_R Summer_G Summer_B Fall_R Fall_G Fall_B Winter_R Winter_G Winter_B Spring_R Spring_G Spring_B Season_Length CaveFogFallOff CaveFogColor_R CaveFogColor_G CaveFogColor_B indirect_effect GI_Strength ambient_brightness AmbientLight_R AmbientLight_G AmbientLight_B Rain_coverage Moon_temp Haze_amount RainFog_amount Sun_temp Puddle_Size LabSSS_Curve Emissive_Curve Emissive_Brightness AO_Strength BLOOMY_FOG WAVY_SPEED WAVY_STRENGTH BLOOM_STRENGTH shadowDistance Sky_Brightness fog_coefficientMieR fog_coefficientMieG fog_coefficientMieB sun_illuminance sunColorG sunColorB sunColorR sky_mieg sky_coefficientMieB sky_coefficientMieG sky_coefficientMieR sky_coefficientRayleighB sky_coefficientRayleighG sky_coefficientRayleighR CLOUDS_QUALITY EXPOSURE_MULTIPLIER MIN_LIGHT_AMOUNT TORCH_R TORCH_G TORCH_B TORCH_AMOUNT shadowMapResolution sunPathRotation BLEND_FACTOR VL_SAMPLES Exposure_Speed POM_DEPTH MAX_ITERATIONS MAX_DIST SSR_STEPS ambientOcclusionLevel SEA_LEVEL moon_illuminance moonColorR moonColorG moonColorB fog_coefficientRayleighR fog_coefficientRayleighG SATURATION Manual_exposure_value focal aperture MANUAL_FOCUS SHADOW_FILTER_SAMPLE_COUNT Max_Filter_Depth VPS_Search_Samples Min_Shadow_Filter_Radius Max_Shadow_Filter_Radius Water_Top_Layer fog_coefficientRayleighB SHARPENING rayMarchSampleCount Dirt_Amount Dirt_Scatter_R Dirt_Scatter_G Dirt_Scatter_B Dirt_Absorb_R Dirt_Absorb_G Dirt_Absorb_B Water_Absorb_R Water_Absorb_G Water_Absorb_B Purkinje_strength Purkinje_strength Purkinje_R Purkinje_G Purkinje_B Texture_MipMap_Bias DoF_Adaptation_Speed Purkinje_Multiplier CROSSTALK VL_RENDER_RESOLUTION BLOOM_QUALITY VL_RENDER_RESOLUTION RAY_COUNT STEPS STEP_LENGTH cloud_LevelOfDetail cloud_ShadowLevelOfDetail cloud_LevelOfDetailLQ cloud_ShadowLevelOfDetailLQ minRayMarchSteps maxRayMarchSteps minRayMarchStepsLQ maxRayMarchStepsLQ fbmAmount fbmPower1 fbmPower2 Roughness_Threshold Sun_specular_Strength reflection_quality DOF_QUALITY DOF_ANAMORPHIC_RATIO AEROCHROME_PINKNESS DOF_JITTER_FOCUS JITTER_STRENGTH SHADOWS_GRADE_R MIDS_GRADE_R HIGHLIGHTS_GRADE_R SHADOWS_GRADE_G MIDS_GRADE_G HIGHLIGHTS_GRADE_G SHADOWS_GRADE_B MIDS_GRADE_B HIGHLIGHTS_GRADE_B SHADOWS_GRADE_MUL MIDS_GRADE_MUL HIGHLIGHTS_GRADE_MUL LPV_SATURATION LPV_TINT_SATURATION LPV_NORMAL_STRENGTH screen.columns=2 screen = \ -BLISS_SHADERS \ +SHADER_VERSION_LABEL \ \ [Direct_Light] [World] \ [Ambient_light] [Fog] \ [Post_Processing] [Clouds] \ -[Resource_Pack_Support] [Climate] \ +[Resource_Pack_Support] [Climate] \ \ [Misc_Settings] [Mod_support] \ @@ -189,7 +207,8 @@ BLISS_SHADERS \ LPV_SATURATION LPV_COLORED_CANDLES \ LPV_TINT_SATURATION LPV_REDSTONE_LIGHTS \ LPV_NORMAL_STRENGTH LPV_ENTITY_LIGHTS \ - LPV_NOSHADOW_HACK + LPV_NOSHADOW_HACK \ + LPV_VL_FOG_ILLUMINATION LPV_VL_FOG_ILLUMINATION_BRIGHTNESS ######## WORLD screen.World.columns=1 @@ -238,7 +257,7 @@ BLISS_SHADERS \ screen.Clouds.columns = 3 screen.Clouds = VOLUMETRIC_CLOUDS CLOUDS_SHADOWS Cloud_Speed \ CLOUDS_QUALITY CLOUD_SHADOW_STRENGTH Rain_coverage \ - maxRayMarchSteps [DAILY_WEATHER] \ + minRayMarchSteps [DAILY_WEATHER] \ CloudLayer0 CloudLayer1 CloudLayer2 \ CloudLayer0_coverage CloudLayer1_coverage CloudLayer2_coverage \ CloudLayer0_density CloudLayer1_density CloudLayer2_density \ @@ -296,14 +315,14 @@ BLISS_SHADERS \ screen.Exposure = AUTO_EXPOSURE EXPOSURE_MULTIPLIER Exposure_Speed Manual_exposure_value ### TONEMAPS screen.Tonemapping.columns = 1 - screen.Tonemapping = TONEMAP USE_ACES_COLORSPACE_APPROXIMATION SATURATION CROSSTALK CONTRAST + screen.Tonemapping = TONEMAP USE_ACES_COLORSPACE_APPROXIMATION SATURATION CROSSTALK ### PURKINJE screen.Purkinje_effect.columns = 1 screen.Purkinje_effect = Purkinje_strength Purkinje_R Purkinje_G Purkinje_B Purkinje_Multiplier ### COLOR GRADING screen.COLOR_GRADING.columns = 3 screen.COLOR_GRADING = \ - TONE_CURVE LOWER_CURVE UPPER_CURVE \ + LUMINANCE_CURVE LOWER_CURVE UPPER_CURVE \ \ COLOR_GRADING_ENABLED \ SHADOWS_GRADE_R MIDS_GRADE_R HIGHLIGHTS_GRADE_R \ @@ -324,10 +343,12 @@ BLISS_SHADERS \ ######## MISC SETTINGS - screen.Misc_Settings = DEBUG_VIEW [the_orb] display_LUT WhiteWorld SSS_view ambientLight_only LIGHTNING_FLASH LIT_PARTICLE_BRIGHTNESS PLANET_GROUND_BRIGHTNESS BLOOMY_PARTICLES ORIGINAL_CHOCAPIC_SKY BIOME_TINT_WATER CLOUDS_INTERSECT_TERRAIN SELECT_BOX WATER_CAUSTICS_BRIGHTNESS HYPER_DETAILED_WAVES OLD_BLOOM DISABLE_ENCHANT_GLINT DISABLE_VANILLA_EMISSIVES PARTICLE_RENDERING_FIX TRANSLUCENT_ENTITIES + screen.Misc_Settings = [EXPERIMENTAL_STUFF] DEBUG_VIEW [the_end_orb] display_LUT WhiteWorld SSS_view ambientLight_only LIGHTNING_FLASH SELECT_BOX DISABLE_ENCHANT_GLINT DISABLE_VANILLA_EMISSIVES PARTICLE_RENDERING_FIX TRANSLUCENT_ENTITIES LIGHTING_EFFECTS_BLUR_FILTER - screen.the_orb.columns = 1 - screen.the_orb = THE_ORB ORB_X ORB_Y ORB_Z ORB_ColMult ORB_R ORB_G ORB_B + screen.EXPERIMENTAL_STUFF = CLOUDS_INTERSECT_TERRAIN BLOOMY_PARTICLES ORIGINAL_CHOCAPIC_SKY BIOME_TINT_WATER HYPER_DETAILED_WAVES OLD_BLOOM PLANET_GROUND_BRIGHTNESS LIT_PARTICLE_BRIGHTNESS WATER_CAUSTICS_BRIGHTNESS + + screen.the_end_orb.columns = 1 + screen.the_end_orb = THE_ORB ORB_X ORB_Y ORB_Z ORB_ColMult ORB_R ORB_G ORB_B ##################################### diff --git a/shaders/world0/dh_shadow.vsh b/shaders/world0/dh_shadow.vsh index 3dc0bf4..be4ccbc 100644 --- a/shaders/world0/dh_shadow.vsh +++ b/shaders/world0/dh_shadow.vsh @@ -55,7 +55,7 @@ void main() { vec3 position = mat3(gl_ModelViewMatrix) * vec3(gl_Vertex) + gl_ModelViewMatrix[3].xyz; #ifdef DH_OVERDRAW_PREVENTION vec3 worldpos = mat3(shadowModelViewInverse) * position + shadowModelViewInverse[3].xyz; - overdrawCull = 1.0 - clamp(1.0 - length(worldpos) / max(far-16,0.0),0,1); + overdrawCull = 1.0 - clamp(1.0 - length(worldpos) / far,0.0,1.0); #else overdrawCull = 1.0; #endif