tweak POM_OFFSET_SHADOW_BIAS to be more conservative. improve POM submenu labelling. tweak refraction submenu labelling. Tweak

This commit is contained in:
Xonk
2026-02-13 14:56:52 -05:00
parent d83d79891f
commit 5c610968c8
6 changed files with 30 additions and 16 deletions
+6 -3
View File
@@ -302,6 +302,9 @@ void main() {
float dist = length(fragpos);
float maxdist = MAX_OCCLUSION_DISTANCE;
float pomdepth = (float(POM_DEPTH)/100.0);
if (dist < maxdist) {
float depthmap = readNormal(vtexcoord.st).a;
@@ -310,17 +313,17 @@ void main() {
if ( viewVector.z < 0.0 && depthmap < 0.9999 && depthmap > 0.00001) {
#ifdef Adaptive_Step_length
vec3 interval = (viewVector.xyz /-viewVector.z/MAX_OCCLUSION_POINTS * POM_DEPTH) * clamp(1.0-pow(depthmap,2),0.1,1.0);
vec3 interval = (viewVector.xyz /-viewVector.z/MAX_OCCLUSION_POINTS * pomdepth) * clamp(1.0-pow(depthmap,2),0.1,1.0);
used_POM_DEPTH = 1.0;
#else
vec3 interval = viewVector.xyz/-viewVector.z/ MAX_OCCLUSION_POINTS*POM_DEPTH;
vec3 interval = viewVector.xyz/-viewVector.z/ MAX_OCCLUSION_POINTS*pomdepth;
#endif
vec3 coord = vec3(vtexcoord.st, 1.0);
coord += interval * used_POM_DEPTH;
float sumVec = 0.5;
for (int loopCount = 0; (loopCount < MAX_OCCLUSION_POINTS) && (1.0 - POM_DEPTH + POM_DEPTH * readNormal(coord.st).a ) < coord.p && coord.p >= 0.0; ++loopCount) {
for (int loopCount = 0; (loopCount < MAX_OCCLUSION_POINTS) && (1.0 - pomdepth + pomdepth * readNormal(coord.st).a ) < coord.p && coord.p >= 0.0; ++loopCount) {
coord = coord + interval * used_POM_DEPTH;
sumVec += used_POM_DEPTH;
}
+5 -5
View File
@@ -325,14 +325,14 @@ void main() {
if (falloff > 0.0) {
float depthmap = readNormal(vtexcoord.st).a;
float pomdepth = POM_DEPTH*falloff;
float pomdepth = (float(POM_DEPTH)/100.0)*falloff;
if ( viewVector.z < 0.0 && depthmap < 0.9999 && depthmap > 0.00001) {
float noise = blueNoise();
#ifdef Adaptive_Step_length
vec3 interval = (viewVector.xyz / -viewVector.z / MAX_OCCLUSION_POINTS * pomdepth) * clamp(1.0-pow(depthmap,2),0.1,1.0);
#else
vec3 interval = viewVector.xyz /-viewVector.z/MAX_OCCLUSION_POINTS*pomdepth;
vec3 interval = viewVector.xyz / -viewVector.z / MAX_OCCLUSION_POINTS*pomdepth;
#endif
vec3 coord = vec3(vtexcoord.st , 1.0);
@@ -345,9 +345,9 @@ void main() {
#if defined POM_OFFSET_SHADOW_BIAS
#ifdef Adaptive_Step_length
saveDepth += clamp((1.0/MAX_OCCLUSION_POINTS)*clamp(1.0-pow(depthmap,2),0.1,1.0)-0.0001,0.0,1.0);
saveDepth += clamp((1.0/MAX_OCCLUSION_POINTS)*clamp(1.0-pow(depthmap,2),0.1,1.0),0.0,1.0);
#else
saveDepth += clamp(1.0/MAX_OCCLUSION_POINTS-0.0001,0.0,1.0);
saveDepth += clamp(1.0/MAX_OCCLUSION_POINTS,0.0,1.0);
#endif
#endif
}
@@ -479,7 +479,7 @@ void main() {
else Albedo.a = 0.0;
#if !defined HAND && !defined ENTITIES && defined POM && defined POM_OFFSET_SHADOW_BIAS
if(saveDepth > 0) Albedo.a = clamp(sqrt(saveDepth)*0.45,0.0,Albedo.a);
if(saveDepth > 0) Albedo.a = clamp(saveDepth*0.45,0.0,Albedo.a);
#endif
#endif
+2 -1
View File
@@ -1112,7 +1112,8 @@ void main() {
#endif
#if defined POM && defined POM_OFFSET_SHADOW_BIAS
projectedShadowPosition.z += shadowProjection[3].z * (0.0012 + shadowCutMask * mix(0.25,1.0,POM_DEPTH) * 0.01);
// the idea is to cut the shadows starting position, interpolating down to the lowest depth of POM within a block.
projectedShadowPosition.z += shadowProjection[3].z * (0.0012 + 0.035 * (float(POM_DEPTH)/100.0) * shadowCutMask);
#else
projectedShadowPosition.z += shadowProjection[3].z * 0.0012;
#endif
+15 -5
View File
@@ -171,7 +171,7 @@ screen.Ambient_light = Ambient Light
option.ambientOcclusionLevel = Vanilla AO Amount
option.MINIMUM_OUTDOOR_LIGHT = Minimum Light Brightness §bⓘ Outdoors§
option.MINIMUM_INDOOR_LIGHT = Minimum Light Brightness §bⓘ Indoors§
option.indirect_effect = Indirect Lighting
option.indirect_effect = Indirect Lighting Mode
value.indirect_effect.VANILLA_AO = Vanilla AO
value.indirect_effect.SSAO_FILTERED = SSAO
value.indirect_effect.SSAO_HQ = HQ SSAO
@@ -294,12 +294,19 @@ screen.Resource_Pack_Support = Materials / Resource Pack Support
value.SSS_TYPE.3 = LabSSS only
screen.POM = Parallax Occlusion Mapping / POM
option.POM = Parallax Occlusion Mapping
option.POM = Parallax Occlusion Mapping / POM
option.MAX_ITERATIONS = Quality
suffix.MAX_ITERATIONS = §r Steps
option.POM_DEPTH = Depth
suffix.POM_DEPTH = §r Centimeters
value.POM_DEPTH.1 = 1 Centimeter
value.POM_DEPTH.100 = 1 Meter
option.MAX_DIST = Maximum Distance
suffix.MAX_DIST = §r Meters
option.Adaptive_Step_length = Dynamic Quality
option.Horrible_slope_normals = Horrible Slope Normals
option.POM_OFFSET_SHADOW_BIAS = Self Shadowing Fix §bⓘ needs depthwrite POM§r §c⚠ can cause light leaks§r
option.DEPTH_WRITE_POM = Depth Write POM
option.LABEL_0 = §bⓘ "Reflections on terrain" must be enabled for wetness to work
value.LABEL_0.0 = §bⓘ§r
@@ -359,6 +366,9 @@ screen.Resource_Pack_Support = Materials / Resource Pack Support
option.MAX_DIST.comment = The maximum distance from the camera that the parallax occlusion mapping effect can render. §a⚠ PERFORMANCE COST:§r high
option.Adaptive_Step_length.comment = This will increase visual quality without needing to increase the actual quality. This causes some artifacts if you look really close, or have a very busy heightmap with sharp varying heights.
option.Horrible_slope_normals.comment = This is a poorly done implementation to give a surface to the sides of the parallax occlusion mapping. i do not recommend this. §a⚠ PERFORMANCE COST:§r low
option.DEPTH_WRITE_POM.comment = §bⓘ What is this?§r By writing the results of POM into the depth buffers, all lighting effects that use the depth buffer will now properly interact with POM. §a⚠ PERFORMANCE COST:§r medium
option.POM_OFFSET_SHADOW_BIAS.comment = §bⓘ What is this?§r When "Depth Write POM" is enabled, the ShadowMap does not know POM is changing the surface depth, causing an ugly shadow cast from an invisible surface onto the deeper POM parts. §a⚠ PERFORMANCE COST:§r very low
screen.Porosity.comment = Configure settings related to wetness and puddles
option.Porosity.comment = §bⓘ What is this?§r Porosity is a description of how porous some material is, or essentially how much water can be held inside it. for examle, sponges are very porous; water is contained within and darkens it as a results. §a⚠ PERFORMANCE COST:§r low
@@ -953,15 +963,15 @@ screen.Water = Water Settings
option.MINIMUM_WATER_ABSORBANCE = Minimum Water Absorbance
value.MINIMUM_WATER_ABSORBANCE.-1 = AUTO
option.FAKE_REFRACTION_AMOUNT = Refraction amount
option.FAKE_REFRACTION_AMOUNT = Refraction Amount
value.FAKE_REFRACTION_AMOUNT.0 = §cOFF
suffix.FAKE_REFRACTION_AMOUNT =%
option.FAKE_DISPERSION_AMOUNT = Dispersion amount
option.FAKE_DISPERSION_AMOUNT = Rainbow Dispersion Amount
value.FAKE_DISPERSION_AMOUNT.0 = §cOFF
suffix.FAKE_DISPERSION_AMOUNT =%
option.REFRACTION_SMUDGE_AMOUNT = Smudge amount
option.REFRACTION_SMUDGE_AMOUNT = Smudge Amount
value.REFRACTION_SMUDGE_AMOUNT.0 = §cOFF
suffix.REFRACTION_SMUDGE_AMOUNT =%
+1 -1
View File
@@ -324,7 +324,7 @@
#define DEPTH_WRITE_POM
#define MAX_ITERATIONS 35 // [5 10 15 20 25 30 35 40 45 50 60 70 80 90 100 125 150 200 300 400 500]
#define MAX_DIST 25.0 // [5.0 10.0 15.0 20.0 25.0 35.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0 125.0 150.0 200.0 300.0 400.0 500.0]
#define POM_DEPTH 0.25 // [0.025 0.05 0.075 0.1 0.125 0.15 0.20 0.25 0.30 0.50 0.75 1.0]
#define POM_DEPTH 25 // [1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100]
#define Adaptive_Step_length
// #define Horrible_slope_normals
#if defined POM && defined DEPTH_WRITE_POM
+1 -1
View File
@@ -264,7 +264,7 @@ screen = \
screen.Emissives = EMISSIVE_TYPE Emissive_Brightness Emissive_Curve
screen.POM.columns=1
screen.POM = POM Adaptive_Step_length MAX_ITERATIONS POM_DEPTH MAX_DIST Horrible_slope_normals POM_OFFSET_SHADOW_BIAS DEPTH_WRITE_POM
screen.POM = POM POM_DEPTH MAX_ITERATIONS MAX_DIST <empty> Adaptive_Step_length DEPTH_WRITE_POM POM_OFFSET_SHADOW_BIAS Horrible_slope_normals
screen.WETNESS.columns = 1
screen.WETNESS = LABEL_0 PUDDLE_MODE Puddle_Size