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

Cloudy Crown PRO - dynamic skybox with custom shader

Discussion in 'Assets and Asset Store' started by PhannGor, Sep 17, 2016.

  1. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    160



    Farland Skies - Cloudy Crown Pro is minimalistic, cartoon style skybox with a custom single-pass shader that works as a regular skybox material, avoiding the use of any sphere or mesh.

    Features:
    • Dynamic clouds with adjustable colors, height, offset and rotation speed.
    • Stars with adjustable tint, twinkling speed and horizon extinction.
    • Sun and moon with customizable size, tint, and position.
    • Fully customizable day-night cycle.
    • Easy to control either from scripts or directly in the editor.
    • High Performance. Optimised for mobile devices.
    • Supports both SRP and LWRP.
    • Easy to integrate, just drag prefab to your scene and you're ready to go!
    Demos:
    Screenshots:










    Changelog
    v 1.4
    • Added support for LWRP
    • Better compatibility with Unity 2019.1
    • Replaced obsolete PreferenceItem with new SettingProvider
    • Minor bugfixes

    v 1.3.3
    • Better compatibility with Unity 2018.2
    • A number of small optimizations and fixes

    v 1.3.2
    • Fixed bug with SkyboxController initialization for large scenes
    • Better compatibility with Unity 2017.2

    v 1.3.1
    • Added option to specify frames interval between skybox day-night cycle updates
    • Better compatibility with Unity 2017.1
    • Minor bugfixes

    v 1.3
    • Added option to move "Farland Skies" folder wherever you want in your project
    • Added SkyboxCycleManager prefab
    • Various optimizations and fixes

    v 1.2
    • Added three different types of clouds
    • Added three different types of stars
    • Added three different types of sun
    • Added three different types of moon
    • A number of small optimizations and fixes

    v 1.1
    • Implemented possibility to enable/disable clouds, stars, sun or moon as shader feature
    • Improved editors for skybox controller and day-night cycle controller
    • Various performance improvements

    v 1.0
    • Initial release

    Please, feel free to send any feedback, suggestion or critic. It'll always be well received and pondered. Don't hesitate to comment. Thanks!
     
    Last edited: Jun 13, 2019
    Mauri likes this.
  2. TS42

    TS42

    Joined:
    Nov 7, 2013
    Posts:
    13
    Hi PhannGor,
    I like your skybox and would like to use the pro version.

    Just to make sure...
    - Does the pro version works with a skybox component on a depth layered camera?
    - Have you tested the pro version in a VR environment (SteamVR)? (sometimes there are problems with shader)
    - The Texture "Texture/Clouds.png" is used for the clouds, right? So I can change it?


    The free version runs fine, but I guess it's just a simple skybox cubemap without any dynamics ;-)
     
  3. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    160
    1. I'm not sure I understand what you mean by a depth-layered camera.
    2. I didn't test it personally, but it should work just fine. I know that the "Farland Skies - Low Poly" works fine for VR this skybox uses the same approach.
    3. Correct. The "Texture/Clouds.png" is used for the clouds and you can easily modify it. The blue color will be interpreted as sky and shades of red will be rendered as clouds.

    Btw, I have a great deal for you! I'll give you a free promo code for the PRO version of this skybox in exchange for:
    • honest review on the asset store
    • answers for your own questions here
    If you like this idea, just send a message to support@borodar.com ;)
     
  4. TS42

    TS42

    Joined:
    Nov 7, 2013
    Posts:
    13
    Alright, I send you an email.

    Here is a tutorial to setup a skybox in a second camera on another layer as the main camera:
     
  5. TS42

    TS42

    Joined:
    Nov 7, 2013
    Posts:
    13
    Hi again ;-)

    I'm done with testing and implementing the skybox in my project. It's a very nice asset and works very well.

    I have a few suggestions:

    #1
    Make SkyboxDayNightCycle._timeOfDay public serializeable and add a slider to SkyboxDayNightCycleEditor. I haven't found another option to tweak the time in editor mode and this just works fine. Editing the time with SceneManager has no effect in editor mode.

    #2
    Add an option to choose a moon phase <- link.

    #3
    Textract the settings from SkyboxController and SkyboxDayNightCycle and add create ScriptableObjects for each of them (unity video <- link). Or just add all missing options from SkyboxController to SkyboxDayNightCycle and create a ScriptableObject for it. Create an inspector view to create/edit/delete/<restore defaults> for the ScriptableObject and an option to serializise them in a file (loading). Add an option to set the settings (from the ScriptableObject) to SkyboxDayNightCycle and maybe a transition option. So with this we can create different colored skies and activate it live. -> I am doing everything in one scene and don't like to create 5, 6 or 10 different SkyboxDayNightCycle objects and activate the one I need.

    I know #3 is a big gamebreaker and maybe some more work, but it would improve the asset a lot.

    Thanks for the awesome asset :)
     
    AndBje and PhannGor like this.
  6. AndBje

    AndBje

    Joined:
    Jun 5, 2016
    Posts:
    15
    Excellent asset. Adds the feeling I was looking for. Kudos!

    Just one minor problem. I am not an expert with shaders but it seems like the skybox's shader can't draw shadows on my Android devices - even if I set the quality to Excellent. I know older devices can't handle realtime shadows, but with the standard shader my devices have no problem with directional lights. Am I missing something?

    Happy coding! / Anders
     
  7. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    160
    Skybox shader has nothing to do with the shadows by itself. However, the SkyboxController prefab has two directional lights for the sun and the moon out of the box, just for your convenience. You can easily disable or delete them if you don't need shadows in your project.

    CropperCapture[6].png

    Also, you can use your own directional lights for the sun and the moon, you just need to link them in corresponding sections of the SkyboxController.

    CropperCapture[7].png
     
  8. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    160
    In your case, if you don't have shadows at all, first check that corresponding directional lights are enabled in the scene hierarchy and linked in the SkyboxController. Also, if you're using SkyboxDayNightCycle prefab to manage your day-night cycle, then pay attention to the sun/mod DoT params, especially the light intensity:

    CropperCapture[8].png
     
  9. AndBje

    AndBje

    Joined:
    Jun 5, 2016
    Posts:
    15
    Thanks for your fast replies. It was my fault. I had included another model with a rather special custom shader which messed it all up. I simply changed the model to use the default shader and problem solved. Sorry to take up your time but you showed that the product support is great! You do never sleep... ;).
     
    PhannGor likes this.
  10. AndBje

    AndBje

    Joined:
    Jun 5, 2016
    Posts:
    15
    Hi again! In some of my scenes I use a top-down view and is actually not showing the skybox - but I need it to get the colors and lightning correctly. I can't say I have any performance problems, and maybe it doesn't change anything, but it would be nice if I could turn of the cloud animation as I can turn off stars.
     
  11. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    160
    Just set clouds rotation speed to zero. That's it :)

    CropperCapture[11].png
     
  12. AndBje

    AndBje

    Joined:
    Jun 5, 2016
    Posts:
    15
    Excellent :). / Anders
     
  13. GeekGonzo

    GeekGonzo

    Joined:
    Apr 27, 2014
    Posts:
    13
    Will this work with skybox ambient?
     
  14. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    160
    Do you mean if "Cloudy Crown Pro" does work as skybox ambient source? Sure it does!
     
  15. BarbzJr

    BarbzJr

    Joined:
    Sep 28, 2017
    Posts:
    1
    Hey, was wondering if you had any plan of adding in some more control into the "Skybox Day Night Cycle" script? I would love to see an additional column to the "Sky Dot Params" subtab, to control the equator color of the skybox, so that I could have control of a gradient through the sky, would be perfect for my current project and I'm sure it would come out much nicer than any "hacky" work around that I can come up with.
    So far though I've loved working with this skybox and its been one of the easiest solutions to making a nice aesthetic sky for all my projects.
     
  16. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    160
  17. john_hattan

    john_hattan

    Joined:
    Aug 28, 2013
    Posts:
    11
    Quick minor bug. When I first open Unity and load my project, I get the following errors. Looks like things aren't loading in the order that it wants them to.

    Capture.PNG

    Here's how I have it in the hierarchy. SunLight and MoonLight are disabled in the inspector.

    Capture1.PNG

    Note that it's working just fine. I just get this odd error when I first load the scene. My guess is that making SkyboxDayNightCycle a child of the controller is messing up the loading order. But if it's happening here, it might be happening for somebody else. Thanks!
     
    Astx likes this.
  18. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    160
    @john_hattan,

    Thanks for reporting this bug. Looks like something changed in latest versions of Unity regarding objects initialization order. Will take a look and try to fix it as soon as possible.
     
    Astx likes this.
  19. Astx

    Astx

    Joined:
    Apr 23, 2015
    Posts:
    9
    Near the same thing. Looks like it very “sensitive” where at hierarchy they placed. If you move them from root to any object as a child, you get error.
    And, please, can you advise, how i can totally uninstall package from scene. Removing prefarbs and change skybox to default doesn’t help for me. After start to play skybox reapplied back to Farland skies.
     
  20. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    160
    After quick look, I guess there is a possibility that OnValidate gets called before a scene is completely initialized. In our case, SkyboxController just doesn't exist at this point.

    Let's try one simple workaround for this situation and skip the first call of SkyboxDayNightCycle.OnValidate if a scene is not loaded yet.

    I've attached the modified version of the SkyboxDayNightCycle script. Just replace it in your project using Explorer/Finder to avoid changes in corresponding .meta file.
     

    Attached Files:

    Astx likes this.
  21. Astx

    Astx

    Joined:
    Apr 23, 2015
    Posts:
    9
    It's works for me! Thank You!
     
  22. john_hattan

    john_hattan

    Joined:
    Aug 28, 2013
    Posts:
    11
    Fixed it here too. Thanks!
     
  23. tcz8

    tcz8

    Joined:
    Aug 20, 2015
    Posts:
    367
    @PhannGor Hi I'm currently working on implementing that wonderful skybox in our game and could use a few pointers:

    1. The moon and sun don't play well with our post effects and I haven't been able to figure out where to adjust the corona. I tried changing the flare settings which helped with the white spot in the sun but what I want is to adjust the alpha and size of the corona so its transition is more subtle.

    upload_2019-12-15_14-26-53.png


    upload_2019-12-15_14-27-50.png

    2. Is there a way to set the cycle progress in edit mode and apply it? I'd rather not spend all my dev time in night mode :confused: Right now I added the code below to SkyboxCycleManager.cs but I'm wondering if it's the right way to do it.

    Code (CSharp):
    1. public bool updateNow;
    2.  
    3.         private void OnValidate() {
    4.             if (updateNow) {
    5.                 updateNow = false;
    6.                 Start();
    7.                 Update();
    8.             }
    9.         }
    3. I need a way to trigger weather changes. If you could modify things to use presets (ie.: for night and day), allows us to create new ones and add an API method to blend between them within a specified delay it would open up many possibilities. Like integrating your sky box to our own weather system.

    Thank you for your help!
     
    Last edited: Dec 15, 2019
  24. PhannGor

    PhannGor

    Joined:
    Feb 5, 2015
    Posts:
    160
    Hi @tcz8,

    1. The halo you're asking about is calculated right in the CloudyCrownSkybox.shader (lines 168-169)

    upload_2019-12-16_9-44-13.png

    To disable it completely, comment out those strings and put this one instead:

    upload_2019-12-16_9-43-50.png

    To adjust halo size, modify this coefficient:
    upload_2019-12-16_9-46-48.png

    Probably, you'll also need to modify sun and moon textures (CloudyCrown/Textures/Sun/Sun_CC_0*.png ) to remove sunbeams and similar things that are backed here.

    2. This is actually pretty simple. Use SkyboxCycleManager and adjust Cycle Progress value. This should have effect immediately in editor mode:

    upload_2019-12-16_9-54-58.png

    3. That's a good idea! Presets are in our roadmap and the use case you described for blending between them is really interesting. However, we cannot promise at this point when it will be implemented. It could take significant time...

    Thank you for your feedback and sharing your ideas with us!
     
unityunity