Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Suggestion] Solar And Or Lunar Eclipses #29

Open
KaidKM3 opened this issue Aug 25, 2024 · 5 comments
Open

[Suggestion] Solar And Or Lunar Eclipses #29

KaidKM3 opened this issue Aug 25, 2024 · 5 comments
Labels
Enhancement New feature or request

Comments

@KaidKM3
Copy link

KaidKM3 commented Aug 25, 2024

it would be cool if we had eclipses (it would give some more life to the sky in my eyes.

Only downside is it wont be able to darken the surface unless you make it a datapack that darkens the surface to act like its sunrise. (unless someone makes a shaderpack that directly is compatible with the resource pack that automatically make it darker client sided.)

Overall Id love to see this get added.

@Povstalec
Copy link
Owner

Actually I can make it darken the surface, that's not a problem (unless you mean darken in such a way that mobs spawn, that I cannot do).

The larger problem is that there is no simple way to do it. I can't just put it on some timer, because in the very next version, anyone will be able to change every single part of the sky using resourcepacks, so if someone were to just decide the moon should move a bit faster, or orbit in a different direction, that timer would cause things to look weird.

I have some ideas in mind, which involve checking if the projections of objects are overlapping by taking the size and projection position of any object, but it will first require me to prepare the grounds for such a system first.

@KaidKM3
Copy link
Author

KaidKM3 commented Sep 15, 2024

I actually diddnt know you can darken the surface. and yes i meant in a way for mobs to spawn, Thats why i mentioned a Datapack that could do that.

I agree with making eclipses by overlapping by taking the size and projection position of any object. the 2 downsides is, The Moon is Smaller than the sun by a couple pixels*, So its going to be Annular anytime it reaches totality (added after post [ So the moon needs to be enlarged by a couple pixels to match the sun so eclipses can actually have a totality state]), AND The moon and sun need to be at angles in order to make Solar Eclipses Rare instead of of being common everytime when the moon reaches new moon state.

@Noobly-Walker
Copy link
Contributor

Noobly-Walker commented Sep 16, 2024

The sun can be made smaller. Eclipses wouldn't be 'timed' exactly, it's just whenever the moon passes in front of the sun or through an earth-sized area of space behind the sun, eclipses happen
just check for the moon entering either zone, and make stuff happen accordingly
gonna have to wait until 0.3 gets further along tho

@Povstalec
Copy link
Owner

The sun can be made smaller. Eclipses wouldn't be 'timed' exactly, it's just whenever the moon passes in front of the sun or through an earth-sized area of space behind the sun, eclipses happen
just check for the moon entering either zone, and make stuff happen accordingly
gonna have to wait until 0.3 gets further along tho

The "just check for the moon entering either zone" is THE most complicated part of the whole thing.

@Povstalec Povstalec added the Enhancement New feature or request label Sep 17, 2024
@Noobly-Walker
Copy link
Contributor

Noobly-Walker commented Oct 10, 2024

To simulate eclipses in a general manner, we need to know where the sun is in the sky, as well as any object that might cast a shadow over the observer, or that the observer would cast a shadow over. Spherical coords. We also want the apparent sizes of these objects.
Solar eclipses are simple enough with this information alone. We know the apparent size and location of the sun, as well as the apparent size and location of anything that would pass over the sun (Ex. Luna, Mercury, Venus). We could then calculate based on how close to each other the sun and occluding objects are in the sky. Objects that are fully over the sun should be darkened significantly, to appear as a dark square over the sun. The more the sun is covered, the darker the skybox gets, with a fully covered sun leading to the sky darkening enough that it looks like night.
Lunar eclipses require an additional variable, the distance between the observer and anything it might cast a shadow on. The observer casts two shadows, that being the penumbra (which is the same size as the observer) and umbra (which shrinks relative to the distance between the observer and the body). Both would be projected or calculated relative to how far away the object is from the observer, though the penumbra lightens the further away the object is. The penumbra darkens any object that can pass through it, while the umbra tints the object with the observer's Rayleigh scattering (red for earth, blue for mars, whatever color the evening sky takes)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants