Update gameplay

This commit is contained in:
schmelczerandras 2020-10-23 15:19:04 +02:00
commit 23fa7646d6
2 changed files with 165 additions and 33 deletions

View file

@ -15,8 +15,8 @@ export class BlobShape extends Drawable {
float blobSmoothMin(float a, float b)
{
const float k = 300.0;
float res = exp2(-k * a) + exp2(-k * b);
const highp float k = 300.0;
highp float res = exp2(-k * a) + exp2(-k * b);
return -log2(res) / k;
}

View file

@ -52,7 +52,9 @@ export class PlanetShape extends PolygonFactory(settings.planetEdgeCount, 0) {
vec2 center = planetCenters[j];
float l = planetLengths[j];
float randomOffset = planetRandoms[j];
vec2 targetTangent = normalize(target - center);
vec2 targetCenterDelta = target - center;
float targetDistance = length(targetCenterDelta);
vec2 targetTangent = targetCenterDelta / clamp(targetDistance, 0.01, 1000.0);
vec2 noisyTarget = target - (
targetTangent * planetTerrain(vec2(
l * abs(atan(targetTangent.y, targetTangent.x)),