No announcement yet.

New Sky/Atmosphere model in 4.24

  • Filter
  • Time
  • Show
Clear All
new posts

    Originally posted by SebHillaire View Post
    jrapczak If you want it, I would recommend you should grab those CLs (in order of integration):

    1- Transform CL
    2- Some renaming
    3- Some bug fixing

    Note: I may have dome other work in between those CLs...
    Cool just found those in P4. Thank you!!!


      Originally posted by SebHillaire View Post
      jrapczak If you want it, I would recommend you should grab those CLs (in order of integration):

      1- Transform CL
      2- Some renaming
      3- Some bug fixing

      Note: I may have dome other work in between those CLs...
      That fixed my issue, thanks again SebHillaire!


        Originally posted by SebHillaire View Post
        Height-fog lighting: this feature is very basic and only here to bridge a gap if anyone still want to use the height fog. It is just an option and of course it will change the look, just up to you to use it or not. The Mie scattering component of the atmosphere is already a height fog by itself (and a better one because it does self shadow and reacts to the other participating media properties globally).
        Is it possible to get very dense fog (100m visibility) without the aid of another height fog?

        Even at 700m, objects are still easily visible with mie scattering set to max. Which really doesn't seem like enough for most games in my opinion, where environments are intentionally made more compact than real life


          Arkiras Hello
          Yes this is possible to achieve dense height fog without that HeightFog component.See ExpxonentialHeightFog section from

          I prefer to use the sky atmosphere as opposed tot he height fog: more consistent lighting. But it needs a bit of setup because by default this component is made for large scale participating media. This is what you should do:
          • You need first to make sure that r.SkyAtmosphere.AerialPerspective.StartDepth is very small. By default it is 0.1 meaning 100 meters: aerial perspective will never be applied before that. This is done because typically aerial perspective is not super strong and it is a good optimization to skip computation on close up pixels using hardware depth test and depth bounds test.
          • I recommend you play with Mie scattering only. You will need to increase scattering or absorption density to a high value (I was using 20 or more IIRC). Keep in mind that those density can go above the slider range: the sliders are just there to represent typical range but you can go above.
          • If you use the default setup you might want to bring the aerial perspective volume texture world depth from 96km to a range that makes sense for you (maybe 5 km) to get more accuracy from each depth slices (using r.SkyAtmosphere.AerialPerspectiveLUT.Depth 5)
          • optional: you can also reduce the Mie height distribution for the fog to sit closer to the ground.
          • optional: you can also play with aerial perspective scale from the art direction section
          Positioning will become easier when you also get the atmosphere transform in 4.25.


            SebHillaire Thank you so much, that setup worked great!


              Originally posted by SebHillaire View Post
              GTJC Sorry I missed it. It seems that there was a bug in the atmosphere composition shader for space view. I fixed it this morning and it will be available in 4.25. Thanks for your feedback!
              (if you have source code and can build the editor locally, here is the CL you need to integrate
              No worries. Awesome! I'll wait for 4.25
              When the Sky Atmosphere was added I came up with a quick test run project for it and I have more to do in Maya with asset building/animating that I can handle in the meantime.
              It's funny because it is now faster to make an atmosphere around a planet in UE4 then a DCC like Maya.
              The whole sky setup is something I'm super pleased to see added to UE4. You guys are doing killer stuff with Unreal.


                Thanks for the nice feedback! And that is good to know.
                Please keep reporting issues and do not hesitate to share your results


                  Sorry to bother you but I have a couple more fog questions:

                  1) Currently the fog disappears when the sun is below the horizon, is there any way to stop this from happening? (Not looking to scatter sunlight to the back side of a planet, I just want to the scene to still look like there is fog in it at night when it is lit by artificial lighting like street lamps)
                  2) Is volumetric fog support on the roadmap for the future?

                  Last edited by Arkiras; 01-14-2020, 03:43 PM.


                    What's the proper way to shadow the directional light in a Sky material when it goes below the horizon? Looking at the sample material it doesn't seem to handle that case. I have a lot of red clouds at night even when the light is on the other side of the planet. When adding the moon light in at 0.26 lux and adjusting the scene exposure accordingly, I have to turn off the sun light completely so the clouds in the sample material aren't bright red.


                      You are correct: this is still on the todo list. I have also noticed that the transmittance LUT does not seem to go fully black for some reason.
                      Different option that needs to be looked at: add a sun/planet intersection code in that node or fix the transmittance LUT (to get the same result for free).


                        Hello SebHillaire! Thank you for the work you've done!

                        I am spawning our game's lighting setup from code and storing it's components for updating as time of day progresses. I can spawn a SkyAtmosphere but since it's SkyAtmosphereComponent is private i can't access it without changing engine source. Could you please expose the component throught a getter as other actors do?

                        Click image for larger version  Name:	SkyAtmosphere.jpg Views:	0 Size:	70.0 KB ID:	1709344
                        Thank you again!
                        Last edited by Elocater; 01-16-2020, 06:30 AM.


                          Thanks Elocater ! This will be available in 4.25


                            SebHillaire Nice job on this shader! This is producing much smoother results than the Precomputed Atmosphere plugin I was using before.
                            Edit: Looks like my 1st issue appears without a SkyAtmosphere in the scene, at least when Raytracing is on.
                            Edit 2: Enabling Apply Pre-Exposure before writing to the scene color might have fixed it...
                            Edit 3: It didn't completely fix it, but now it seems like my sun bloom might be working better. The yellow translucent thing comes back in my scene only at ~10.3 or so EV (I made a manual exposure control slider). I'm not sure why that is happening.

                            I am making an International Space Station sim using a real-scale Earth model from orbit to surface, with proper orbit, and sun + moon position. To maintain coordinate precision, I am "manually" rebasing my coordinates with the ISS at world origin and the Earth moving around it. To enable motion of the SkyAtmosphereComponent, I cherry-picked all of your commits in dev-rendering between December 16th and now.

                            I am having an issue now: yellow translucent flashes in rectangular portions of my viewport. The flashes get more frequent when I am closer to world origin and thus my ISS model, and when I increase viewport resolution. The flashes get less frequent when I cap FPS to 25, and stop when I cap it to 20. I think I have seen these flashes even without having the ISS in the scene.

                            I also have a yellow-ish subsurface material on the solar panels of the ISS, which may or may not be causing something.
                            I have an unlit translucent emissive material for clouds which uses a SkyAtmosphere material node for getting colored lighting.

                            From DefaultEngine.ini:

                            What might be the cause of this, and how might I fix it? If I find the time, I might be able to get some video of it happening. I am trying with Raytracing on now to see if that is different.

                            2nd issue: When in the shade of the Earth, my ISS is usually lit in red light when it should be in shadow.
                            This is less important for me to fix quickly, and I can think of a few odd ideas like manual shadowing with an invisible cube, and changing lighting channels.
                            Last edited by The Regurgitator; 01-18-2020, 11:38 PM.


                              Thanks! Super Cool that you have been able to do that setup! I look forward to seeing such results

                              Flashes: please have a screenshot, video or even a single small project reproducing the issue with a small setup (that can download). That would be great. I'll try to repro from your settings but I cannot promise anything. We have noticed notice flickering in another case but I have not been able to reproduce it so far...

                              Transmittance not being black: Yes that is the same issue as reported by jrapczak above. I'll try to look at it for 4.25.


                                Edit: Dang it, I just found the same flashing issue without a SkyAtmosphere in the scene. It was only for a fraction of a second, but it was there.

                                here is an assortment of screenshots from my project, showing the flashing problem:
                                There are some extra glamour shots as well. The flashing is definitely limited to sunset/sunrise, somehow aligned with the light direction, related to the exposure, and possibly affected by screenspace reflections. If I find the time, I'll put together a uproject that repros this issue.

                                I would get video, but for some reason recording on my laptop's 4K screen does not show as an OBS input, and the issue doesn't come up when the viewport is on my 1080p external monitor (probably a difference of resolution).

                                At 4K resolution with my setup (no shader functionality changes besides the cvar values above), I get around 5-6ms of SkyAtmosphere draw time in the GPU profiler (Razer Blade Advanced 2019, i7-9750H, 2080 Max Q). Any tips on how to reduce this with more cvar settings? Are there plans to optimize this shader significantly, and/or provide optimized defaults for the relevant cvars in the near future?

                                I'm also curious, is there any integration of the SkyAtmosphere stuff with the SkyLight component/actor?

                                I'm eventually hoping to use this for VR as well as flat screen. We have 2080ti's in our VR workstations, but our users probably don't. We have lots of material/shader optimization work ahead of us.
                                Last edited by The Regurgitator; 01-21-2020, 08:08 AM.