Keep the star visible at the distance that frames its system
Framing the whole system pushed the camera far enough back that the star at the centre became a speck — about a pixel across for the Sun. The cause is a constraint that cannot be tuned away. A star is sized against its system's innermost orbit, because it must never swallow its closest planet, while the camera is placed to frame the outermost ring. In the solar system those differ by a factor of a hundred: at the distance that fits Pluto in view, a disc that stays clear of Mercury is a pixel across. No radius satisfies both, because the information genuinely does not fit on one screen at that zoom. So the disc stays honest to the orbits and the halo carries the visibility. Light is not a surface: a glow that reaches past the innermost orbit says the star is bright, not that it is large. Its extent is still a multiple of the star — so a compact system keeps exactly the corona it had — but floored against the framed radius, which is what the wide systems needed. The disc grows a little too: it may now reach 45% of the innermost orbit rather than 35%, which still leaves clear space between the star's limb and the closest orbit. Also makes createGlowSprite take the extent it will draw rather than a radius and a multiplier. The two were only ever multiplied together, and how large a star's halo should be is not a property of the star — it depends on how its system is framed, which is a decision that belongs with the framing. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WaySiNst4HhDXBHnMy8p5G
This commit is contained in:
@@ -88,12 +88,16 @@ export function createGlowTexture(color: THREE.ColorRepresentation, profile: Glo
|
||||
|
||||
/**
|
||||
* Builds a soft additive-blended glow halo (used for planetary atmospheres and the Sun's
|
||||
* corona) sized relative to the given object radius. Cheap billboard-sprite approximation
|
||||
* rather than a view-angle-correct Fresnel shader, chosen to stay within built-in material
|
||||
* types the WebGPU backend renders natively (see plan risk on TSL/shader maturity). Falls back
|
||||
* to a flat-colored (gradient-less) sprite if canvas rendering is unavailable.
|
||||
* corona), `extent` across in world units. Cheap billboard-sprite approximation rather than a
|
||||
* view-angle-correct Fresnel shader, chosen to stay within built-in material types the WebGPU
|
||||
* backend renders natively (see plan risk on TSL/shader maturity). Falls back to a
|
||||
* flat-colored (gradient-less) sprite if canvas rendering is unavailable.
|
||||
*
|
||||
* Takes the finished extent rather than a radius and a multiplier: how big a star's halo should
|
||||
* be is not a fixed multiple of the star, it depends on how the system is framed, and that
|
||||
* decision belongs with the framing (see `starGlowExtentAu`).
|
||||
*/
|
||||
export function createGlowSprite(color: THREE.ColorRepresentation, radius: number, scale: number): THREE.Sprite {
|
||||
export function createGlowSprite(color: THREE.ColorRepresentation, extent: number): THREE.Sprite {
|
||||
const material = new THREE.SpriteMaterial({
|
||||
map: createGlowTexture(color),
|
||||
color: color,
|
||||
@@ -102,6 +106,6 @@ export function createGlowSprite(color: THREE.ColorRepresentation, radius: numbe
|
||||
blending: THREE.AdditiveBlending
|
||||
});
|
||||
const sprite = new THREE.Sprite(material);
|
||||
sprite.scale.setScalar(radius * scale);
|
||||
sprite.scale.setScalar(extent);
|
||||
return sprite;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user