mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
refactor(sky): cut what the sky does not need
- qa-anime-sky keeps only the Milky Way case; the satellites and keyless cases checked an anime shader this branch no longer changes. - Drop qa-sky-sun-moon.mjs: the viewer-options unit test covers it. - VisualEffects sets the sky's visibility directly: the viewer always carries a StarrySky and never outlives the effects. - Drop the unused star intensity knob, the malformed-row tolerance for our own pack, the test-only Transforms parameter and a private-name test. - DATA_SOURCES points to sky/README.md instead of repeating it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
d94cc35c81
commit
b00c7c12c8
10 files changed
+131
-515
No files matched your search
+6
-27
@@ -109,38 +109,17 @@ export function bvToRgb(bv) {
|
||||
return rgb.map((channel) => channel / peak);
|
||||
}
|
||||
|
||||
/**
|
||||
* Decode a catalogue pack into interleaved vertex data, `STAR_VERTEX_FLOATS`
|
||||
* per star. Malformed rows are skipped, never thrown on: a damaged pack must
|
||||
* not take the globe down with it.
|
||||
*/
|
||||
export function buildStarVertices(pack) {
|
||||
const stars = Array.isArray(pack?.stars) ? pack.stars : [];
|
||||
const count = Math.floor(stars.length / 4);
|
||||
/** Decode a catalogue pack into interleaved vertex data, `STAR_VERTEX_FLOATS` per star. */
|
||||
export function buildStarVertices({ stars }) {
|
||||
const count = stars.length / 4;
|
||||
const vertices = new Float32Array(count * STAR_VERTEX_FLOATS);
|
||||
let written = 0;
|
||||
for (let i = 0; i < count; i++) {
|
||||
const [raDeg, decDeg, vmag, bv] = stars.slice(i * 4, i * 4 + 4);
|
||||
if (
|
||||
!Number.isFinite(raDeg) ||
|
||||
!Number.isFinite(decDeg) ||
|
||||
!Number.isFinite(vmag)
|
||||
)
|
||||
continue;
|
||||
const [x, y, z] = raDecToUnitVector(raDeg, decDeg);
|
||||
const { sigmaPx, alpha } = starAppearance(vmag);
|
||||
const [r, g, b] = bvToRgb(bv);
|
||||
vertices.set(
|
||||
[x, y, z, sigmaPx, r, g, b, alpha],
|
||||
written * STAR_VERTEX_FLOATS,
|
||||
[...raDecToUnitVector(raDeg, decDeg), sigmaPx, ...bvToRgb(bv), alpha],
|
||||
i * STAR_VERTEX_FLOATS,
|
||||
);
|
||||
written += 1;
|
||||
}
|
||||
return {
|
||||
count: written,
|
||||
vertices:
|
||||
written === count
|
||||
? vertices
|
||||
: vertices.slice(0, written * STAR_VERTEX_FLOATS),
|
||||
};
|
||||
return { count, vertices };
|
||||
}
|
||||
Reference in new issue
Block a user