BarthPaleologue / CosmosJourneyer

A space exploration game with a fully simulated universe running in the browser
https://cosmosjourneyer.com/
GNU Affero General Public License v3.0
11 stars 4 forks source link

Fix rendering order #149

Closed BarthPaleologue closed 1 month ago

BarthPaleologue commented 1 month ago

When in space, it makes sense to draw atmospheres first and rings second as the rings will be in front of the atmospheres.

When going near the surface of a planet, this order changes because the rings are now behind the atmosphere.

The issue was that the rings of distant planets would also be rendered after their atmosphere, which is not correct and can be visible when looking at a planet from one of its moons.

This PR fixes the issue by only changing the rendering order for the nearest body, not for the more distant ones.