# Volumetric clouds light up when CesiumSunSky is set to night

**URL:** <https://community.cesium.com/t/volumetric-clouds-light-up-when-cesiumsunsky-is-set-to-night/29404>\
**Category:** Cesium for Unreal\
**Created:** [January 18, 2024, 1:30pm UTC](https://community.cesium.com/t/volumetric-clouds-light-up-when-cesiumsunsky-is-set-to-night/29404 "2024-01-18T13:30:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![JustJasper](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/justjasper/32/21568_2.png) [@JustJasper](https://community.cesium.com/u/JustJasper)\
**Post date:** [January 18, 2024, 1:30pm UTC](https://community.cesium.com/t/volumetric-clouds-light-up-when-cesiumsunsky-is-set-to-night/29404/1 "2024-01-18T13:30:49Z")

</div>

Hi, I seem to be encountering some kind of bug into my own project, and I have just seen that the same error occurs in your sample projects.

When the sunsky is set at a time at night, I expect the scene to become pitch black. But somehow the clouds stay visible, the sky is black but the landscape is still light up. It completely looks unrealistic. Anyone else experiencing this?

 ![image](https://global.discourse-cdn.com/cesium/original/3X/f/3/f38f71f5113c1579982b9860596674ca7ec9b050.jpeg)

Beside the problems, I really appreciate this software. Thanks for the awesome work guys 🙂 )

---

<div class="post-metadata">

**Author:** ![janine](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/janine/32/5135_2.png) [@janine](https://community.cesium.com/u/janine)\
**Post date:** [January 19, 2024, 4:25pm UTC](https://community.cesium.com/t/volumetric-clouds-light-up-when-cesiumsunsky-is-set-to-night/29404/2 "2024-01-19T16:25:55Z")

</div>

Hi @JustJasper,

Thanks for reporting this! I confirmed that I can see the same thing, though am not sure why it’s happening. `CesiumSunSky` is pretty much the same as Unreal’s SunSky; it’s simply been tweaked to sync up with the `CesiumGeoreference`. But I can confirm that Unreal’s SunSky darkens the volumetric clouds, whereas Cesium’s does not, so that’s not ideal.

I’ve opened an issue for this on [Github](https://github.com/CesiumGS/cesium-unreal/issues/1341). We’ll update that issue when we get the chance to investigate 🧐

---

<div class="post-metadata">

**Author:** ![JustJasper](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/justjasper/32/21568_2.png) [@JustJasper](https://community.cesium.com/u/JustJasper)\
**Post date:** [January 20, 2024, 7:20pm UTC](https://community.cesium.com/t/volumetric-clouds-light-up-when-cesiumsunsky-is-set-to-night/29404/3 "2024-01-20T19:20:55Z")

</div>

Thank you! It seems like it might be a regular UE5 bug instead of Cesium specific? Anyway, thanks for letting me know that it is not a bug only I am experiencing 🙂

---

<div class="post-metadata">

**Author:** ![MQS](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/mqs/32/23737_2.png) [@MQS](https://community.cesium.com/u/MQS)\
**Post date:** [April 10, 2024, 7:03am UTC](https://community.cesium.com/t/volumetric-clouds-light-up-when-cesiumsunsky-is-set-to-night/29404/4 "2024-04-10T07:03:24Z")

</div>

Hi there, has there been any resolution to this?

---

<div class="post-metadata">

**Author:** ![NVrana](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/nvrana/32/14000_2.png) [@NVrana](https://community.cesium.com/u/NVrana)\
**Post date:** [September 9, 2024, 10:26pm UTC](https://community.cesium.com/t/volumetric-clouds-light-up-when-cesiumsunsky-is-set-to-night/29404/5 "2024-09-09T22:26:45Z")

</div>

For UE 5.3 and 5.4.

Try the following:

1. Click on the CesiumSunSky BP
2. Under its components section, click on SkyAtmosphere
3. Set TransmittanceMinLightElevationAngle from 90.0 to -90.0 (-90.0 is the default UE sets to that component)

Or for the C++ savy (with Cesium’s source):

- In CesiumSunSky.cpp inside the constructor, line 105-ish  
`SkyAtmosphere->TransmittanceMinLightElevationAngle = 90.0f;`  
Set it to -90.0 instead.

---

<div class="post-metadata">

**Author:** ![Kevin\_Ring](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/kevin_ring/32/2003_2.png) [@Kevin\_Ring](https://community.cesium.com/u/Kevin_Ring)\
**Post date:** [September 11, 2024, 12:11am UTC](https://community.cesium.com/t/volumetric-clouds-light-up-when-cesiumsunsky-is-set-to-night/29404/6 "2024-09-11T00:11:45Z")

</div>

More information about why we set it to 90 instead of -90 can be found here:

> <https://github.com/CesiumGS/cesium-unreal/issues/527>
>
> This was originally spotted by a user on the forum - https://community.cesium.co…m/t/resolved-issue-with-cesium-sun-sky-hiding-earth-surface/13743
> 
> The SkyAtmosphere of CesiumSunSky will occasionally hide earth's surface when viewing from space. 
> !\[atmosphereIssue\](https://user-images.githubusercontent.com/39537389/123982757-4c636600-d991-11eb-8059-238ca1a7614c.gif)
> 
> This even persists on the ground if you zoom into an affected area - the imagery layer fades to black.
> !\[atmosphereIssueGroundShort\](https://user-images.githubusercontent.com/39537389/123983810-268a9100-d992-11eb-8387-732725755fa3.gif)
> 
> From my testing, it looks like this depends on proximity to the georeference.
> 
> When the sun is not lighting the area where the georeference is, the terrain imagery will fade to black, even if it's light in the area where the camera currently is. We've noticed that lighting is funky the farther you get from the Georeference, but I don't think we've noticed this specific issue before. 
> !\[image\](https://user-images.githubusercontent.com/39537389/123985178-4078a380-d993-11eb-861f-8ac3d862992a.png)
> (Looks pretty cool, though.)
> 
> Since we encourage users to use world origin rebasing if they are traveling far from the original georeference, I don't think that it's really a breaking issue for projects on the ground. However, it's definitely undesirable when viewing the earth from space. 
> 
> The forum user noted that changing the Transmittance Minimum Angle in the SkyAtmosphere component of CesiumSunSky from -90 to 90 degrees fixes the issue. The Sky Atmosphere documentation describes the Transmittance Minimum Angle as "The minimum elevation angle in degrees that should be used to evaluate the sun transmittance to the ground. Useful to maintain a visible sun light and show on meshes even when the sun has started going below the horizon. This does not affect the aerial perspective." 
> Setting it to 90 essentially means that the sun transmittance is always evaluated. This may be desirable, but could also come with performance or graphical problems. It's also concerning that the parameter does seem to affect the aerial perspective, there may be a bug. 
> 
> We should do more testing to make sure there are no side effects, but if there are not and we have no better solution, we should change the Transmittance Minimum Angle of the SkyAtmosphere of CesiumSunSky to 90 in the plugin.
> 
> @xuelongmu is this still a problem in your branch with the recent changes to CesiumSunSky?
