revert: cloud raymarch LOD
This commit is contained in:
1 parent
b906986718
commit
121b80b117
2 files changed
+4
-11
No files matched your search
@@ -303,8 +303,6 @@ Other main performance knobs:
|
||||
- `antialias: false`: disables MSAA.
|
||||
- `maxFps`: caps the animation loop.
|
||||
- `clouds.maxMarchUnits`: maximum cloud raymarch length.
|
||||
- Cloud raymarch uses 48 samples with distance-adaptive spacing: finer near
|
||||
the camera, coarser toward the march limit.
|
||||
- `clouds.softEdges`, `edgeSoftness`, `horizonSoftness`: soft cloud edges;
|
||||
disabling `softEdges` restores the old hard shell behaviour.
|
||||
- `terrain.lod`: distance-dependent terrain mesh LOD; fine near the centre,
|
||||
|
||||
Vendored
+4
-9
@@ -719,8 +719,8 @@ var FRAG_SRC = [
|
||||
'float maxMarch = max(1.0, uCloudMaxMarch);',
|
||||
'tExit = min(tExit, tEnter + maxMarch);',
|
||||
'if (tExit <= tEnter) { gl_FragColor = vec4(0.0); return; }',
|
||||
'float marchCurve = 2.5;',
|
||||
'float marchDenom = 1.0 - exp(-marchCurve);',
|
||||
'float stepSize = (tExit - tEnter) / 32.0;',
|
||||
'float t = tEnter + stepSize * 0.5;',
|
||||
'float coverage = clamp(uDensity, 0.0, 1.0);',
|
||||
'float baseThresh = mix(0.62, 0.20, coverage);',
|
||||
'float densityGain = mix(0.45, 1.0, coverage);',
|
||||
@@ -729,13 +729,7 @@ var FRAG_SRC = [
|
||||
'float phase = 0.30 + 0.70 * pow(max(0.0, cosT), 2.5);',
|
||||
'float trans = 1.0;',
|
||||
'vec3 cloudSum = vec3(0.0);',
|
||||
'for (int i = 0; i < 48; i++) {',
|
||||
'float u = (float(i) + 0.5) / 48.0;',
|
||||
'float uNext = (float(i) + 1.5) / 48.0;',
|
||||
'float mapU = (1.0 - exp(-marchCurve * u)) / marchDenom;',
|
||||
'float mapUNext = (1.0 - exp(-marchCurve * uNext)) / marchDenom;',
|
||||
'float t = tEnter + (tExit - tEnter) * mapU;',
|
||||
'float stepSize = (tExit - tEnter) * (mapUNext - mapU);',
|
||||
'for (int i = 0; i < 32; i++) {',
|
||||
'vec3 p = uCamPos + rd * t;',
|
||||
'p += rd * (ign(gl_FragCoord.xy + vec2(float(i) * 7.13, float(i) * 3.71)) - 0.5) * stepSize * 0.25;',
|
||||
'float alt = p.y + earthDrop(p.xz);',
|
||||
@@ -757,6 +751,7 @@ var FRAG_SRC = [
|
||||
'trans *= (1.0 - alpha);',
|
||||
'if (trans < 0.04) break;',
|
||||
'}',
|
||||
't += stepSize;',
|
||||
'}',
|
||||
'float cloudAlpha = 1.0 - trans;',
|
||||
'vec3 cloudColor = (cloudAlpha > 0.001) ? cloudSum / cloudAlpha : vec3(0.0);',
|
||||
|
||||
Reference in new issue
Block a user