Fixing the shader on mobile devices(?)

This commit is contained in:
Rezmason
2018-09-08 18:25:33 -07:00
parent 33b7f58ac1
commit a8dcc52c8e
2 changed files with 6 additions and 4 deletions

View File

@@ -30,9 +30,10 @@
glyphSequenceLength: 27,
palette: [
{color: new THREE.Vector3(0.00, 0.00, 0.00), at: 0.0},
{color: new THREE.Vector3(0.52, 0.00, 0.00), at: 0.4},
{color: new THREE.Vector3(0.82, 0.05, 0.05), at: 0.8},
{color: new THREE.Vector3(1.00, 0.40, 0.30), at: 1.0},
{color: new THREE.Vector3(0.52, 0.00, 0.00), at: 0.2},
{color: new THREE.Vector3(0.82, 0.05, 0.05), at: 0.4},
{color: new THREE.Vector3(1.00, 0.60, 0.30), at: 0.8},
{color: new THREE.Vector3(1.00, 1.00, 0.90), at: 1.0},
],
fallSpeed: 0.4,
cycleSpeed: 0.5,

View File

@@ -63,7 +63,7 @@ const glyphVariable = gpuCompute.addVariable(
float newBrightness = 3.0 * log(value * 1.25);
#ifdef hasThunder
float thunder = 10.0 * (pow(sin(SQRT_5 * simTime), 1000.0) + pow(sin(SQRT_2 * simTime), 1000.0)) + 0.5;
float thunder = 10.0 * (pow(pow(sin(SQRT_5 * simTime), 10.0), 10.0) + pow(pow(sin(SQRT_2 * simTime), 10.0), 10.0)) + 0.6;
newBrightness *= thunder;
@@ -72,6 +72,7 @@ const glyphVariable = gpuCompute.addVariable(
} else {
brightness = mix(brightness, newBrightness, brightnessChangeBias * 0.1);
}
brightness = min(1.0, brightness);
#else
brightness = mix(brightness, newBrightness, brightnessChangeBias);
#endif