Stellarium / stellarium

Stellarium is a free GPL software which renders realistic skies in real time with OpenGL. It is available for Linux/Unix, Windows and macOS. With Stellarium, you really see what you can see with your eyes, binoculars or a small telescope.
https://stellarium.org
GNU General Public License v2.0
7.52k stars 811 forks source link

Daytime Moon is too visible #3067

Open Atque opened 1 year ago

Atque commented 1 year ago

In reality, the daytime sky is so bright that it renders the Moon difficult, almost impossible, to see. At gibbous phase, it might be visible if high enough in the sky, but when the gibbous Moon has just risen, and the Sun is decently high up, the Moon will be incredibly difficult to spot. In Stellarium, however, the Moon is about as visible at all times. Furthermore, the terminator ought to be smoother in daylight, see the photo below:

0_Close-Up-Of-Moon-In-Clear-Blue-Sky

The screenshot below is with current master: stellarium-171

gzotti commented 1 year ago

I agree on your screenshot it appears too bright. I had to fight this burnout several times in the last years, but recent changes re-introduced the issue. It's a real pain! We have an unfinished discussion in #3041. The additive nature of our rendering will always show the dark edge of the moon also in daylight sky. I see it as observing hint.

I have no trouble seeing a gibbous moon in daylight, maybe it's a question of air quality? Seeing your image, maybe the moon should be allowed to become as ruddy as @10110111 wants it for daytime skies, but have a more yellowish tint when it is dark.

Atque commented 1 year ago

I have no trouble seeing a gibbous moon in daylight, maybe it's a question of air quality?

High in the sky, yes, but not low in the sky. I lived by the sea some years ago, and I had troubles seeing a gibbous Moon about 5 degrees above the horizon when the Sun was high. It looked clear.

Seeing your image, maybe the moon should be allowed to become as ruddy as @10110111 wants it for daytime skies, but have a more yellowish tint when it is dark.

That might be a good compromise. But most importantly, make the Moon less visible (to the very least not burnt out).

gzotti commented 1 year ago

Ah, sure, in 5° and lower there will be considerable absorption. So whatever rebalancing will have to be made after the latest changes also must take Lunar magnitude and altitude-dependent absorption into account.

10110111 commented 1 year ago

There are multiple issues at play here:

  1. The way we render the Moon currently is to draw it with some artificially chosen brightness coefficient applied over Oren-Nayar BRDF, which even by itself is incapable of representing the full dynamics of the mean brightness of the lunar disk (e.g. the opposition surge is completely missing). This makes relative brightnesses of the sky and the lunar disk fictional. Your desire of smoother terminator is the direct consequence of seeing the dim lunar disk in the photo submerged in the bright blue sky. I expect that if we got correct brightness (and fixed other items here), the results would be more correct.
  2. Extinction is modelled in a non-physically-based way, affecting only green and blue channels, which also influences wrong final brightness.
  3. The framebuffer being rendered into contains data in nonlinear sRGB color space, but doesn't inform OpenGL about it (via the internal format). This makes the blending happen with nonlinear color values, which leads to overly bright sums of colors (just compare x1/2.2+y1/2.2 and (x+y)1/2.2, the former will always be larger unless x or y is zero). Note that to fix this we'll need to change all the shaders in addition to using the correct framebuffer internal format, because they all assume this status quo.

The beige color of the lunar surface is not related to this issue, since it's only a question of chromaticity, and not a very large change of it.