Announcement

Collapse
No announcement yet.

New Sky/Atmosphere model in 4.24

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • replied
    SebHillaire and The Regurgitator

    I was hopeful to maintain perspective camera as opposed to orthographic. I'm interpreting an older work and thought it'd be cool if I could apply as much of a realistic setup as possible.

    I'm a Maya artist making the switch to Unreal (slowly). Currently with this short project my goal was to have the same animation/camera etc. setup up in both Maya and unreal so they are 1:1 in setup/scale. Then I was going to use Maya/Redshift as my guide for matching post process closer to my maya render.

    1. At first I tried a realistic earth/sun/moon scale/distance, then miniaturized it, which is what I posted on page 2 of this forum. Looking back it was clear the atmosphere with a ground radius of 100 looked very wrong.
    2. So, I rebuilt my scene to match the default ground radius in Unreal (which appears to be real world scale in centimeters). This is far more appealing.
    3. From there I stubbornly built the real world sun scale and distance (ignoring the fact that that is an absurd expectation of Unreal/Maya or any 3d package), but found the sun wasn't visible in viewport unless I selected it making it hard to artistically adjust bloom/flares/color etc.
    4. From that point I built a mini sun/closer to earth.
    5. The real moon distance and scale seems to work within the clipping planes of the camera so I kept it.

    With each of these steps I reanimated everything at the new scales/locations.

    6. I suppose, worst case scenario I could find a false moon distance at which the atmosphere works and find a new focal length. And then reanimate. But before I do this, I will dig a little.

    --- --- ---

    I tried playing with the atmosphere height and Mie/Rayleigh distribution (with meshes present under the atmosphere) with no luck.


    To test the theory that it's z-fighting the geometry below the atmosphere, I hid all geo and left only the initial directional light (the one tied to the atmosphere) and the sky atmosphere node.
    Looks like the atmosphere breakup still happens without any geometry present:
    Click image for larger version

Name:	HighresScreenshot00025.jpg
Views:	23
Size:	60.1 KB
ID:	1722850

    This likely isn't relevant to the cause of the breakup, but I tried it to see if it improved or not . . . it looks like the breakup changes dramatically depending on the AA. Again, not likely relevant.
    Click image for larger version

