Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

uSkyPro – Precomputed Atmospheric Scattering [2.0 Beta]

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

  1. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    oh sorry i think i read it wrong, yh i'm all for the extra to upgrade, still worth it. you deserve it dude cheers
     
    Luckymouse likes this.
  2. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    I haven't try any objects blending with fog in high altitude, mostly ground level, sure i will check it out.

    Some more info of precomputed data in uSkypro :
    The reason i use precomputed method now and not before, that before the Sky color from Eric and Scrawk projects both are reading a precomputed raw files. Which we will always get the standard sky color and i can not figure out how to change the color in a practical way earlier.
    Since I started uSky and gain more knowledge about it. I spent quite some time on reading the source code with UE4 atmospheric fog. (Which based on the same Eric codes). Now I'm able to dynamically generate the data on the fly in unity, and able to change the sky color.
    Also without the raw files, it will save some player package download size, Especially for web and mobile platforms.

    The precomputed calculates in just a single frame at start up and remain static during the game play, until user changes the precompute parameters, then it re-calculates and update the data in another frame and remain static again. Besides uSkypro will work on all platform.

    Another reason I use the precomputed data that the data can be share on skybox and atmospheric scattering image effect ( clouds too if needed). It doesn't need to re-calculate in different shaders. Make more sense in practice usage.

    The Eric's atmosphere scattering method is particularly working well from ground level to high altitude with any camera's viewing angles.

    The coding of skybox itself is pretty much done. Very stable, zero GC, very low overhead on cpu. Nevertheless, there are still a lot of work on coding with atmospheric scattering image effect side to make it renders correctly.

    [EDIT]
    Video Link Removed.
     
    Last edited: Jan 5, 2016
    SAOTA and JeyDia like this.
  3. Jesse_Pixelsmith

    Jesse_Pixelsmith

    Joined:
    Nov 22, 2009
    Posts:
    293
    Really liking uSky and getting it all set up in our game. Just trying out fog and it's great with the exception of the fact that it seems to get overdrawn by Unity's Water4 shader? Is this something able to be solved?

     
  4. Marcurios

    Marcurios

    Joined:
    Nov 19, 2012
    Posts:
    88
    upgrade fee of 10 is very reasonable, i'd upgrade it.
     
    Luckymouse likes this.
  5. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    yeah i have same problem with water and fog, im using forward rendering so i can get unity fog to work too, im using unity and usky fog... u can see in background the water and fog doesn't cover it, must be a unity bug, if i use deffered then i cant use unity fog at all
     
  6. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    So far as I know that the unity water supports only the fog in forward path rendering (built-in unity fog), which not supports the image effects based fog. uSky comes with a "uFogGradient" script (mentioned on page 6)that you can manually set the fog colour for unity forward path . Since your game is top-down based that you don't really need the scattering fog anyway, I think this uFogGradient script can be your water fog solution.

    You have similar water fog with Jesse above. I do know many people are struggling this problem with unity water and fog. Matters of fact that is not a bug, the forward and deferred path are using different rendering technique. Unity fog works in forwards path ands image effects based GlobalFog works in only deferred path. At the moment you have to chose either one fog methods and can't have both fog working in the same scene.

    Btw, Scrawk's new ocean/water "Ceto" just submitted to asset store. (May still need to wait for couple of day to show in the store). You may check it out if it suits the need of your project.
     
    Last edited: Oct 8, 2015
    llJIMBOBll likes this.
  7. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Thanx ill check out the water. I actually forgot about image effect fog ill do some more tests xd. Thanx again
     
  8. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    336
    I'm using Suimono and it works really well with the uSky imageFX fog too.
     
    Luckymouse likes this.
  9. Project-Mysh

    Project-Mysh

    Joined:
    Nov 3, 2013
    Posts:
    223
    Hi there Luckymouse,

    Remeber me? I'm the Playstation Awards guy that asked for the new occlusion feature on the USkyFog. I'm glad to say that Im finalist and the last round is on December 1st.

    Can we get that Usky 2.0 update before this date? Or I wil have to build my own alternative?
     
  10. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    Of course I remember you. Congratulation you are finalist of the Playstation contest.
    I think at least the beta version should be available before 1st Dec.
     
    Project-Mysh and SAOTA like this.
  11. sean68XDS

    sean68XDS

    Joined:
    Nov 4, 2015
    Posts:
    2
    Hi Luckymouse,

    I'm running into this error with the stars on Nexus 7 and Samsung Galaxy S5. I am integrating the latest version of the google cardboard sdk but this error still exists after I delete all cardboard files.
     

    Attached Files:

  12. helarts

    helarts

    Joined:
    Jun 12, 2013
    Posts:
    6
    It seems the stars shader is not working, is it inside Resources folder ?
    (the really first line of Stars.shader: " // Note: This Star shader need to be inside Resources folder for mobile build! " )
     
  13. helarts

    helarts

    Joined:
    Jun 12, 2013
    Posts:
    6
    Hey Luckymouse,

    Great work with this asset, it works like a charm.
    Is there any particular reason to clamp wsDir in uSkymap.shader line 65: " r.z = max(8e-2, r.z); " ?
    It skips the bottom of the horizon like you can see on the screenshot, simply projecting the skyMap texture on a sphere.
     

    Attached Files:

    Last edited: Nov 4, 2015
  14. sean68XDS

    sean68XDS

    Joined:
    Nov 4, 2015
    Posts:
    2
    It is inside usky/core/resources. Here is my project structure. Do I need to Resources.Load somewhere? projLayout.PNG
     
  15. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    Maybe stars flickering code has the problem with the android devices.
    You can try to change the code in vert program:
    Code (CSharp):
    1.             // float brightness = GetFlickerAmount(v.vertex.xy) * pow(5.0, (-appMag -1.44)/ 2.5);
    2.            float brightness = pow(5.0, (-appMag -1.44)/ 2.5);
    And comment out (or remove) the complete code of float GetFlickerAmount(in float2 pos) function in the shader.

    [EDIT]
    My best guess that the flickering code has the Arrary variable, maybe that is the reason not working in android.

    Yes, The clamp needed to correct the sky colour. If you need help to work with the Ocean BDRF, please send a PM with uSky invoice number. I will send you a complete uSky and Ocean BDRF project link. Keep in mind that Scrawk released his new Ocean Ceto in the assetstore.


    [Other]
    I found out that the terrain shader in the uSky fog demo scene is NOT working anymore in Unity 5.2.x. You can just switch that terrain material to the "Built in Standard".
     
    Last edited: Nov 7, 2015
  16. helarts

    helarts

    Joined:
    Jun 12, 2013
    Posts:
    6
    Ok, thank you, I also noticed some artifacts on our ocean without the clamp, although I can reduce it a bit more without visible glitches.
    I just use the skyMap on some procedural clouds we can drop around in the map to "hide" islands behind, somehow like that:

    The skyMap is a cheap way for me to fine tune the color and make it fade better with the skybox without affecting the occluding property of the cloud if that makes sense.
     
  17. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    The purpose of the skymap is for the ocean material only. I guess you can modify it and use it for other creative stuff.
     
  18. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    728
    @Luckymouse Hi, I would like to place some clouds of mine (just textures on poly planes) around the sky for variety sake. And I tried using the uSky/DistanceCloud shader with my own textures but it seems the sunlight information is not properly received by my clouds (ie: the sun doesn't appear behind, they don't go dark at night, etc...).

    Is there anything special I need to do be able to benefit from the same density/volume look as the default uSky clouds?
     
  19. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,041
    Can you add some new options for a better scattering?
     
  20. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,270
    I miss the early interface that was so simple, just like 5 controls.... I know everyone wants another Time-Of-Day (and I also asked for features like the Ambient gradient which are wonderful), but uSky was great when you could easily overdrive the colors (for background or Enlighten) and done... Now I honestly feel I have to stare at the interface to find stuff everytime I go to the uSky Manager... It's not *exactly* a complaint, but maybe there could be options to close the nightsky/moon interface etc...? I feel like the direct simplicity of an artistic tool got buried under a lot of simulator bells and whistles....

    Screen Shot 2015-11-09 at 12.09.26 PM.png
     
    llJIMBOBll likes this.
  21. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    luckymouse is making a pro version of uSky so maybe will have a few more options to play around with ;)
     
    wetcircuit likes this.
  22. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,270
    Haha! I want a uSky-Lite™ just for dynamic colored backgrounds and IBL.
     
    llJIMBOBll likes this.
  23. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    At the moment, the distance cloud shader is particular for the dome shape mesh, I can write a new cloud shader for the plane shape mesh. After I finish up the new scattering feature. I will definitely expand the clouds feature in future as well.

    Yes, New uSkypro will have much better scattering. I believe at least the beta version will release in this month.

    I will keep it in mind that I will improve the uSky interface, something like fold up/down some grouped parameters.
     
    llJIMBOBll, SAOTA and wetcircuit like this.
  24. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    728
    Yes, please do! Being able to add clouds to create a feeling of depth is an extremely important feature.
     
  25. AVerhoeven

    AVerhoeven

    Joined:
    Dec 30, 2013
    Posts:
    2
    Thanks for creating this great asset. I am loving it and it made my game look and feel fantastic. A couple of questions:

    Would you consider adding moon phases too it, so we can have a cycle from empty to full moon and could you make it that it is scriptable, like all the other features are already?

    Would you implement further enhancements to the cloud system, being able to influence their direction, speed, size and type (light, dark rain, storm etc.)?

    Will you add a weather system to this at some point (rain, snow, storm, lightening)?

    Absolutely great work, hope you will add functionality to this, if you would have the above mentioned features you would have by far the best sky system on the store.
     
  26. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    There are couple users have been requested the moon phases feature too. It is already in my to do list, but not a high priority yet.

    In general uSky clouds uses different "clouds textures" to produce variety clouds effects. What are you looking for I believe it is more likely a procedual clouds. At some point that I will improve clouds feature soon after finished the scattering upgrade.
    At the moment, I'm not planning to add the weather system to uSky yet.
     
  27. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    Hi everyone I just finished the new uSky 2.0 (uSkypro) atmospheric scattering. I'm working on the new cloud system, so at the moment there has no clouds in the package yet. Fixed most of the bugs I could possibly find. So be submit to asset store soon.

    Update:
    Added 4 layer samples optional that includes the atmosphere level precomputed data.
    Added atmospheric occlusion, it is pretty much implemented directly from unity black smith's atmospheric occlusion.
    [EDIT]
    Here is the Latest Webplayer
    REMOVED link
    will update new webplayer in later post.
    uSky20_Beta_Screenshot.png
     
    Last edited: Dec 3, 2015
    SAOTA, llJIMBOBll and NikProductions like this.
  28. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    It looks gorgeous and I would love to try it when it's done.

    Note: I'm getting a weird glitch? a20217a758096c8bfd2808a3af2c2979.png
     
    Last edited: Dec 3, 2015
  29. sjm-tech

    sjm-tech

    Joined:
    Sep 23, 2010
    Posts:
    709
    Same black sky here.
    - Nvidia GTX 770
    - Windows 8.1
     
  30. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,270
    Screen Shot 2015-12-02 at 11.28.16 AM.png

    I have sky but no GI.... If I go too high in the atmosphere I get the issue where Unity turns into broken squares....

    Screen Shot 2015-12-02 at 11.30.16 AM.png

    Mac Pro, OSX 10.10.5, AMD Firepro D500
     
  31. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    yh i got black sky too
    AMD 290x
    Windows 10
     
  32. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    Ouch. Sorry guys for so much trouble. I will fix it immediately.
     
    Last edited: Dec 3, 2015
  33. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    Finally find out that the black skybox error occurs when create a "new Texture2D" by script in Linear colour space. Turn out it causes by Unity bug on Windows only and working fine in Gamma colour space. However it works everything fine on Mac. I may do some other work around method to fix that later on.

    By the way, not sure if new uSky has any problem on AMD card yet, I don't have the card to test.
    So if use the AMD card may still have the rendering problem, that i added an Scatter Occlusion toggles UI, incase if it gets any rendering issue, just turn it off for now.

    Here is the gamma colour space WebPlayer (3.7Mb)
    Added few more UI slider controls.
    uSkyPro_Web screenshot2.png

    Known Issue:
    Some values (like Mie...etc) that if push it too extreme, may cause the rendering artifacts.
     
    Last edited: Dec 3, 2015
    Seith and llJIMBOBll like this.
  34. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,270
    This is what I see....

    Screen Shot 2015-12-03 at 9.36.39 AM.png
    Mac Pro, OSX 10.10.5, AMD Firepro D500
     
  35. NikProductions

    NikProductions

    Joined:
    Oct 29, 2014
    Posts:
    95
    Works great, thanks!
     
    Luckymouse likes this.
  36. Seith

    Seith

    Joined:
    Nov 3, 2012
    Posts:
    728
    @Luckymouse As far as clouds are concerned this Unity solution looks amazing:


    But honnestly as I said before I would be very happy with just being able to place clouds on textured planes and have them receive proper sun/shadows information from uSky.
     
  37. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    So far it is an easy fix with texture issue on Windows. I just need to enable texture linear option when create Texture2D in script, that solved the problem.

    About AMD card issue that I have been talking with wet circuit, new uSky seems work well inside the unity editor on her machine, somehow get the rendering problem when camera is using deferred mode on Webplayer build. I will investigate more about it.

    @Seith
    Thanks for post that link. I have been watching his forum threads since your post. His clouds solution seems very impressive and convincing result.
    The simple clouds plane has been wildly use in game industry and I promise that i will include that soon in uSky.
     
    Last edited: Dec 6, 2015
    Seith likes this.
  38. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    uSkypro beta is ready to submit. It still not totally completed all the features and have some limitation.
    So far the features that you see in the web demo are included. For AMD card users that please report if there have any rendering issue.

    uSkypro parameters 1.png uSkypro parameters 2.png uSkypro parameters 3.png

    Here is the uSkypro Roadmap :
    To Do List:

    - Combine a switchable TimeLine control from two scripts (uSkyTimeAndLocation, uSkyTimeSimple).

    - Play Day/Night cycle with curve control.

    - Support SphericalHarmonics ambient lighting with custom ground color control.
    Ambient lighting will always automatically synchronize with the skybox color when changed.
    Support SphericalHarmonics both in editor and runtime.
    (Due to new skybox there does not have gound color on it, and it will not produce correct ambient if use skybox ambient mode.
    So currently limited to use the manual "Ambient Gradients" only for ambient lighting.)

    - Add and improve clouds rendering with atmosphere scattering and occlusion.
    (Additional fogginess control in sky (skybox) and atmosphere scattering.)

    - Add "Distance clouds plane" for free placing in the sky with correct sun lighting.

    - Add Horizion Fog control for Height fog feature.

    - Basic Lensfare for the sun spot.

    - Mobile version of the uSkypro skybox material.

    - Moon Phase feature.


    Add Extra Feature Plan:
    ----------------------------------
    - LightShaft (ImageEffects) with full sky occlusion. (Mentioned in page 7)

    Optional Plan:
    --------------------
    - Support baking/precompute full Day/Night cycle of the reflection probe.
    No need to do the realtime rendering of the reflection cubemap.

    Upcoming update will includes uSky 1.x version with small bug fixed, and uSky 2.0 Beta (uSkypro) with no upgrade fee. So you can try it out now.
    The upgrade fee $10 will apply with next uSkypro release version, also the price will be set to $50 for new uSky user.
     
    Last edited: Dec 8, 2015
    llJIMBOBll and SAOTA like this.
  39. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Wow nice! Take my money :D can we buy now or have to wait till on store?
     
  40. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    Best way to download on store. Unity just released new 5.3 version, I'm going to test it and make sure uSky has no problem to run on the newest editor, then i will submit right away.

    [EDIT]
    Bad news. Due to Editor 5.3 changes, the ambient lighting looks weird on both uSky version (ground colour is dark orange colour), uSky 2.0 Occlusion is missing but no errors in editor :confused:. So I have a few minor issues to address before it is ready to be submit.

    [EDIT]
    The Ambient issue in 5.3 seems belong to the unity bug, nothing to do with uSky at the moment.
    Also v5.3 on Mac is using new OpenGL3.3 api. Turn out it is an easy fix for Occlusion shader by remove the compilation directives "#pragma only_renderers d3d11 d3d9 OpenGL". Now working fine. I'm going to submit the package today.:)

    [EDIT]
    Good news! package submitted, waiting for approval.;)
     
    Last edited: Dec 10, 2015
    llJIMBOBll and SAOTA like this.
  41. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    Hi, I just updated but looks like nothing has changed? the change log says 1.1.6 too, but unity says 1.1.7
    edit, ill try delete and re-download package

    edit! oops! i re-downloaded and works perfectly, thanx again :D
     
    Luckymouse likes this.
  42. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    Very quick approval this time. :)Enjoy!.

    V1.1.7 and 2.0 Beta in AssetStore now
    uSky 1.1.7 Change Log
    =======================
    **************************************
    Requires Unity Editor version 5.2.1
    **************************************
    - Modified with different way to initialize stars mesh, should fix the occasionally warning of the mesh leaking in the editor.

    - Removed old custom Terrain Shader and using the built-in Standard material.

    - Distance Clouds "Layer" setting has been exposed to inspector by default.

    - Added "uSkyBox Simplified SM2" shader model 2.0 fallback Skybox shader for supporting older gpu devices.
    (Not supports mie Scattering, moon and Outer Space Cubemap texture)

    - Now uSkyManager can be treated as an instance in the scene to provide easy access from any other script.

    - Changed the "uSkyGUI_Helper" script that now does not require to assign the uSkyManager component anymore,
    it will look for uSkyManager instance automatically in the scene.

    - The "Timeline GUI" timer text has been changed from "string" to "StringBuilder" format. It improved slightly the GC allocation issue.


    Hi sean68XDS, Have you fix the stars with your android build yet? I got the stars shader with the similar problem on WebGL build (Pink error colour). I didn't get any user report about it, so i just find that out. I made some change to the shader now and it seems working fine when tested it on WebGL. Hopefully this will fix your stars problem with your android devices.
    This will be update in next v.1.1.8.
     
    Last edited: Dec 12, 2015
    SAOTA and llJIMBOBll like this.
  43. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    Just wanna mention about the ambient lighting on new Unity 5.3 is completely broken on non-static objects. I believe Unity team has been already acknowledged this issue. At the moment I do not recommend upgrade your project to 5.3.

    However if you wanna try out the Unity 5.3 new SSR (screen space reflection) and new tonemapping color grading features, you can grab it on store : Cinematic Image Effects pre-release.
     
    Last edited: Dec 12, 2015
  44. agriffin

    agriffin

    Joined:
    May 10, 2012
    Posts:
    19
    I am really liking the changes in the uSky Pro Beta! However, I am having trouble getting atmospheric scattering to work on objects that are small..

    Any suggestions?
     
  45. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    Can you tell me more details about the trouble you have for small objects, or maybe provides some screenshots that helps me to understand your issue?
     
  46. agriffin

    agriffin

    Joined:
    May 10, 2012
    Posts:
    19
    Here is an example of what I am talking about:



    The larger sphere uses a scale of 50 and the smaller one uses a scale of 10. I want to make the light shadow have a stronger appearance with smaller sphere.

    Here is an example of my scene:

    I want the light beams to be stronger where the sun shines between the branches. Right now it is not really noticeable... With large geometry like mountains, it looks great though!
     
  47. llJIMBOBll

    llJIMBOBll

    Joined:
    Aug 23, 2014
    Posts:
    576
    use HD cameras and HD skybox, and set the Sun Ansio filter to 0.995, shud help with the effect, thats what i use, with ray 2 and mie 1, if this helps too my RGB is x560, y520, z492 ... with this setup i get the sun shining thru, also image effects help, SE Natural Bloom & Dirt Lens i would recomend
     
  48. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    @agriffin Thanks for screenshots.
    First image:
    I believe that you are mainly talking about the occlusion effects that is hardly see on small sphere. The main reason that during sampling the occlusion with small objects or small shadow will get easily "washed out."
    Right now the occlusion is doing basic multiply calculation with the scattering. It just removes the scattering effects (bright area) on the screen pixels. I will see if I try some different blending calculation to make the occlusion area actually darker or make it more oblivious in future.

    Second Image:
    As I understand the effect you want is more likely as unity sunshafts effects, right? or you might expect some occlusion effects should be in-between some of the branches nearby the sun spot area?
    I noticed those effects are still little weak to get in this beta version at the moment:
    1) If you want occlusion effect to be more oblivious, somehow the scene need to be more foggy. I know currently will hard to get foggy effects, I will add some more control setting to improve it in future.

    2) I intentionally removed the original the blacksmith's "Occlusion Full Sky" option, its kinda expensive to render, It requires additional sampling for that, beside it doesn't get decent result. Currently missing feature that no occlusion effects appear on the background skybox area. This feature will replaced by uSky "LightShafts" effects later on. If you want to know more about it, go to last page post #347.

    Btw, I like your second screenshots, looks great.:)
     
    Last edited: Dec 16, 2015
  49. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,270
    Is there an option to turn off the "ground"?
     
  50. Luckymouse

    Luckymouse

    Joined:
    Jan 31, 2010
    Posts:
    483
    There is a "Disable Skybox Ocean" toggle, if its what are you asking.
     
unityunity