Search Unity

Feedback Physically Based Sky

Discussion in 'High Definition Render Pipeline' started by SebLazyWizard, Oct 23, 2019.

  1. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    233
    I'm surprised that there's no thread dedicated to the new PB-Sky yet, so I'll go ahead and create one.

    As of 2019.3, HDRP offers a new sky rendering that is physically based and although it's still experimental, it looks impressive so far.

    So let's start with the stuff that already works fine, before we take a look at some issues and missing features.

    Pros;
    • The rendering of the sky itself looks really realistic, especially at low sun altitudes the atmospheric scattering really shows off.
    • It finally works correctly with real light intensities (with matching Exposure PP), whether the sun (128000 lux) or the moon (0.33 lux), it just works.
    • Atmospheric scattering also effects surface illumination.
    To demonstrate the last point, I set the sun angle to 0° (so it's exactly on the horizon) and created a pillar with a height of 30 kilometers.
    Look how the color and light intensity changes depending on height.
    You just need to apply the initial intensity and color of a light and the scattering will do the rest!

    Cons;
    • As you can also see in the picture, the scattering only applies to the sky itself. The pillar was standing 30 km away from the camera and therefore the atmosphere should partly cover it, especially the lower part. Atmospheric scattering logically should apply to anything that's inside the atmosphere. You can kinda fake it with fog, but the required settings to do so almost always block the directional light completely, so that's no solution.
    • There are still some artifacts on the sky itself when the light is close to or below the horizon.
    • There is no inbuilt method to add clouds, if this wont be on the roadmap then please add the ability to author custom sky shaders based on the PBS.
    So that's it for now, let the discussion begin...
     
    Last edited: Oct 25, 2019
    ModLunar and konsic like this.
  2. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    I have a few questions..
    When we speak about athmospheric scattering, do we think on Rayleigh scattering or on exponential height fog ?

    Rayleigh/Mie theory affect only the color but often we see sunlight go through tiny particles, clouds and athmosphere so we see gradient colored exponential height fog too.

    I experience editor lag when trying to adjust PBS modules.
     
  3. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Have you tried matching the volumetric fog component values to your physical sky values?
     
  4. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    233
    Rayleigh scattering is the light scattering by air molecules, responsible for the blue color of the sky and the orange-red tint on the horizon at low sun altitudes.
    Mie scattering on the other hand is the light scattering by aerosols, which applies in fog/clouds, in combination with forward scattering this shows up as the halo around a light source like the sun etc.

    I did try that, but as I told in my first post it will almost block the directional light from hitting the ground (that's what a 50 km layer of fog usually does).
    Fog also only do Mie scattering, so it's inappropriate.
     
    konsic likes this.
  5. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    Well, the volumetric fog with HDRP doesn't actually block light at all, it's a post effect of sorts. So the light hitting any surfaces will be the same as if it didn't exist.

    The Physical sky is only rendered as background skybox and will be picked up by reflection probes and shaders supporting sampling it like a cubemap.

    I'm not sure how that helps, only that I wouldn't expect a raytraced solution without raytracing enabled.
     
  6. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    233
    It's anything but a post effect, the volumetric fog is actually ray marched.
    And it does block light...
    The left scene uses a fog with a height of 10000 and a distance of 10000.
    The right scene uses the same fog height but a distance of just 100 and as you can see, the direktional light got completely dimmed.
     
    Last edited: Oct 24, 2019
  7. hippocoder

    hippocoder

    Digital Ape

    Joined:
    Apr 11, 2010
    Posts:
    29,723
    I recall the HDRP team posting that it doesn't in fact change the amount of light passing through, so what you see here is just an effect rather than a physical thing.
     
  8. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    289
    @SebLagarde are there any plans to support cloud rendering?
     
  9. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    233
    Ok i got the scattering working with an additional fog layer that just blends with the sky.
    It uses the same settings as the PBS(air settings);
    scattering.jpg
    Now I'll need another volume just for the "normal" fog itself, but I can live with that.

    EDIT
    Seems HDRP only supports one fog at a time, damn.
    So I'm stuck again. o_O
     
    Last edited: Oct 24, 2019
    andywatts and konsic like this.
  10. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    In PBS air alttitude is in meters 58.3 and in Fog module height is in millimeters 58300?

    Is that right?
     
  11. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    233
    No it's kilometers for the PBS and meters for the fog.
     
  12. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    233
    So I finally set up a dynamic day/night cycle and applied space emission- and ground albedo textures (you can even use ground emission textures).
    The result is quite astonishing.


    However there are still some issues with the PBS;
    • High light intensity differences between light sources (sun/moon) results in color/exposure artifacts on the sky, especially when the sun is close or below the horizon, so I had to decrease the sun light intensity quite a lot from 128000 down to 128 lux in order to make it look acceptable (moon uses 0.33 lux). This might be partly caused by the automatic exposure values I use (min limit = 0, max limit = 12), which is necessary to deal with such great light ranges. I wonder how the HDRP team is going to handle it.
    • The atmosphere seems to be built of multiple layers which results in banding artifacts with low light angles (this is also quite visible in the video)
     
    NotaNaN, andywatts, ftejada and 4 others like this.
  13. YouDesign

    YouDesign

    Joined:
    Jun 21, 2017
    Posts:
    55
    What about clouds?
     
    Lahcene, soleron and Cascho01 like this.
  14. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    For clouds I use TimeOfDay Plugin which support is "frozen" since some month.
    Devs for archviz definately need clouds + day-nightcycle based on long/lat for all rendering pipelines!
     
    Last edited: Feb 21, 2020
    newguy123 and Lahcene like this.
  15. Tricktale

    Tricktale

    Joined:
    Jan 23, 2015
    Posts:
    42
    I've been playing around with this lately, trying to create a space scene timeline animation with the player moving close to a planet and entering its atmosphere. The PBS looks great when the planet size is big, but it makes creating a space scene impossible due to a floating point precision warning when placing objects.
    I've tried creating a small planet with a radius of 1km and fiddled with the settings as much as possible, but the results aren't anywhere near as good looking, with visible stepping and most of the effect lost when getting close to the planet. I'm assuming it's because it's all based on real-world values.

    Anyone else have any luck scaling down the entire effect to more manageable size?
     
    Bordeaux_Fox likes this.
  16. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
  17. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Hey there, I tried the new pbr sky shader but I'm wondering how can I enable to display the main directional light as a sun disk in the sky? For me, a clear sky without a visible sun is basically useless.
     
  18. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    Bordeaux_Fox likes this.
  19. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    233
    So with version 7.1.6 you can finally apply a surface texture to directional lights.
    moon.jpg

    However updating the PBS became extremely slow with the recent update, simulating a day/night cycle is impossible now (it's allmost 10 times as slow as before, both on the cpu and gpu).
     
    andywatts, ftejada, Lahcene and 3 others like this.
  20. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    I don't know if it is because of PBR sky, but there is indeed 5 fps with Unity 2019.3rc1 and HDRP 7.1.6 when you are changing direction of light. Looking into profiler I see, that most of the time is consumed by Editor
     
    Velo222 likes this.
  21. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
  22. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    The sky disappears when going below a certain point with the camera. It does not happen with the old sky.

    The new sky is great but it was a bit too many settings that make small visual difference compared to the previous version. Time was spent on these instead of clouds that would have a more significant visual impact.
     
  23. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    It's by design. You have to make sure whole your level is above ground or sea level. Below that sky is black.
     
  24. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    Interesting. Who said it is by design?

    Design serves a purpose.
    Sorry to say this so called "design" (if someone indeed claimed it is so), is flawed. Serves absolutely no purpose, it is limited and illogical.
     
  25. konsic

    konsic

    Joined:
    Oct 19, 2015
    Posts:
    995
    I don't know where I read it.
    It's physically accurate and I like it personally. Problem is the frame drop when parameter change.
     
  26. SebLazyWizard

    SebLazyWizard

    Joined:
    Jun 15, 2018
    Posts:
    233
    As far as I remember it was rendering incorrectly when the camera height was below zero, so they simply disabled it.
    Hopefully that's just temporary, as there a still some use cases where you need it. (e.g. being under an ocean surface while looking upwards)
     
  27. Gokcan

    Gokcan

    Joined:
    Aug 15, 2013
    Posts:
    289
    Lahcene, MP-ul, soleron and 1 other person like this.
  28. Rastapastor

    Rastapastor

    Joined:
    Jan 12, 2013
    Posts:
    589
    Yes that is extremly annoying (btw that neat tool to position sun in UE would be nice to have :) )
     
    MP-ul likes this.
  29. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    There is a good reason why top artists prefer Unreal to showcase their skills ;)
    Providing them with the tools that really make a difference.

    Nobody cares about a "physically accurate" sky.

    Especially when the physically accurate sky is not accompanied by the actual sky with stars, planets etc... and only consumes its effort on nailing visually insignificant accuracies. People on the internet should get over trivialities and focus on things that actually make a difference.

    The previous one already looked awesome. It was only lacking clouds.
     
    andreyefimov2010, Lahcene and MP-ul like this.
  30. MP-ul

    MP-ul

    Joined:
    Jan 25, 2014
    Posts:
    230
    Unreal is the better engine overhaul do doubt about that, unity simply has no chance vs it on high end graphics and programing.
     
  31. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    I do not think so. Unreal has several issues too. Each tool has its strengths and issues.

    Sadly many people think that by slapping a "psychically accurate" moniker on whatever they do it has increased value and it is awesome. It is not.

    Also many people think that spending weeks of development time on trivial tweaks is a good investment of their skills and efforts. It is not either.

    Fixing the disappearing sky is important as it should not happen. Period.
     
    NotaNaN, ModLunar, PutridEx and 5 others like this.
  32. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I think there's some confusion here. If you personally don't want physically based sky, there are still alternatives to it.
    Sky is just one element but most HDRPs PP's are done to be physically accurate, same with camera setup etc. The whole point is to make the thing work more like in real life and people doing realistic visualizations do appreciate it. I appreciate the effort even when I'm not going for photorealism. There are also alternatives to HDRP on Unity.
     
  33. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    @rizu this is the worse response people can give about feedback. Unity invests resources on this feature to be used by as many people as possible. So you saying that there are other solutions, (which is something everybody already knows) works against that goal.

    This thread is about providing feedback for the Physical Sky. And that is what people do.
    Sometimes negative, sometimes positive.
    Feedback that can give the people working on this feature an idea about what they are doing right, and what they should do differently instead, in order to reach the goal which is a wide user acceptance and satisfaction.

    You talked about the real life.
    In the real life, the sky does not disappear when you move below "0" this is especially important for people doing Realistic work (I personally do both realistic and fantasy projects), more so, when they are using real world map locations and terrain and features that are based on actual location data that should NOT be tampered with.

    Also in real life, the sky often has clouds and other volumetric. Resources would be far more well spent in that.

    Wasting time on "nailing" the aerosols 100% (never going to happen) that will be completely useless unless you are working on a super high end simulation that this 1% difference from the real thing makes a huge difference in the result of the simulation, is a waste of time.
     
    Marco-Sperling and MP-ul like this.
  34. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    AdamCourtenay likes this.
  35. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    And you are wrong.

    Sorry. I am looking for exactly this system and I bet you a box of your favorite drink that if you have a little survey asking the entire community right now on how the new Physically Based Sky should evolve and how the team should invest their time in either:

    A. Making even more accurate aerosols simulation
    or
    B. Making a believable (but not entirely accurate) cloud system for this sky

    "B" would be the easy majority.
    You want to argue about that, that is ok, it is your right to argue,
    but you are wrong about what the community needs.
     
  36. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    I just wasted an hour of my time trying to figure out what's wrong with the scene setup - when rotating/moving the camera below a certain point all the sky became brown/dark.
    It dawned on me that Unity went for an easy exit and simply hardcoded Z=0 into their shaders - without mentioning or documenting this decision. Reading now that it is "per design" ... L-O-L
     
    NotaNaN, Seith, soleron and 2 others like this.
  37. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I'm going to ignore all the rest of that and just point out that Unity is aware of the need for the clouds and they've mentioned a long time ago already that clouds are coming later on. Nobody here even suggested they were not needed.
     
    Last edited: Feb 7, 2020
  38. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    I also think it should be not hardcoded, that the sky does not render below zero at the y-axis.
    You should atleast make it tweakable and display an infobox so people know what is going on. People could invest hours of bug searching why their sky disappears, not knowing it is a programmed limit.
    Also, how would Unity know the sky is not needed at a certain distance? You don't know the map, and projects may need realistic coordinate system, so y zero marks the water level, which may could be reached by the player, so for certain games it is may needed that you see the sky from underneath water or through holes in the ground. Unity is just limiting in thinking of use cases. Please fix it.
     
    andreyefimov2010 and soleron like this.
  39. iamarugin

    iamarugin

    Joined:
    Dec 17, 2014
    Posts:
    883
    You can decrease the planet radius like by 100m and increase upper atmosphere by the same amount and your sky will not disappear at 0. It will disappear below -100m, but it is how the skies with precomputed tables works. But warning about this still good idea.
     
    andreyefimov2010 likes this.
  40. stormAster720

    stormAster720

    Joined:
    Mar 18, 2015
    Posts:
    4
    Hey, I am having issues with it , I am having stuttering in both editor and build version when I hit play, and when my character respawns.

    Is there anyway to fix that?

    I already tried disabling some features and hit play, but the result is the same, however when I change the sky type to another different to physically based sky, it works fine.
     
  41. MP-ul

    MP-ul

    Joined:
    Jan 25, 2014
    Posts:
    230
    Did you even notice that they will give you with HDRP "some features" and "the rest is up to you to make"?, have you all forgotten this from the last talks(unite copenhagen)?.
     
    Last edited: Feb 16, 2020
  42. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Video link with timestamp for that statement by Unity?
     
  43. MP-ul

    MP-ul

    Joined:
    Jan 25, 2014
    Posts:
    230
    No time stamp just look at the entire talk it was
    Unite Copenhagen 2019 Keynote Highlights not GDC my bad

    but the bullshit starts at 4:00
     
    soleron likes this.
  44. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582

    haha I would say "wishful thinking starts there" instead :D

    And the VR "deemo" that never came :D
     
    MP-ul likes this.
  45. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582
    priorities. that is what the problem is. wrong priorities.

    they have mentioned many things coming later on.

    For a developer who needs to work on a project the acceptable "later on" is maximum 3 months.

    2-3 years later on, is unacceptable.
    you are deliberately stalling me and causing damage to my business with misleading promises.

    I might as well switch engine and if/when you ever get to it, I might consider coming back.
     
    andreyefimov2010 likes this.
  46. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    I would not rely on that statement clouds might come at some point. You don't know when and you don't know if it will be good. So instead you have to work on your own cloud shader if you want to ship your game on a deadline.
    I have to say the complete feature set of environement (terrain, sky, weather) is completely done better by third party assets. So I don't think here Unity will improve on that and I don't think they are interested in doing so. Papers for good volumetric clouds are published since many years. So if they had the plans and ressources to come up with a new feature, they would have done it.
    I mean it is 2020, look how many games shipped with their own sky solution and yet Unity is still behind. Maybe they don't want to go in competition with the asset store creators. Who knows.
    Just look how many years it needed for the terrain holes.
     
    Last edited: Feb 17, 2020
    soleron and Cascho01 like this.
  47. Cascho01

    Cascho01

    Joined:
    Mar 19, 2010
    Posts:
    1,347
    Absolutely agree. Hopefully there will be a good solution like TimeOfDay soon available for SRPs.
     
  48. Krajca

    Krajca

    Joined:
    May 6, 2014
    Posts:
    347
    Is there any known issue to prevent Physically Based Sky to reflect in a planar reflection probe?
     
  49. soleron

    soleron

    Joined:
    Apr 21, 2013
    Posts:
    582

    To a certain degree they do want to protect these valuable partners. There is no doubt about it. Unity would be nowhere without the massive asset store success.

    But if that was really the case they would not create their own visual shader tool, they would not have started working on their own visual programming solution nor any animation tools. And more importantly they would not have bothered making this new version of Sky because honestly there was nothing wrong with the previous one if this is where they plan to stop.

    Thing is, many developers do not bother to upgrade or even support their tools these days. Not to mention many of these tools are hacks made by amateurs who see no ROI since these tools that need support have been already sold and there is no new income out of it. Sad but true. Of course, Unity is not to blame about this situation, this is the reality of any plugin ecosystem. The developers should think more like a business and diversify their portfolios. Some do it very well. Most don't. Many old environment systems don't even support SRP properly and definitely not HDRP.
     
    MP-ul likes this.
  50. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    The thing with the asset store is at some point true. You have to think about the competition, mainly with Unreal, and the different licensing model of the engine, also in comparison with Unreal.
    So Unity and Unreal are free if you do not earn a certain amount of money with your game. But over a certain limit, the companies do different. Unity asks for buying a license with a fixed price, Unreal asks to give you a fixed percentage of money from your game's earnings. Secondly, Unity had to add at some point more tools (for free), mainly because of competition. If you look at the free tools and features Unreal gives you, you will be blown away. Also with the new PR of high quality graphics (HDRP), it is hard to sell it without a shader graph, so they made it at the end. So it will lure artists and generating more license buyers.

    On the other hand, Unity gives you some things for free, which Unreal does not. The biggest example would be Enlighten and Havok Physics (free if under a certian income limit).

    If I remember correctly, the old sky shader was a mess and nobody at Unity no longer was able to understand how it worked, so they remade it from scratch. Also from the PR speaking, it sells somehow better with buzz words like "physically correct", which is the whole purpose of HDRP. All in all, the new sky looks better, and atleast you can set a night star sky texture over it.
    You can also set a texture for the directional light. So you could make a moon, but then it is fairly limited, because if you would do a half moon, you have no option to cut or mask the flare.

    The current situation with the asset store is like that because of the transition phase. SRP are new and asset store creators will convert soon as they see there are buyes which are using either one of the SRP. So quality may improve.
    Of cource is is more harder to get the stuff to work with SRP. Just follow the discussion from creator of MicroSplat, he decribes the main problems he had when converting his assets for both SRP. Personally, I don't want to change my job with him.
     
    Last edited: Feb 19, 2020
    MP-ul likes this.