Name:	Atmosphere_AntiAliasing.gif
Views:	21
Size:	223.2 KB
ID:	1722851

    I will try playing with the atmosphere height and Mie/Rayleigh distribution settings with no meshes present next, but have to get ready for work and will try more tonight.

    Leave a comment:


  • replied
    Rawalanche Yes I agree I was hesitating with that solution also. But the message is important (and only there when using a Sky material shader). I'll see if 4.24 can still take that.

    GTJC Great scene As mentioned by The Regurgitator this is likely due to some imprecision when tracing and/or zfighting with you planet mesh. far camera + small fov can cause that and we have not invested time in such cases yet. Other solutions to try: use Ortho projection then distance to earth does not matter and will look very similar to your use case or increase the atmosphere height and Mie/Rayleigh distribution in the atmosphere (would look different but might be acceptable).

    Leave a comment:


  • replied
    Originally posted by GTJC View Post
    In my project, I'm placing the cine camera very far from Earth. The camera is moon distance in centimeters and I've cranked up the focal length.
    The atmosphere looks fine up close, but at a long distance under a high focal length it begins breaking up.
    Click image for larger version Name:	HighresScreenshot00003.jpg Views:	0 Size:	124.4 KB ID:	1719971

    Curious if there's a way to keep my camera distance and eliminate the noise/breakup of the atmosphere.
    I'm also noticing the clouds are not visible at this distance.


    Edit:
    Here's a closer view
    Click image for larger version Name:	CloseAtmos.jpg Views:	0 Size:	28.0 KB ID:	1719972
    I've reproduced this; it appears the effect breaks down, possibly due to z-fighting with the surface below it, or possibly due to some other issue in the sampling.

    Leave a comment:


  • replied
    In my project, I'm placing the cine camera very far from Earth. The camera is moon distance in centimeters and I've cranked up the focal length.
    The atmosphere looks fine up close, but at a long distance under a high focal length it begins breaking up.
    Click image for larger version  Name:	HighresScreenshot00003.jpg Views:	0 Size:	124.4 KB ID:	1719971

    Curious if there's a way to keep my camera distance and eliminate the noise/breakup of the atmosphere.
    I'm also noticing the clouds are not visible at this distance.


    Edit:
    Here's a closer view
    Click image for larger version  Name:	CloseAtmos.jpg Views:	0 Size:	28.0 KB ID:	1719972
    Last edited by GTJC; 02-11-2020, 12:59 PM.

    Leave a comment:


  • replied
    Originally posted by SebHillaire View Post
    Ok There was indeed a performance issue (only in editor, not visible in GPU perf capture so must be CPU, that is why timers might have been weird also).
    Explanation: when enabling a SkyDome with a sky shader, we render in the background some editor text to warn artists when the sky dome is not covering/initializing the color buffer. This text is rendered using Canva and was costing more than expected for some reason (investigation will be conducted). The fix is in (not using the canvas) but it will only be available in 4.25 because it involves shader changes which are now prohibited in 4.24 updates.
    However, the next 4.24 update will have a new command I have added to disable that text rendering pass: Use r.SkyAtmosphere.DebugText 0. That should help in the meantime.
    Thanks for your report!

    Planet: The decision was made to simulate telluric planets with a ground that cast shadow in the atmosphere (visual feature deemed important). That is why we have the ground radius for a virtual planet. Not a gaseous planet. Also, even if we add a color to the ground that will still create a sharp edge at the horizon (because you are close to the ground).
    The goal was not to reproduce what the AtmosphericFog was doing because it has many issues, fudge factors and more (for instance the camera was forced high up in the air).

    That being said, in 4.25 you will be able to transform the Atmosphere around the component and position the planet anywhere. Then you can use the current component properties to reduce its radius and increase the participating media density to simulate a gaseous planet bottom with smooth horizon. That should do what you want.
    Just wondering, if it causes such a significant performance drop, shouldn't the debug text be set to 0 by default, so that all the people who use the new sky level template get proper performance out of the box? I mean it's a bit silly that if user selects one of the 3 level templates, he has to lurk forums to find an obscure cvar to fix it to get proper performance so he can start working on the level... ?

    Leave a comment:


  • replied
    Originally posted by SebHillaire View Post
    Ok There was indeed a performance issue (only in editor, not visible in GPU perf capture so must be CPU, that is why timers might have been weird also).
    Explanation: when enabling a SkyDome with a sky shader, we render in the background some editor text to warn artists when the sky dome is not covering/initializing the color buffer. This text is rendered using Canva and was costing more than expected for some reason (investigation will be conducted). The fix is in (not using the canvas) but it will only be available in 4.25 because it involves shader changes which are now prohibited in 4.24 updates.
    However, the next 4.24 update will have a new command I have added to disable that text rendering pass: Use r.SkyAtmosphere.DebugText 0. That should help in the meantime.
    Thanks for your report!

    Planet: The decision was made to simulate telluric planets with a ground that cast shadow in the atmosphere (visual feature deemed important). That is why we have the ground radius for a virtual planet. Not a gaseous planet. Also, even if we add a color to the ground that will still create a sharp edge at the horizon (because you are close to the ground).
    The goal was not to reproduce what the AtmosphericFog was doing because it has many issues, fudge factors and more (for instance the camera was forced high up in the air).

    That being said, in 4.25 you will be able to transform the Atmosphere around the component and position the planet anywhere. Then you can use the current component properties to reduce its radius and increase the participating media density to simulate a gaseous planet bottom with smooth horizon. That should do what you want.
    Thanks for the r.SkyAtmosphere.DebugText 0 --- fixed my issue in editor! Back to 120FPS.

    teak

    Leave a comment:


  • replied
    Originally posted by NilsonLima View Post
    Rawalanche I totally agree. Also, some atmospheric effects depends highly on light physics at certain latitude/longitude. I have experimented some Sun effects to approach this picture, originally captured at Sweden on a very specific weather conditions and also during a certain season as follows: https://twitter.com/i/status/1134892762246144002
    That one would be beyond difficult It involves basically a simulation of caustics inside volumetric media. That would be tricky even for an offline renderer. You can see that when the sun disc goes out of frame, the whole thing stays in place, so it has nothing to do with the camera optics at all. It would be overkill to simulate such an advanced dependencies in Unreal's realtime renderer, so this would have to be faked somehow

    Leave a comment:


  • replied
    Rawalanche I totally agree. Also, some atmospheric effects depends highly on light physics at certain latitude/longitude. I have experimented some Sun effects to approach this picture, originally captured at Sweden on a very specific weather conditions and also during a certain season as follows: https://twitter.com/i/status/1134892762246144002

    Leave a comment:


  • replied
    Originally posted by NilsonLima View Post
    The most important thing in my opinion is having a less blurry Sun disk, so controlling how sharp the Sun disk is shown makes a big difference.
    Two factors come into play. Scattering of light in the atmosphere and glow/glare from the optics capturing the image. Some earlier atmosphere models such as Mental Ray's physical sky did a big mistake of embedding the glare right into the sky model itself, not just atmopsheric scattering. But that does not seem to be the case here. Just turning of bloom in post processing settings displays the actual sharp sun disc. You will also be extremely surprised how tiny the sun disc really is. Generally, people tend to underestimate how small the sun disc without the glow actually is. That may in fact tie to The_Distiller 's request above, where he may have gotten giant sun disc mainly due to a glow.

    Some examples:
    Default new sky with default amount of bloom (no PP volume present in scene to override it):
    Click image for larger version

