
[Cosmetic] Stars appearing in the moon
essickmango opened this issue ยท 6 comments
I like this mod a lot, thank you for the exciting work!
There is just a slight issue bothering me: Stars appear in the moon, which is especially visible during a new moon. See the attached screenshot that I took when I noticed, early in the in-game evening.
Versions:
Minecraft 1.21.4
Fabric loader 0.16.13
Fabric API 0.115.0+1.21.4
Spyglass Astronomy 1.0.15+mc1.21.4
Edit: the same obviously goes for planets as the rendering doesn't distinguish them.
Okay, I looked a bit more into this and... I do not find where this is coming from. Debugging seems to indicate that the moon is always rendered with full opacity. I am currently suspecting that this is coming from the definition of the celestial body render pipeline / shader, but I do not know a) if this really is the case (I do not know the Minecraft rendering), and b) if this is something this mod can fix without too much intrusion.
hm is it just that the moon is rendered first, so the stars (which are transparent) go over it. i do recall investigating it and also being confused though
oh wait i think i did eventually realise the cause. i think* its because the sun and moon (and the stars) are rendered additively?
*i havent checked the code to confirm this but it does match observations i can recall
that would be what makes the sun go white at day, since its the yellow added to the bright blue, but at sunrise and sunset you see its yellow since its against a saturated orange
but! it also means that when at night, rending against a star, it appears transparent, since full opacity additive just means it adds all of itself, so you see a difference between the 0+0.5 against the sky and the 0.5+0.5 against a star
I spent some more time trying to figure this out and did not find another reason, and after playing around with it for a bit it does indeed seem like the sun and moon are rendered additively. Oh well...
I guess I'll live with the flaw for the time being, I don't think it is a good idea completely rewriting sun and moon rendering as this feels contrary to this mods "simplicity" and compatability.
Anyways, if I feel bored over the next couple days/months I might help with some other issues since I'm now knee-deep into the code lol.