hi guys! i was playing with celestia, and i really like how earth has a slight aura around it when you zoom in - and how it goes from blue->red->black depending on the angle/light. i downloaded the source code to look for how this effect is done, but was pretty overwhelmed by the amount of source files, and the fact that i don't know the keyword used for this effect (to search for it effectively in the source.)
so my question is: can anyone point me to the locations in the source (file/line) where this effect is used/created? or can anyone explain the gfx theory behind it? thanks!
howto(?): planet aura
-
- Site Admin
- Posts: 4211
- Joined: 28.01.2002
- With us: 22 years 9 months
- Location: Seattle, Washington, USA
The relevant code is in src/celengine/render.cpp. The function you want to look at is renderAtmosphere()
This function calculates a set of rays from the camera position that are tangent to the planet surface. Quads normal to the surface extend upward from the tangent points to produce the halo effect.
--Chris
This function calculates a set of rays from the camera position that are tangent to the planet surface. Quads normal to the surface extend upward from the tangent points to produce the halo effect.
--Chris