# Atmospheres & space

<figure><img src="/files/pT9WX15tXAz3OQTTa8Vl" alt=""><figcaption></figcaption></figure>

* Plugin supports multiple atmospheres with unique settings on each and a background space skybox.
* Everything is rendered by the engine into the `Ambient Cubemap` that is used by `SkyLight` to lit the shadows and apply ambient reflections that are drawn before any other reflections (Lumen or SSR) are applied.
* Compare the results between a setup where the `Ambient Cubemap` is left blank (rendered as black) and one where the atmosphere material is rendered into it.

<figure><img src="/files/2JHKAR96wv1nNncViX8L" alt=""><figcaption></figcaption></figure>

## How-to

{% embed url="<https://www.youtube.com/watch?v=KNYEarjtvvA>" %}

1. Add `BP_SkyManager` to the level, place it in the middle of your 'primary' planet. The placement only affects how mie scattering (halo around the sun) is distributed along the sky, it needs to know the relation between the planet surface next to you and the sun direction.
2. In the `Atmosphere Settings` array specify the `PlanetActor` reference. This is an actor you want this atmosphere to be tied to.

<figure><img src="/files/LMgXR5JqfPWd0jhoVVE7" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/kVQtjKWOzcRmtPdAVPQl" alt=""><figcaption></figcaption></figure>

1. If `PlanetActor` is not set, you're not paying the cost of rendering this atmosphere, but the engine will throw a warning. To get rid of it, remove the entry from the array.
2. Adjust `PlanetRadius` and `AtmosphereRadius` params to match the radius of your planet. The first determines at what distance from the planet center the atmosphere will fade in, the second — at what distance from the planet center it will fade off.
3. Play around with other parameters while also changing the sun direction. `WaveLengths` parameter determines how each RGB color is absorbed over the distance travelled though the atmosphere. The default values are physically accurate for Earth's atmosphere, but adjusting them allows you to create the appearance of alien planets.
4. <mark style="color:red;">**Be very careful**</mark> with the `ViewRaySteps` and `OpticalDepthSteps` parameters. They determine the quality of the atmosphere. There is a nested loop in the shader and the overall iteration count is equal to `ViewRaySteps * OpticalDepthSteps`. The lower these values the better performance you get.
5. In the `MI_PlanetaryAtmosphere` you have `Sun Disc`, `Mie Scattering` and also `Night Sky` (space background) settings. Check the `...\PlanetaryOceans\Content\Sky\SpaceCubemaps` folder for the additional space sky textures you might like to try.

{% hint style="warning" %}
Because you cannot pass arrays to the material, the max amount of the atmospheres in the is hardcoded to 5. If you want to extend the amount, contact me on our Discord server, I'll show how to do it. It's a matter of a little bit of a copy-paste type of work.&#x20;
{% endhint %}

{% embed url="<https://discord.com/invite/SvHcuCcjMX>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.planetaryoceans.com/atmospheres-and-space.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
