perf: reduce cloud noise octaves
This commit is contained in:
1 parent
b4d44079ea
commit
99ca1b069c
1 file changed
+10
-12
Vendored
+10
-12
@@ -194,19 +194,18 @@ var FRAG_SRC = [
|
||||
'mix(hash3(i + vec3(0,1,1)), hash3(i + vec3(1,1,1)), f.x), f.y),',
|
||||
'f.z);',
|
||||
'}',
|
||||
// Four octaves (the name stayed): the extra high-frequency octave breaks
|
||||
// up the iso-surfaces that made the deck read as stacked slabs. Sum is
|
||||
// renormalised to the old 0.875 range so baseThresh still means the same
|
||||
// cloud coverage.
|
||||
// Three octaves: cheaper cloud noise while keeping the base coverage
|
||||
// range near 0.875. The detail octave in cloudDensity still breaks up
|
||||
// close silhouettes.
|
||||
'float fbm3(vec3 p) {',
|
||||
'float v = 0.0;',
|
||||
'float a = 0.5;',
|
||||
'for (int i = 0; i < 4; i++) {',
|
||||
'for (int i = 0; i < 3; i++) {',
|
||||
'v += a * noise3(p);',
|
||||
'p = p * 2.03 + vec3(13.7, 7.1, 19.3);',
|
||||
'a *= 0.5;',
|
||||
'}',
|
||||
'return v * 0.93333;',
|
||||
'return v;',
|
||||
'}',
|
||||
// Density at a point in the cloud layer. Two fBm layers: the
|
||||
// base one at low frequency gives the large puffs, the detail
|
||||
@@ -826,19 +825,18 @@ var CLOUD_SAMPLER_GLSL = [
|
||||
'mix(hash3(i + vec3(0,1,1)), hash3(i + vec3(1,1,1)), f.x), f.y),',
|
||||
'f.z);',
|
||||
'}',
|
||||
// Four octaves (the name stayed): the extra high-frequency octave breaks
|
||||
// up the iso-surfaces that made the deck read as stacked slabs. Sum is
|
||||
// renormalised to the old 0.875 range so baseThresh still means the same
|
||||
// cloud coverage.
|
||||
// Three octaves: cheaper cloud noise while keeping the base coverage
|
||||
// range near 0.875. The detail octave in cloudDensity still breaks up
|
||||
// close silhouettes.
|
||||
'float fbm3(vec3 p) {',
|
||||
'float v = 0.0;',
|
||||
'float a = 0.5;',
|
||||
'for (int i = 0; i < 4; i++) {',
|
||||
'for (int i = 0; i < 3; i++) {',
|
||||
'v += a * noise3(p);',
|
||||
'p = p * 2.03 + vec3(13.7, 7.1, 19.3);',
|
||||
'a *= 0.5;',
|
||||
'}',
|
||||
'return v * 0.93333;',
|
||||
'return v;',
|
||||
'}',
|
||||
// Height field lookup on the same grid the mesh was built from, so a
|
||||
// ridge occludes exactly the ridge you can see.
|
||||
|
||||
Reference in new issue
Block a user