Customizable atmosphere transformation
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## What problem does this solve or what need does it fill?
Currently the scene for the atmosphere is fixed oriented directly above the ground surface at the radius of the planet, also referred to as the bottom radius of the atmosphere. With the addition of ray-marched rendering in #20766 and enabling views from outer space, above the atmosphere, we need to support use cases to customize the observer's position relative to the atmosphere.
## What solution would you like?
Atmosphere as entity and culling: this implies multiple atmospheres are possible to render for one observer, and need to enable frustum culling and occlusion culling by modeling the atmosphere as a set of nested spheres. An opaque planet as the inner sphere, and the translucent atmosphere as a outer sphere, just like in Bevy's current atmosphere model for rendering.
Global transform support: Rather than including an additional property on `AtmosphereSettings` such as `origin`, `view_origin` or `altitude`, we can move the planet and it's atmosphere relative to the observer (camera / view) by setting the `Transform` on it. The same is true for the camera itself, so if the atmosphere is left at the origin point with no transform, the observer could be moved (0, bottom radius, 0) to be at the north pole of the planet with the Y being the up axis.
For the initial iteration it is enough to simply render the nearest atmosphere to the camera, since multi-atmosphere support is a niche feature. Alternatively, just print an error and ignore the second atmosphere but keep the program open and running.
## What alternative(s) have you considered?
Include an additional property on `AtmosphereSettings` such as `origin`, `view_origin` or `altitude`, and offset the return value of `view_radius` (pre raymarch changes) or `get_view_position` (post raymarch changes)
Contributor guide
Research direction
Start by reading the ray-marched rendering changes in #20766 and the existing AtmosphereSettings flow, including view_radius or get_view_position. Trace how camera and atmosphere transforms are handled, then define and test the chosen entity, culling, and nearest-atmosphere behavior. Done means an observer can move relative to a transformed atmosphere and views from outer space render correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics, game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100