diff --git a/plugin/contents/ui/dancer.html b/plugin/contents/ui/dancer.html
index 786c076..2129cda 100644
--- a/plugin/contents/ui/dancer.html
+++ b/plugin/contents/ui/dancer.html
@@ -1358,31 +1358,45 @@ function mwDensity(l, b) {
const lr = l * DEG;
const riftA = 0.6 + 1.55 * Math.sin(lr * 2.1 + 0.5) + 0.55 * Math.sin(lr * 7.0);
const riftB = -2.5 + 0.85 * Math.sin(lr * 1.4 + 2.2);
- const darkA = Math.exp(-0.5 * ((b - riftA) / (0.72 + 0.72 * fine)) ** 2) *
- (0.66 + 0.30 * fine);
- const darkB = Math.exp(-0.5 * ((b - riftB) / 0.95) ** 2) * 0.58;
- density *= 1 - Math.min(0.94, (darkA + darkB) * riftReach);
+ const darkA = Math.exp(-0.5 * ((b - riftA) / (0.85 + 0.75 * fine)) ** 2) *
+ (0.58 + 0.22 * fine);
+ const darkB = Math.exp(-0.5 * ((b - riftB) / 1.10) ** 2) * 0.44;
+ /* Poeira reduz contraste, mas nunca perfura a faixa luminosa. */
+ density *= 1 - Math.min(0.38, (darkA + darkB) * riftReach);
+ density += plane * (0.045 + 0.075 * fine);
/* Saco de Carvão junto ao Cruzeiro do Sul. */
const coal = Math.exp(-0.5 * ((mwAngularDistance(l, 303) / 3.8) ** 2 +
((b + 1.5) / 2.8) ** 2));
- density *= 1 - 0.84 * coal;
+ density *= 1 - 0.38 * coal;
- return Math.max(0, density * (0.24 + 0.76 * Math.exp(-((dl / 105) ** 2))));
+ return Math.max(0, density * (0.36 + 0.64 * Math.exp(-((dl / 110) ** 2))));
}
-function mwWriteRgb(pixels, offset, dl) {
+function mwWriteRgb(pixels, offset, l, b) {
+ const dl = Math.min(l, 360 - l);
const t = Math.min(1, dl / 150);
const u = t < 0.5 ? t * 2 : (t - 0.5) * 2;
+ let r, g, bl;
if (t < 0.5) {
- pixels[offset] = 255 + (226 - 255) * u;
- pixels[offset + 1] = 199 + (218 - 199) * u;
- pixels[offset + 2] = 145 + (239 - 145) * u;
+ r = 255 + (210 - 255) * u;
+ g = 178 + (181 - 178) * u;
+ bl = 112 + (246 - 112) * u;
} else {
- pixels[offset] = 226 + (148 - 226) * u;
- pixels[offset + 1] = 218 + (201 - 218) * u;
- pixels[offset + 2] = 239 + (255 - 239) * u;
+ r = 210 + (105 - 210) * u;
+ g = 181 + (197 - 181) * u;
+ bl = 246 + (255 - 246) * u;
}
+ /* Pequena separação cromática transversal: âmbar/magenta de um lado,
+ azul-ciano do outro, como numa astrofoto com exposição puxada. */
+ const tint = 0.5 + 0.5 * Math.sin(l * DEG * 1.7 + b * DEG * 8.0 + 1.1);
+ const edge = Math.min(1, Math.abs(b) / 14);
+ r += 24 * (1 - tint) * (0.35 + edge);
+ g -= 12 * (1 - tint) * edge;
+ bl += 18 * tint * (0.35 + edge);
+ pixels[offset] = Math.max(0, Math.min(255, r));
+ pixels[offset + 1] = Math.max(0, Math.min(255, g));
+ pixels[offset + 2] = Math.max(0, Math.min(255, bl));
}
function renderMilkyWay(W, H, horizonPx, lst, glareOn) {
@@ -1434,7 +1448,7 @@ function renderMilkyWay(W, H, horizonPx, lst, glareOn) {
const exposure = 1 - Math.exp(-density * 0.72);
const alpha = Math.min(0.46, exposure * 0.42) * ext * glare;
if (alpha < 0.002) continue;
- mwWriteRgb(pixels, offset, Math.min(l, 360 - l));
+ mwWriteRgb(pixels, offset, l, b);
pixels[offset + 3] = alpha * 255;
}
}
@@ -1465,11 +1479,11 @@ function projectSky() {
bctx.imageSmoothingQuality = 'high';
bctx.save();
bctx.globalCompositeOperation = 'lighter';
- bctx.globalAlpha = 0.48;
- bctx.filter = `blur(${Math.max(10, H * 0.014)}px) saturate(155%)`;
+ bctx.globalAlpha = 0.40;
+ bctx.filter = `blur(${Math.max(10, H * 0.014)}px) saturate(180%)`;
bctx.drawImage(mwLayer, 0, 0, W, horizonPx);
- bctx.globalAlpha = 0.92;
- bctx.filter = 'contrast(118%) saturate(128%)';
+ bctx.globalAlpha = 0.96;
+ bctx.filter = 'contrast(122%) saturate(150%)';
bctx.drawImage(mwLayer, 0, 0, W, horizonPx);
bctx.restore();