mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
World overlay: the distance curve is computed in the projection pass, so its result is never boxed
On Node 26 the engine inlined the projection pass's helpers in another order and left distanceScale out, so every label's paint scale allocated a number: 158 B per candidate per frame against the 154 B budget, where main measures 136 B. The curve now sits beside the altitude curve in snapshotAndProject, with the same arithmetic.
This commit is contained in:
1 parent
256e992372
commit
74673f3c85
1 file changed
+19
-3
@@ -1968,9 +1968,25 @@ function snapshotAndProject(entry, source, viewProjection, keyhole) {
|
|||||||
: 0
|
: 0
|
||||||
: distanceFade(distance, record.distanceOptions);
|
: distanceFade(distance, record.distanceOptions);
|
||||||
const cameraAltitude = _eyeHeight;
|
const cameraAltitude = _eyeHeight;
|
||||||
record.paintScale = entry.distanceScale
|
// The distance curve is local for the same reason as the altitude curve
|
||||||
? distanceScale(distance, entry.distanceScale)
|
// below: through a helper the engine may not inline, its result is boxed.
|
||||||
: 1;
|
// `entry.distanceScale` was normalized when the entry was registered.
|
||||||
|
const scaleCurve = entry.distanceScale;
|
||||||
|
if (!scaleCurve || !Number.isFinite(distance)) {
|
||||||
|
record.paintScale = 1;
|
||||||
|
} else if (
|
||||||
|
distance <= scaleCurve.near ||
|
||||||
|
scaleCurve.far === scaleCurve.near
|
||||||
|
) {
|
||||||
|
record.paintScale = scaleCurve.nearValue;
|
||||||
|
} else if (distance >= scaleCurve.far) {
|
||||||
|
record.paintScale = scaleCurve.farValue;
|
||||||
|
} else {
|
||||||
|
record.paintScale =
|
||||||
|
scaleCurve.nearValue +
|
||||||
|
(scaleCurve.farValue - scaleCurve.nearValue) *
|
||||||
|
((distance - scaleCurve.near) / (scaleCurve.far - scaleCurve.near));
|
||||||
|
}
|
||||||
// Keep the source-configurable piecewise curve local to the projection hot
|
// Keep the source-configurable piecewise curve local to the projection hot
|
||||||
// path. Passing its five doubles through a non-inlined helper boxed them for
|
// path. Passing its five doubles through a non-inlined helper boxed them for
|
||||||
// every thumbnail candidate and broke the shared 154 B/candidate gate.
|
// every thumbnail candidate and broke the shared 154 B/candidate gate.
|
||||||
|
|||||||
Reference in new issue
Block a user