Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

uSkyPro – Precomputed Atmospheric Scattering [2.0 Beta]

Discussion in 'Works In Progress - Archive' started by Luckymouse, Sep 14, 2014.

  1. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Ahh thanks!
     
  2. JeyDia

    JeyDia

    Joined:
    Feb 14, 2013
    Posts:
    100
    Hi everyone,

    Usky is one of the best plugin I used for lighting.

     
    JBT27, llJIMBOBll, Elecman and 3 others like this.
  3. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    New version 1.1.9f3 on the AssetStore.

    - Added a Mobile Skybox Material and some bug fixes.
    The Mobile Skybox Material is shader model 2.0, this shader is roughly 4 times (or more) faster the original shader. It supports the day/night cycle on mobile as well.
    Usage: Apply the "uSkyboxPro Mobile SM2" Material to "Skybox Material" field in uSkyPro.

    Note: The current atmosphere scattering image effect feature is not for mobile. (I will try in future).

    LIMITATION OF MOBILE SHADER
    - Supports only AltitudeSample X1
    - No calculation of camera position
    - No Altitude Scale
    - Always at ground/sea level camera view from the sky
    - Always disabled skybox ocean effect
    - No earth shadow
    - No Moon Corona

    - Ported Unity Photographic tonemapping formula for skybox:
    - Sky color is more saturated then original color
    - Slightly darker on Zenith (top of the sky)
    Note: The Reflection Probe on Mobile does not do the correct reflection, it is Unity bug.
    uSkyPro_Mobile_image1.PNG uSkyPro_Mobile_image2.PNG uSkyPro_Mobile_image3.PNG

    - Renamed "Play Cycle" settings to "Day Night Cycle".

    [EDIT]
    - Renamed " uSkyAtmosphericDeferred" script to " uSkyAtmosphericCamera".


    I'm still working on the new clouds for uSkyPro, will announce update detail soon.
     
    Last edited: Mar 23, 2016
  4. Hormic

    Hormic

    Joined:
    Aug 12, 2014
    Posts:
    251
    Hello Luckymouse,

    Just saw your Day-Night solution and it looks very nice.
    So when i buy uSky right now, what will happen when you release the final uSkyPro?
    Do i have to upgrade then?
     
    Last edited: Mar 26, 2016
  5. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    You can get the immediately beta access if you buy now. Requires $10 upgrade for final release. Price will be $50 after uSkyPro released for the new user.
     
    Hormic likes this.
  6. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    There is a small issue with the setup strength. Perhaps shader values should be clamped.
    Greenish on bottom.
    Untitled-1.jpg
     
  7. Enoch

    Enoch

    Joined:
    Mar 19, 2013
    Posts:
    198
    This looks fantastic. Does the fog follow the view angle of the camera to determine the fog color? I have procedural terrain and I am trying to fade to horizon color for distant terrain as the camera moves. So the fog color for a given pixel needs to change if my view is from the top of a mountain looking down versus the bottom of a valley looking up at a Mountie peek.

    Also is there anyway that you can add the ability to project a large planet onto the skybox behind the clouds? I would love to have this be able to do alien worlds effectively. From the demo it looks like I can tweak the colors enough to get the alien look, but I don't see how an alien planet/moon would be possible. Can you replace the moon texture maybe? Can we have multiple moon textures? Can the moon texture be increased to a giant size and possibly half cutoff by the horizon?

    Looks like a great asset. I am a little confused by the beta/upgrade cost. If I spend 30$ now do I not get a complete product, unless I spend another 10$ after release?
     
  8. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Yes, I noticed that some parameters only work well in certain range. Also somehow this issue are vary in different system, which some value work well on Mac, but may not work well on Windows system. I will investigate it more.

    Yes, the atmospheric scattering color for the scene is based on camera view angle, and yes again that the effect is different between ground level view and from mountain peek. You should able to check it out with the uSkyPro Beta web player.

    Regarding the atmospheric scattering effect of the terrains/mountain. The most of the screenshots of the World Creator are used uSkyPro. For more information that you can visit their web site or their new unity World Creator tool on Asset store.


    Regarding the Moon, yes, it is possible to change the moon size and replace any other planet texture in the skybox material.
    For now uSky supports only one Moon out of the box. It is possible to have additional one by manual place another planet texture on plane mesh in the sky and position it nearby the far-clipping distance of the camera, that should be render behind the clouds. You may also need to write a simple script that this plane mesh position is always move/offset with the camera position.
    About cutoff planet texture below the horizon that you can alter it with the planet texture if the position is static, other wises it needs to be done via custom shader. I will assist you if you need future help on that.

    (I may be add the new feature allow user to add more moon/planet texture later, but this is not a priority in my to do list.)

    The $30 is for current uSky 1.X. Yes requires upgrade fee for final release, uSkyPro (renamed after uSky 2.0 when released) is not complete yet, I believe the current beta is very closed to final version. The main missing feature is the new clouds system which i'm working on ( priority). If you feel more comfortable that you can wait until it gets released before purchase it, that is up to you.

    In some case I would like to buy the assets from other developer even they are in beta version. However as far as I know many "working in progress" projects that never get released on the Asset store, which i cannot even get a beta of that. So i think it would be nice to leave the decision making to buyer if they want to buy the beta at lower cost now or not, don't you think?
     
    Last edited: Mar 29, 2016
    worldcreator3d and SAOTA like this.
  9. worldcreator3d

    worldcreator3d

    Joined:
    Nov 17, 2014
    Posts:
    83
    I love the uSky asset - it is worth even more as it is simply the best atmosphere scattering asset that is available, even in BETA state - you propably won't find a better one.

    It just works out-of-the-box and lighting looks just fantastic - big respects to the developer * thumbs up * ... and yes, we have used it in all of our screens and videos of World Creator and we will keep up doing this :)

    Great job and thank you!
     
    SAOTA and Luckymouse like this.
  10. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    @ luckymouse, any updated on the clouds that we can check out?
     
  11. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    I got several people asked about the new clouds for uSkyPro, however it is not ready yet. I'm still working on that. I have been following the same tech paper as the Kode80's clouds did, which is "The Real-time Volumetric Cloudscapes of Horizon Zero Dawn". Some people already know that Kode80 is finished his version way ahead than me. By the way, he did really good job and his clouds lighting looks really awesome.

    Inside the tech paper that mentioned about the seamless tiled 3D noise texture, actually it is really tricky to do that. I have been stuck with that over a month. Partially that is the reason the new clouds get delay. Good news is that I finally figured it out and i believe it took a while for Kode80 to figure that out as well. For now I skip the technical talk about how to do the tiled procedural noise generation for 3D texture, unless someone interested, then I will talk more about it here.

    I guess some people may wonder if we can fly through the uSky clouds, for the first release that we can not. It is not my priority at the moment. I believe that the new uSky clouds in some way will be similar to Kode80 clouds. Right now I concern more about the clouds performance and supports the realtime day/night cycle, reflection probe and water reflection ... etc, which how uSky 1.X clouds already did most of that.

    Regarding the clouds rendering, i switched the color source which using the precompute data for the clouds shading, it does synchronise with the skybox color nicely. However by default it seems the clouds has too much red/orange color during sunrise and sunset, so i still need to do some tweak on that.

    Later I will post more news or screenshot soon after the clouds is getting ready. Thanks for your patient.
     
    Last edited: May 28, 2016
    Seith, elbows and Hormic like this.
  12. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    abatcat likes this.
  13. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    imho, uSky's default light color gradient is too saturated at sunset/sunrise…. And attempting to edit it is a bit awkward since we don't really have a way to see where any particular gradient change coincides with the time…. It's an issue with Unity's gradient picker…. It's awesome to have that control over the sun, it's just hard to synchronize (and also hard to override since if I want the sun position from uSky I have to take the sun's color too). I don't have a solution, but I have wished for a better way to graph out that color gradient than trial/error.

    I've been using Kode80's clouds. They look great. Looking forward to your take on it.
     
  14. DigitalAdam

    DigitalAdam

    Joined:
    Jul 18, 2007
    Posts:
    1,202
    Thanks for the update!
     
  15. worldcreator3d

    worldcreator3d

    Joined:
    Nov 17, 2014
    Posts:
    83
    Cannot wait to see that clouds in action - really great work!
     
  16. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    What does this have to do with UskyPro? Further there is no comment on the YouTube or related description that points on Usky and you did not answered those questions asking what assets you use.
     
  17. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    So, no need to calculate something?. The tool just follow the 'Sun-GameObject'?

    Another question : can we fix (no rotation) the Night SkyBox?
    I use it in my project as a reference to facilitate the orientation of the player overnight. If it moves, it is not practical.
     
  18. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Basically it just tell uSkyPro "I'm the Sun". This is script will trigger some event call if the direction has changed, beside that no calculation.
    I checked the "Static" night sky is working as it is, the night sky in skybox stay static. I'm not sure what should I fix? Sorry I just don't really understand your question.
     
  19. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Yes, uSky gives the option for night sky to stay static. Or it can rotate, your choice.

    When a direction light is assigned as "sun", its color and rotation is controlled by uSky.
     
    Luckymouse likes this.
  20. ZJP

    ZJP

    Joined:
    Jan 22, 2010
    Posts:
    2,649
    Oh sorry about the 'fix' thing. I meant "lock". Disable the Skybox rotation. :oops:
    Thanks for the reply. Both of you. :cool:

    Edit :
    Bought !!!;
     
    Last edited: Apr 28, 2016
    Luckymouse likes this.
  21. Konst

    Konst

    Joined:
    Aug 26, 2013
    Posts:
    78
    Hello everyone, could anyone assist me with small problem, please. Win 10 64 Unity 5.3.4p3 uSky clean project works perfect! When i add it into my existing project everything is cool but scene "uSkyPro Atmospheric Scattering" shows 2 errors: 1) Shader error in 'uSkyPro/uSkyboxPro': failed to open source file: 'Atmosphere.cginc' at line 25 (on d3d11)
    2) Shader error in 'Hidden/uSkyPro AtmosphericScattering Deferred': failed to open source file: 'Atmosphere.cginc' at line 16 (on d3d11)

    In my player setting Graphics APIs for Windows: Direct3D11, Direct3D9

    Any ideas? Thanks

    ----------- Fixed ----------
    Ok what i need to do is just Right click on file and Reimport. Error fixed! Thanks everyone and author for this awesome asset!
     
    Last edited: May 8, 2016
  22. Purpleshine84

    Purpleshine84

    Joined:
    Apr 8, 2013
    Posts:
    194
    @Luckymouse Hi, I have a question, I am trying to use the clouds and sky as a background for a 2d image. Is it possible to put the clouds in the background and if so, how can I achieve this?
     
  23. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    First I believe you are talking about the clouds in uSky 1.X, right ? Since the uSkyPro doesn't have clouds yet.
    Second, so do you just need to render the sky and clouds to an image for your background, right?
    I made a script that hopefully it is close to what you are looking for.
    uSky_RenderToRT.png
    You can apply this "RenderSkyCloudsToRT.cs" script to uSkyManager (uSky 1.X).
    It will render the clouds and skybox to a render texture. You can also just render the clouds without the skycolor as well. That render texture you can use as 2D image for your background.
    I think this script should be helpful to start to extent the function for what you need.
     

    Attached Files:

  24. roborb

    roborb

    Joined:
    Aug 26, 2013
    Posts:
    15
    Got your shader and it's great. Is there any way to transition the effect when you change altitude from surface to space?
     
  25. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Regarding the space, right now the precomputed data does not includes the outer space samples to save the texture memory and better performance. "Altitude Sample X4" has included the atmosphere samples up to around 10Km above the ground. Also the sky clouds what i'm I working for is not support to view from the outer space .
    Anyway I will see that I may include that outer space samples as well in future.
     
  26. roborb

    roborb

    Joined:
    Aug 26, 2013
    Posts:
    15
    Including space would be great. I need to do some sea level to geosync orbit scenes, and that's at 43,000 km. You'd be able to look back on the full disk of the planet at that point.

     
  27. Deleted User

    Deleted User

    Guest

    Hi Luckymouse,

    Great asset btw :)

    Is there anyway i can render the uskypro sky and export it to an external 3d application such as maya? I use unity for fast pre viz but mainly i use other 3d software to render stills. I just love the uskypro asset and would like to use the same sky i create in my scene to export to another program. Any advice would be much appreciated.
     
  28. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    For now I think you can capture and export the sky as static cubemap via unity reflection probe, then convert the cubemap to equirectangular (panorama) format via third-party script.

    I found a script from Farfarer that you can download it here. You only need to import the "CubemapToEquirectangularWizard.cs and cubemapToEquirectangular.shader " files. After you import these scripts in your project, you can access the tool via the unity menu: Tool > Cubemap To Equirectangular Map.
    (You may need to alter the script to increase the maximum export resolution.)
     
    Last edited: Jun 4, 2016
  29. Wizard-Games

    Wizard-Games

    Joined:
    Jun 4, 2013
    Posts:
    34
    Is there an eta on clouds yet?
     
  30. jbakirli

    jbakirli

    Joined:
    Dec 31, 2015
    Posts:
    10
    @Luckymouse Hey, this my test of very simple scene. I dragged uSkyPro to my scene. Everything is OK but, where is the clouds? Version 2.0
     

    Attached Files:

    • 1.PNG
      1.PNG
      File size:
      207.5 KB
      Views:
      884
    • 2.PNG
      2.PNG
      File size:
      196 KB
      Views:
      865
  31. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    uSkyPro doesn't have clouds yet.
     
  32. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
     
  33. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    Hi everyone, I know you guys are waiting for uSkyPro clouds. I finished my early version of the clouds, I just need some more time to clear up the codes and do more testing. Hopefully I can update that before the end of June.
    Sorry for delay, lately I have some personal issue I have to deal with.
     
  34. Quatum1000

    Quatum1000

    Joined:
    Oct 5, 2014
    Posts:
    889
    Absolutely no problem. It's better to make the stuff work and optimized.

    And think about unsatisfied users, they will rate directly low and will never change their rating. So take your time.
     
    Last edited: Jun 13, 2016
    Luckymouse likes this.
  35. hierro__

    hierro__

    Joined:
    Sep 22, 2014
    Posts:
    59
    Hi all, is there any way to use Fog or a "foggy" scattering with uskypro beta 2 ? Im using 5.4 beta21, no way to have a fog right now, any hint ?

    Thank you in advance
     
  36. Ravel

    Ravel

    Joined:
    Nov 21, 2010
    Posts:
    605
    Just bought the asset and I would like to know, why the scattering doesn't always work? For example I have a scene that has trees around it and a building in the middle. The trees I managed to get working through some trial and error, but the building never seems to affect the atmosphere, while it clearly should cast a volume. All materials use the standard shader. Also I noticed some sort of a field bug, where everything is see through and there are tiny colored dots all around the scene.

    Edit:
    After a few hours of Learning the asset I found that the light volumes are disabled from a distance.
    whats this uSky Pro.PNG usky props.PNG uSkyArtefacty.PNG
    The arrow indicates the limit point and on the left side there are no shafts. Am I doing something wrong or is this a bug?

    Edit2:
    I think this is just the fact that this is a beta asset, because the invisible line is the center of the world. I'd suggest adopting this method instead.
     
    Last edited: Jun 18, 2016
  37. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    At the moment uSkyPro atmospheric scattering uses the linear distribution that is missing some End Distance or Ray Length control. I will expand more of this control option in near future.

    For now I have some setting suggestion for some amount of foggy effect here, (however it is not totally hazy.)
    I placed some primitives near the camera, about 35 meter (unity unit).
    uSkyPro_Foggy_Settings.jpg

    Hopefully it helps.
    If you really want make your with really haze effect, for now you can also try the asset that Ravel suggested.

    As I mentioned above screenshots that I got the pretty much some setting as you, I didn't get any colored dots error in the scene. I will investigate your issue.
    Because your building is closed to camera, thats why it doesn't have scattering effect on it.

    I believe your are talking about the SunShaft effect that it is not in current uSky asset. It will be included in future version very soon.

    I agree this asset can do haze effect nicely, just something like Unity The blacksmith atmospheric scattering without the sky color control. Which it uses only single light color for the fog. Since it doesn't come with skybox, I guess you can use it with uSkyPro instead of uSkyPro atmospheric scattering. It should work with the daylight cycle that light color is controlling with uSkyPro.
     
  38. AndyNeoman

    AndyNeoman

    Joined:
    Sep 28, 2014
    Posts:
    938
    Hi there, I have just bought the asset. I am having a problem getting the moon to show up. For some reason I have to move settings in the inspector to get it to appear - obviously cant do that in build so the moon does not show. Light is there however and flare if I apply one - but the moon texture is not.
     
  39. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    That is strange, did you use the provided uSky prefab for you scene? did you have the Moon light (directional light) with uSkyMoon component in your scene?

    [Edit] Does the uSky demo scene has the same moon problem? (or you only have that problem with your scene ?)
     
    Last edited: Jun 23, 2016
  40. hierro__

    hierro__

    Joined:
    Sep 22, 2014
    Posts:
    59
    Referring to setup for fog, i cant get any result, basically atmospheric scatter script seems to be inactive (enabled or not is the same ), will the fog work as the previous version ? It's really important we can use it since your asset is actually included in our engine, so we want keep on using it without any other addon.
     
  41. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    I tested uSky and uSkyPro is working on editor 5.2.4, 5.3.x and.5.4.x. Did you add the "uSkyAtmosphericCamera" component to your main camera?
     
  42. hierro__

    hierro__

    Joined:
    Sep 22, 2014
    Posts:
    59
    To be true i start to be confused about all these components to add, can you please provide a sample scene to obtain fog ? Thank you
     
  43. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    484
    I believe uSkyPro comes with atmospheric scattering demo scene already, you can just tweak some of the parameters to get variety effect result.

    Here attached the links of Foggy test scene file that used the setting value that i suggested from the screenshot from earlier post. It is only a unity scene file and make sure your project had already installed uSky Asset.
     
  44. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    With clouds, would it be possible to have a seed value so the starting look can be adjusted? I only just bought this asset, when I saw the folks over at World Creator talking about it. It's superb and the clouds look great.
     
  45. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Oops - the clouds are images. I could render my own pano from Terragen or wherever then. Presumably.
     
  46. jbakirli

    jbakirli

    Joined:
    Dec 31, 2015
    Posts:
    10
    I will gonna make video tutorial about custom cloud layer.
     
    JBT27 likes this.
  47. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    That would be most appreciated - thanks.
     
  48. jbakirli

    jbakirli

    Joined:
    Dec 31, 2015
    Posts:
    10
    Here is the tutorial about custom cloud texture.
     
    Luckymouse, JBT27 and nxrighthere like this.
  49. JBT27

    JBT27

    Joined:
    Jul 13, 2016
    Posts:
    197
    Thanks very much - good tutorial.
     
    jbakirli likes this.
  50. RaHaN_GS

    RaHaN_GS

    Joined:
    Nov 9, 2015
    Posts:
    4
    Hello Everyone, Luckmouse,

    I already sent an email about this, but just in case anybody else ran into the same issue with that fantastic asset and knows what's happening:

    my specular (or metallic, depending on the shader) maps disappear (or rather, they are not rendered but are still there in the assets ofc) when I hit play – not to reappear unless I fiddle with the “Disable Slybox Ocean” checkbox (and they only reappear in the editor of course, after I have checked and unchecked the box. The disappear again when I go to runtime by pressing play). I have joined screenshots to better convey what I mean:

    How it should look:


    How it becomes as soon as I hit play:


    The way the uSky Pro prefab is setup in my scene:


    “Player settings”, “Graphics settings” and”Quality setting”: how my Project Settings are setup


    The way my Main Camera is setup:


    I’m using Unity 5.3.5f1 – with other stuff like Playmaker and nGUI but not sure that might be relevant.

    Did I miss something? Do you have any idea why it behaves like this?


    Thanks in advance for your help,