Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

[FREE] Cloud Shadows

Discussion in 'Assets and Asset Store' started by Tycho, Sep 26, 2016.

  1. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    ScreenshotTanks.png

    ScreenshotLayers.png

    ScreenshotEditor.png



    WebGL Demo | GitHub

    Adding animated cloud shadows is a quick, easy and effective way to breath extra life into any outdoor environment. This asset is perfectly suited for top-down strategy or city-building games, but also looks great from other viewpoints and in other type of games.

    Main Features:
    • Customization: The layer system enables you to customize the effect so that it matches the visual style of your project seamlessly
    • Editor preview: The cloud shadows are previewed inside the Unity scene editor, so tweaking is easy and straightforward
    • Easy to use: Includes several ready-to-use prefabs and full documentation
    • Performance: Designed with performance in mind, zero allocation during run-time
    • Open Source: Full source code is included
    Requirements:
    • The scene needs to contain a Directional Light which is used to simulate sunlight.
    • This directional light needs to be rendered in real-time, baked light maps are not supported for this light (other lights can still use light maps).
    • The rendering path must be set to either forward or deferred. Vertex lit is not supported.
    Supported platforms:
    • Desktop (PC, Mac, Linux)
    • Mobile
    • Virtual Reality

    Now open source and available for free on GitHub
    :
    https://github.com/EntroPi-Games/Unity-Cloud-Shadows/
     
    Last edited: Nov 13, 2020
  2. ruuben

    ruuben

    Joined:
    Nov 5, 2015
    Posts:
    11
    Great asset! The result in the scenes is remarkable and pretty easy to achieve

    Just one detail that will be very useful is a way to control de speed of the clouds. Since other assets have, I think is not a big deal.

    Thanks for your work!
     
  3. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Thanks for the positive feedback!

    You can control the speed of the clouds, by changing the velocity settings in each layer. Would you prefer having some sort of global speed multiplier?
     
  4. ruuben

    ruuben

    Joined:
    Nov 5, 2015
    Posts:
    11
    Thanks for the hint!

    BTW, I think will be great to have control over a global speed multiplier for scripting tasks.
     
  5. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Alright, I'll try to add that feature in the next update.
     
  6. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
  7. mgyanm

    mgyanm

    Joined:
    Jul 6, 2012
    Posts:
    9
    Great Plugin!!

    is this plugin support 2D?
     
  8. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    I've just tested the asset and it does work in 2D projects.

    The only requirement is that you use the Diffuse sprite material (Sprites/Diffuse) and that you use a directional light to light these sprites.

    Here's a screenshot of a simple test scene I made.

    Cloud-Shadows-2D-example.jpg
     
  9. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Version 1.1.0 is now available for download on the Asset Store: http://u3d.as/tJe

    Here's what new in this version:
    • Introduced new system for defining Cloud Layers using Scriptable Objects
    • Added Global Mutators for coverage, softness, speed and direction
    • Added Custom Editor script for all components
    • Added extra prefabs
    • Small shader fixes
     
  10. gizmo_rob

    gizmo_rob

    Joined:
    Feb 20, 2016
    Posts:
    11
    Hey! Great asset! Was super quick and easy to incorporate and has a nice amount of customisability, thanks!

    I have one concern, and it's most likely me doing something wrong, however the cloud shadows appear in areas that are shadowed from other assets, for example inside buildings etc. Am I missing a setting somewhere?

    Thanks
     
  11. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Hi, glad you like the asset.

    The effect should no appear in shadowed areas, but you need to make sure that the shadows strength of the Directional light is set to 1.

    If that does not resolve the issue, please post a screenshot if possible :)
     
  12. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    This asset is currently part of the "Biggest Sale Ever" on the Unity Asset Store, and can be bought for 30% off.

    Get it here while it's on sale: http://u3d.as/tJe
     
  13. OJDee

    OJDee

    Joined:
    Feb 11, 2014
    Posts:
    64
    Just to clarify, you mention in a previous post that shadow strength should be set to 1 on the directional light. I have a scene with shadow strength at 0.5 for all objects - 1 is pure black. Would I be able to keep this at 0.5 for existing scene and still use this asset..?

    Would expect all shadows to blend into one another, ie a tree shadow should not change intensity if the cloud shadow is cast on top.

    Thanks
     
  14. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    The cloud shadows are projected using light cookies, so they don't blend correctly with the actual shadows of the directional light, if the strength is lower than 1. You can change the global opacity of the cloud shadows to match the shadow strength, which will make the problem less visible.

    Ideally, the directional light shadow strength should be set to 1 and ambient light or indirect light should be used to prevent your shadows from being pure black. In reality, there is no such thing as a half strength shadow, either light is blocked or it's not :)
     
  15. RodMath

    RodMath

    Joined:
    Oct 21, 2014
    Posts:
    13
    Hi - loving this asset so far, but I am hoping it is possible to adjust the settings from scripts not just the editor?

    I want to randomly choose a few things on launch - e.g. direction - but I can't find a way to get access to the CloudShadows component. I've tried adding "using EntroPi" etc, but it can't find the namespace. Am I doing something wrong?

    Thanks.
     
  16. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Hi, glad you like the asset ;)

    Every setting can be changed at run-time from scripts. Here's a very basic example:

    Code (CSharp):
    1. using UnityEngine;
    2. using EntroPi;
    3.  
    4. public class Test : MonoBehaviour
    5. {
    6.     private CloudShadows m_CloudShadows;
    7.  
    8.     private void Start()
    9.     {
    10.         m_CloudShadows = FindObjectOfType<CloudShadows>();
    11.  
    12.         // Change global modifier
    13.         m_CloudShadows.OpacityMultiplier = 0.75f;
    14.        
    15.         // Change layer data.
    16.         m_CloudShadows.CloudLayers[0].Coverage = 0.5f;
    17.     }
    18. }
     
  17. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    391
    Now that this asset is on sale, I am interested to buy it. However, I have one serious question. AFAIK this asset uses Directional Light's cookie to display such effect, but it requires the light to be in one place, not movable, or else the cookies will move with it. As such, does this plugin fix this? Will it be possible to use this in a dynamic sky solution where directional light follows the player?
     
  18. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Moving a directional light has no effect, since it's position isn't used to calculate the lighting, just the direction / rotation.

    With this asset, you can rotate the directional light, to for example simulate day and night cycles.
     
  19. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    391
    So, does this really mean that clouds won't move when I'll move my directional light?
     
  20. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Sorry if I wasn't clear, if you move the directional light, the cloud shadows will move with it.

    But there's no good reason to move the directional light, since it's position is irrelevant to the lighting calculation, and so moving it will have no effect.
    So why does it need to follow your character?
     
  21. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    391
    Because I'm using a custom dynamic skybox solution that requires the directional light to be movable.
     
  22. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Okay, that's strange. Are you sure it's not just rotating the directional light instead of translating it?
     
  23. Kolyasisan

    Kolyasisan

    Joined:
    Feb 2, 2015
    Posts:
    391
    I am sure. I've been digging in it's core, it requires such manipulations in order to properly work.
     
  24. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Alright, in that case, this asset won't work properly in combination with the dynamic skybox solution you're using :/
     
    Kolyasisan likes this.
  25. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    185
    Hey, nice asset! I have a problem tho: as soon as I added Cloud Shadows script to my scene directional light the normal shadows are gone. Even during run-time if I enable Cloud Shadows component, normal shadows are back and they are gone when CS is re-enabled
     
  26. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Could you post a screenshot showing the problem?

    Are you using any custom or 3rd part shaders?
     
  27. slimshader

    slimshader

    Joined:
    Jun 11, 2013
    Posts:
    185
    Sure I use custom shaders, no Unity game runs on only Standard ;) Mesh shader should not affect shadow tho, right? Will post screenshot tomorrow but not sure how showing missing shadow can help.
     
  28. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Someone had a similar problem in the past and it was caused by custom shaders that didn't properly support light cookies. This asset works by rendering the cloud shadows into a render texture and assigning that texture to the directional light as a cookie.
     
  29. Ava42

    Ava42

    Joined:
    Aug 4, 2012
    Posts:
    32
  30. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Hi,

    I don't think it will be technically possible to add this feature, because the cloud shadows are rendered by setting a cookie on the directional light, and cookies don't support distance fades.

    Maybe you can add some fog to obscure the cloud shadows, or extend the shadows distance?
     
  31. wangPP55555

    wangPP55555

    Joined:
    Nov 16, 2018
    Posts:
    1
  32. enblomquist

    enblomquist

    Joined:
    Jul 25, 2012
    Posts:
    85
    Hi! Love this asset. There seems to be an issue with speed tree. It essentially turns off those shadows.
     
  33. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    My guess is that the shaders Speedtree uses do not support light cookies.

    Is there any option to use another material or shader for Speedtree?
     
  34. enblomquist

    enblomquist

    Joined:
    Jul 25, 2012
    Posts:
    85
    Unfortunately no. Is there any other way around this?
     
  35. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    You could try remapping the materials in the import settings of the speedtree asset: https://docs.unity3d.com/Manual/FBXImporter-Materials.html

    The only other option would be changing the shader so that it supports light cookies.
     
  36. enblomquist

    enblomquist

    Joined:
    Jul 25, 2012
    Posts:
    85
    What would I be looking for specifically from - say - the standard shader to bring over to the speedtree shader?
     
  37. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
  38. mangax

    mangax

    Joined:
    Jul 17, 2013
    Posts:
    333
    hello, is this package supports LWRP??

    thanks
     
  39. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    I haven't tested the asset with the LWRP yet, so I'm not a 100% sure.

    But since the asset uses the directional light's cookie to project the cloud textures and the LWRP supports a single light cookie support for the main light it should work in theory.
     
  40. bradshep

    bradshep

    Joined:
    Jan 5, 2014
    Posts:
    53
    I have been unsuccessful in my attempts to get the asset to work with LWRP out of the box. The shader does not appear to be supported in LWRP (at least that is what the script is telling me).
     
  41. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Yes, after doing some research,it seems the LWRP doesn't support custom shaders written for the default Render pipeline :(

    So until I can solve the issues with HDPR and LWRP, I'll add a mention on the store page that they're not supported.
     
    bradshep likes this.
  42. enblomquist

    enblomquist

    Joined:
    Jul 25, 2012
    Posts:
    85
    Hey again! Got the speedtrees working great - but I noticed that the shadows on the default toon shaders are disabled when I enable the clouds. This isn't an issue with the standard shader. Any ideas?

    Thanks!
     
  43. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Which toon shader are you using? Because there doesn't seem to be one included with Unity by default.
     
  44. enblomquist

    enblomquist

    Joined:
    Jul 25, 2012
    Posts:
    85
  45. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
  46. enblomquist

    enblomquist

    Joined:
    Jul 25, 2012
    Posts:
    85
    Okay cool - thanks!
     
  47. mick129

    mick129

    Joined:
    Jun 19, 2013
    Posts:
    228
  48. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Browsing through the Package Preview, it looks like the Fantasy Adventure Environment asset uses custom shaders for rendering the tree's foliage (FAE_Foliage.shader or FAE_TreeBillboard.shader). My guess is that their custom shader does not correctly support Unity's built-in light cookie feature, which the Cloud Shadows asset relies on.

    I would contact them and request them to correctly implement light cookies into all of their shaders.
     
  49. browne11

    browne11

    Joined:
    Apr 30, 2015
    Posts:
    128
    Hi, please send me a refund. I had no idea this works off of cookies. Unfortunately my project is way to deep to delve into fixing all my assets so they support directional lighting cookies. Aquas, Ram and some custom shaders do not work. Far too many issues to utilize this asset. Great asset, too bad this does not work with many other assets
    .
     
    Last edited: Oct 14, 2019
  50. Tycho

    Tycho

    Joined:
    Nov 24, 2012
    Posts:
    205
    Hi, to request a refund, please contact me through this website form and be sure to provide your Asset Store invoice number:

    http://www.entropi-games.com/unity-asset-store-support/