@@ -24,7 +24,7 @@ private: | |||
static constexpr float JUMP_VEL = 11; | |||
static constexpr float DOWN_FORCE = 20 * MASS; | |||
static constexpr Swan::Vec2 SIZE = Swan::Vec2(0.6, 1.9); | |||
static constexpr float LIGHT_LEVEL = 30/255.0; | |||
static constexpr float LIGHT_LEVEL = 0.2; | |||
enum class State { | |||
IDLE, |
@@ -51,7 +51,7 @@ public: | |||
private: | |||
static constexpr int LIGHT_CUTOFF_DIST = 64; | |||
static constexpr float LIGHT_CUTOFF = 0.25/255.0; | |||
static constexpr float LIGHT_CUTOFF = 0.001; | |||
struct Event { | |||
enum class Tag { |
@@ -32,12 +32,11 @@ static uint8_t linToSRGB(float lin) { | |||
s = 1.055 * std::pow(lin, 1/2.4) - 0.055; | |||
} | |||
return std::clamp((int)(s * 255), 0, 255); | |||
return std::clamp((int)round(s * 255), 0, 255); | |||
} | |||
static float attenuate(float dist, float squareDist) { | |||
float a = 1 / (1 + 1.0 * dist + 0.1 * squareDist); | |||
return a > 1 ? 1 : a; | |||
return 1 / (1 + 1 * dist + 0.02 * squareDist); | |||
} | |||
static float attenuate(float dist) { |