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

Earth: Add atmosphere #19

Open
ajmas opened this issue Nov 17, 2023 · 1 comment
Open

Earth: Add atmosphere #19

ajmas opened this issue Nov 17, 2023 · 1 comment

Comments

@ajmas
Copy link
Owner

ajmas commented Nov 17, 2023

Explore adding an atmosphere effect, such that when you see the edge of the horizon you see an atmosphere layer. This will likely need some shader work.

@thkruz
Copy link

thkruz commented Dec 29, 2023

Here are three approaches:

  1. We can reuse some of my shader work from http://keeptrack.space
  2. We can build a secondary mesh that glows behind the earth mesh. I had done that in the past on KeepTrack but migrated to the current solution because I am still learning how to draw geometries with raw WebGL - we shouldn't have that issue with three.
  3. A mix of the two.

If you want to color the atmosphere then we use the dot product of the vector from the sun's position to the earth to determine if a vertex is on the edge and then pass that to the fragment shader to determine what color to make it. This looks more like Kerbal to me vs an engineering tool (which is always ideal to me).

The more common approach I have seen on the internet is to use a white/blue color regardless of sun angle and just blur it.

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

No branches or pull requests

2 participants