Name:	DefBloom.jpg
Views:	305
Size:	144.8 KB
ID:	1714612 Default bloom disabled in project preferences:
    Click image for larger version

Name:	NoBloom.jpg
Views:	280
Size:	144.6 KB
ID:	1714613
    Convolution bloom for more close to reality result:
    Click image for larger version

Name:	Convolution.jpg
Views:	280
Size:	151.8 KB
ID:	1714614

    Leave a comment:


  • replied
    The most important thing in my opinion is having a less blurry Sun disk, so controlling how sharp the Sun disk is shown makes a big difference.

    Leave a comment:


  • replied
    Originally posted by The_Distiller View Post
    The UI already has a "Art Direction" tab, which would be a perfect fit.
    Yes, I suppose that would actually make sense. I am just worried about new users who are not yet sure what they are doing. Controls like this exposed by default go into opposite direction of explaining new users the basics such as shadow softness being related to light source size.

    Leave a comment:


  • replied
    The UI already has a "Art Direction" tab, which would be a perfect fit.

    Leave a comment:


  • replied
    Originally posted by The_Distiller View Post
    SebHillaire Would it be possible to add an overwrite for the sun disc scale and visibility? Right now if I increase the source angle to get nice soft shadows with RT I end up with a giant sun.
    I think the point of physically based rendering and especially Ray Tracing is having shadows related to light source properties. So it just makes sense that softer shadows make sun bigger. Not saying you should not be able to do that if ever needed, but I don't think it belongs right in the main Sky Atmosphere UI as an instant "break accuracy" button. There could be some modifier but it should be hidden away more.

    Leave a comment:


  • replied
    SebHillaire Would it be possible to add an overwrite for the sun disc scale and visibility? Right now if I increase the source angle to get nice soft shadows with RT I end up with a giant sun.

    Leave a comment:


  • replied
    SebHillaire Thanks for the update! I'll try out the transmittance shadow soon.

    I am now pretty much convinced that the flickering has something to do with specular (or possibly screen-space) reflection of the bright directional light in the scene.

    Leave a comment:

Working...
X