Search Unity

[Released]AS3: Flexible Physical Accurate Atmosphere Scattering

Discussion in 'Assets and Asset Store' started by Atom li liu, Dec 10, 2014.

  1. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26

    AS3 v1.2 Released with real-time atmosphere scattering updating & fully support SM2!!!
    AS3
    (Atmosphere Scattering Simulation Solution) is the tool which can physical simulate any height of atmosphere (Flexible thickness) for your terrestrial planet.
    The goal of this tool is build a physical accurate atmosphere scattering phenomenon both from space and inside atmosphere, and simple to use. All of AS3 shaders can work both outer and inner atmosphere.

    It is based on Siggraph’93 paper "Display of The Earth Taking into Account Atmospheric Scattering" and GPU Gem2 “Accurate Atmospheric Scattering”. I know there are lots of similar shaders which based Sean O'Neil's paper, but this one is not like GPU Gem2 sample which limited your atmosphere's height(2.5% of the planet’s radius). In this tool you can get nearly physical correct result in any height of atmosphere.



    FEATURES
    • Realistic result and more accurate than others (Guess which one is real photo).

    • Flexible Physical Accurate Atmosphere Scattering: You can create any atmosphere height ratio planet and also physical accurate.
    image.jpg
    • Easy To Use: Just one click you will get your new planet.
    • Real-Time Atmosphere Height & Scattering Changing.
    • Support Surface Material.

    • Custom Color: Assign any color you want to atmosphere.

    • One shader work for both inside atmosphere and space.
    • Support LDR and HDR rendering.
    • Support Linear and Gamma rendering.
    • Work in SM3.0 and SM2.0.

    >Earth Simulation Demo


    >Flexible Atmosphere Demo


    For more detail please check manual or AS3 support page.
     
    Last edited: Jan 11, 2016
  2. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    April,2016
    Version 1.2.1 Released
    • Fixed Cloud Offset doesn't work issue
    Jan, 2016
    Version 1.2 Released
    • Real-Time flexible atmosphere height changing
    • Physical flexible atmosphere height in SM2
    • Surface material support and sample

    Oct, 2015
    Version 1.10 Released
    • Added Custom color feature

    Sept, 2015
    Version 1.01 Released
    • Fixed Radius Issue in SM2.0
    • Fixed SM mode update issue in UI
    • Added bump sample shader

    Jan, 2015
    Version 1.0 Released:)
     
    Last edited: Apr 27, 2016
  3. critic

    critic

    Joined:
    Jun 14, 2013
    Posts:
    8
    Very nice work getting all this code together, I do have a couple of issues that I hope you will resolve.
    • Shader Model 2.0 version of the planet generator breaks if you set the planet radius over 4.
    • Default generation of planets in Unity 5 does not produce a realistic planet, I think this is due to the new default lighting in Unity 5 or the plugin default settings
    • There is no option to add a Normal or Bump Map to a planet
    • Shaders are Fragment based instead of Surface, so the planet does not receive shadows from other objects in the scene
    • Shader Model 3.0 pre-generates the Mie and Rayleigh values and so the plugin can not be used to change the atmosphere in real-time, real time generation of these values in the shader would be good
    Do you have plans to address these issues?
     
  4. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    Thanks for your feedback and sorry for the issues. It will be updated soon for fix SM2.0 radius issue and I will add a sample shader which with bump map. Then I will update it in Unity 5 only and should fix the realistic issue in 5.
    About shadow and real-time generation, it has already in my update list. :)
     
    critic likes this.
  5. antonov_3d

    antonov_3d

    Joined:
    Jan 21, 2015
    Posts:
    28
    Hello i need to understand if i can change the colors of that atmosphere, if yes ill buy it.
    I sent you email some time ago, on which you didn't respond, and it is impossible to leave a comment on your "support" page, due to "post comment" button being stuck.
    Are you active? if you are not active you have to tell people about it, otherwise we are wasting time.
     
    Last edited: Sep 14, 2015
  6. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    You can try the new version which fixed SM2.0 radius issue.
    Thx
     
  7. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    Sorry, I guess there are some issues for my page setup, I didn't receive any notice about comment.
    For your question, yes you can change the atmosphere color by wavelength setting in planet setup as you want. Since it is physical based, changing color by light wavelength might a little bit tricky for you. I will try to add some convert tool in next update to make it easier.
    Thx,
     
    antonov_3d likes this.
  8. antonov_3d

    antonov_3d

    Joined:
    Jan 21, 2015
    Posts:
    28
    Like rly Atom, add more coloring options, if that possible some POST coloring, with color gradient, like after you render the atmosphere, you apply coloring before adding it to scene.
    Best coloring option imo, as an artist, would be analogue of photoshop "Gradient map" which maps values from image to provided any gradient, which results in infinite control over the look. This is really important to me because Cael Dominis has galaxy full of procedural planets, and they have to have uniquely colored, reeeeaaly good looking atmosphere.
     
  9. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    Thanks for suggestion, add post coloring is a good idea. I am not only going to add tool to give you wavelength to match the color you select but also add shaders with hue adjustment.
    For completed color control as a gradient map is nearly impossible for physical simulation, just like physical sky you can not control sky color from horizon to pole by simple map. Because all color you see is come from math simulation based on Rayleigh scattering, Mie scattering, sky depth and density scale that all physical parameters. If you really want to get full control you need to look for other tool which not physical based but texture based.
     
  10. antonov_3d

    antonov_3d

    Joined:
    Jan 21, 2015
    Posts:
    28
    Ok thank you, could you share what is the color range you can get by tweaking physical values? I know for sure its blue, and i managed to get cyan color in Proland(but thats it lol) , so im wondering what are my possibilities? can i do red/orange/purple/green?
    Another question, i see you have interface to create planets, does that mean they have to be precomputed on editor time, or i will be able to generate them on runtime at will?
     
  11. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    I have already added custom color in the next version, as long as I update doc I will release it soon. In the new version you can overwrite any color to atmosphere, in this case you will loss diffuse sky radiation by Rayleigh scattering since you customized color. I still keep the physical one just like default if you not open custom color option.
    As pics below it works in and out atmosphere and also work in SM2 version:



    For another question about run-time generation it had already in my list and will test it soon. The mainly concern is performance, if it is no problem I will add it in.
    Thanks
     
  12. critic

    critic

    Joined:
    Jun 14, 2013
    Posts:
    8
    Great work, thank you for the update.

    I think it's possible to have variable ratio of atmosphere/surface even with SM2, you just need a density function. How about Surface Shader support? How about Bump Map field for SM3 and GUI?

    Here is a implementation of the variable ratio function, hope it helps. Looking forward to the next update.
    https://www.shadertoy.com/view/lslXDr
     
    Last edited: Nov 16, 2015
  13. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    Thanks Critic, in fact I did a test shader before which including in/out scattering integral function just like the link you shown me. However the shadertoy one had been super simplified and not same as original physical accurate result anymore.
    The reason why I didn't put my full in/out scattering shader in AS3 is because performance. If you test the shadertoy shader with a lot of sample times in both scattering you will find the FPS drop down very fast. But in my lookup table shader it will still keep over 60 FPS even if the sample over 100. Adding in/out scattering sample times will exponential increase the GPU cost , that is why I use lookup table. However you are right we can make it work in SM2 and keeping low sample times we will still can use it. So I will add it in the next update.

    About Surface shader support, I have already made it and it will in next support also.
     
    Last edited: Nov 19, 2015
  14. critic

    critic

    Joined:
    Jun 14, 2013
    Posts:
    8
    Thanks for the quick response Atom, if real-time generation is too much of a performance hit in SM3, could you add an option to recalculate the atmosphere parameters on-demand in the Planet parameters script?

    Keep up the good work, looking forward to the next update. :)
     
  15. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    Last edited: Jan 11, 2016
  16. Harpoon

    Harpoon

    Joined:
    Aug 26, 2014
    Posts:
    20
    Hi. I've the AS3 and it's amazing but there's one little problem. The clouds are not moving. I've looked into the script and it searches for _CloudUOffset property but none of the shaders has it. Also, would it be possible to split the earth into 4 textures to get better quality?
     
  17. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Clouds do not move for me.

    I also do not get the smooth shadow line on the planet's surface as shown in your demos, I get the shadow edge as a blocky zig-zag broken line (per triangle?)

    Screen Shot 2016-03-27 at 9.46.39 AM.png
     
  18. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    Thanks for you feedback, the function of cloud movement should be in a demo shader which included in package, it is my bad didn't select it when I upload, I will add this function in all shaders and update it soon.
    For shadow edge, you can tweak DiffOffset parameter. If issue still there please let me know.
     
  19. Harpoon

    Harpoon

    Joined:
    Aug 26, 2014
    Posts:
    20
    Thanks. How about splitting planet surface into 4 (or more) textures? Is it possible?
     
  20. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    Yes, you can modify shader to do that, the easiest way is to use surface material as earth surface shader. There is a surface materia sample in the package.
    Thanks
     
  21. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Hi, what I am seeing is a very strong "grid" in the sunset zone on the planet surface shader:

    Screen Shot 2016-03-30 at 10.37.26 AM.png Screen Shot 2016-03-30 at 10.38.46 AM.png

    I believe it must be an error because I do not see it in your online Earth demo....
    Screen Shot 2016-03-30 at 10.45.23 AM.png

    I am using your setup wizard, and the provided textures:
    Screen Shot 2016-03-30 at 10.28.26 AM.png

    I am on a MacPro
    OS 10.11.4, AMD FirePro D500
     
  22. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    Which Unity3D version you use and which shader mode in this project?
    Could you please send me a sample file to my email: skycube2014@gmail.com since I cannot reproduce your issue on myside.
    Thanks,
     
  23. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Unity 5.3.4 (current version)
    I'm not sure what you mean by "shader mode"...?
     
  24. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    Hi, when you generate planet you can select 3 different shader mode: SM2, SM2FF and SM3LT. I would like to know which one you used in this case?
    Thanks,
     
    Last edited: Apr 1, 2016
  25. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    SM3LT here are the settings:

     
  26. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    strange, i didn't see any issue on my Unity 5, you can check my attachment which show you the result I got with the same setting. I suggest you send me your sample file for the issue.
    Thanks,
     

    Attached Files:

  27. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    For whatever reason I am no longer able to open the project where I captured the above screengrabs. Unity hangs on launch and doesn't even trigger the crash log.... It's the 3rd project that has become corrupted(?) with many of the same assets involved (all are space or terrain assets, so maybe there is some conflict...). If I can track it down I will let you know.

    However, loading AS3 in an empty project shows a smooth shadow transition on the planet surface, as expected. Thank you for your help. I'm glad I asked for advice before submitting a review....
     
  28. Atom li liu

    Atom li liu

    Joined:
    May 9, 2013
    Posts:
    26
    Thank you, If you see any issue in the future please don't hesitate contact me.
     
    wetcircuit likes this.