perf: reduce haze column samples

This commit is contained in:
Richard Zink committed 2026-10-13 20:26:26 +02:00
1 parent 8ea8316b19
commit 30c5b4eb7c
1 file changed
+5 -5
+5 -5
View File
@@ -379,10 +379,10 @@ var FRAG_SRC = [
'else if (t2 > 0.0) tEnd = min(tEnd, t2);',
'}',
'if (tEnd <= tStart) return 0.0;',
'float step = (tEnd - tStart) / 16.0;',
'float step = (tEnd - tStart) / 10.0;',
'float t = tStart + step * 0.5;',
'float column = 0.0;',
'for (int i = 0; i < 16; i++) {',
'for (int i = 0; i < 10; i++) {',
'vec3 p = uCamPos + rd * t;',
'float alt = max(0.0, length(p - C) - R);',
'column += exp(-alt / Hs) * step / Hs;',
@@ -438,11 +438,11 @@ var FRAG_SRC = [
'float Hs = max(0.05, uFrontHazeScaleHeightUnits);',
'vec3 C = vec3(uCamPos.x, -R, uCamPos.z);',
'float column = 0.0;',
'for (int i = 0; i < 8; i++) {',
'float t = dist * (float(i) + 0.5) / 8.0;',
'for (int i = 0; i < 6; i++) {',
'float t = dist * (float(i) + 0.5) / 6.0;',
'vec3 p = uCamPos + rd * t;',
'float alt = max(0.0, length(p - C) - R);',
'column += exp(-alt / Hs) * dist / 8.0 / Hs;',
'column += exp(-alt / Hs) * dist / 6.0 / Hs;',
'}',
'return column;',
'}',