Tint a planet host in the star field at the archive's temperature, which its disc is drawn at
95ffb00 said the field took "the same function and the same temperature the disc is drawn with".
It did for stars without planets, but a host's disc is drawn at the archive's st_teff
(starSurfaceOf), and the field read the host's temperature off its colour. Of the 4 485 hosts with
a temperature on the published catalogue, 1 755 were more than 0.1 in RGB from their own disc:
Kepler-186 at 3 096 K in the field and 3 788 K on its disc, HD 97048 at 6 825 and 10 000.
The scene now hands StarFieldRenderer each host's first published temperature among its planets,
the rule starSurfaceOf uses (publishedTemperaturesK, beside it), and the field tints that star at
it. Over the catalogue the hosts more than 0.1 off their disc go from 1 755 to 0. Measured in the
running app at 1600x1000, field tint against the disc's starTint after entering each: Kepler-186
(1, 0.620, 0.326) against (1, 0.619, 0.326), where the field was (1, 0.498, 0.174); Teegarden's
Star 0.001 apart; Proxima, HD 97048 and Sirius 0.
The field's test compared colorIndexToRgb with the same formula. The new scene test enters Proxima,
whose B-V 1.8 reads 3 070 K and whose disc is drawn at the archive's 2 900, and compares its field
colour with the disc's. Controls, each failing that test alone: the field ignoring the map it is
given, and the scene passing an empty one.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1016,6 +1016,15 @@ describe('GalaxySystemSceneComponent camera-flight transitions', () => {
|
||||
expect(scene.hudReadouts().find((readout) => readout.label === 'Radius')?.value).toBe('0.141 solar radii');
|
||||
});
|
||||
|
||||
it('tints a host in the star field the colour its disc is drawn in, at the temperature the archive gives it', async () => {
|
||||
// Proxima's B−V 1.8 reads 3 070 K; its disc is drawn at the archive's 2 900.
|
||||
const scene = await enter(PROXIMA);
|
||||
const field = (scene as unknown as { starField: { catalogueColors: Float32Array } }).starField.catalogueColors;
|
||||
const at = STARS.indexOf(PROXIMA) * 3;
|
||||
const disc = scene.starTint.value;
|
||||
expect([field[at], field[at + 1], field[at + 2]].map((channel) => channel.toFixed(4))).toEqual([disc.r, disc.g, disc.b].map((channel) => channel.toFixed(4)));
|
||||
});
|
||||
|
||||
it("warms a host's planets by the luminosity the archive gives it, in the system as on their own page", async () => {
|
||||
const scene = await enter(PROXIMA);
|
||||
const planet = (scene.systemRenderer as unknown as { members: { id: string; marker: THREE.Mesh }[] }).members.find((member) => member.id === PROXIMA_B.id)!;
|
||||
|
||||
Reference in New Issue
Block a user