Search Unity

DeepSky Haze - Physically-Based Atmospheric Scattering [RELEASED]

Discussion in 'Assets and Asset Store' started by PiranLBB, Apr 25, 2016.

  1. justtime

    justtime

    Joined:
    Oct 6, 2013
    Posts:
    261
    Black screen in unity 5.4 after level loading
     
  2. pauldrummond

    pauldrummond

    Joined:
    Oct 30, 2014
    Posts:
    65
    Can Deep Sky Haze be used with the new Post Processing Stack in Unity 5.6? I'm trying to use it on the Mac with the Metal API but keep getting errors such as "Invalid Pass Number (X) for Graphics.Blit(Material "Hidden/DS_Haze" with 1 passes".

    Interestingly, it looks like the plan for the Post Processing Stack is to allow other effects to plug into it. This would be great because Deep Sky Haze is the best atmospheric effect I've seen so far.
     
    Last edited: Mar 11, 2017
  3. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,331
    Any update on VR support (including single pass)?
     
  4. pauldrummond

    pauldrummond

    Joined:
    Oct 30, 2014
    Posts:
    65
    Is DeepSky Haze still being worked on?
     
  5. henriqueam

    henriqueam

    Joined:
    Mar 30, 2017
    Posts:
    13
    Hello there, does anyone have any tips that would fit an Isometric camera? I have a terrain and 1 direction light but can't figure out a good set up since my camera is a bit up in a distance. So I thought of coming and ask the community if anyone has any suggestion for presets?
    Thank you
     
  6. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    434
    Hi Piran! I'm in love with DeepSky after experimenting with a number of other fog/atmospherics/crepuscular ray solutions. I love the way you have organized everything, and the zone controls are brilliant. Have you considered adding a "default zone" checkbox that would use a given zone as global base blend rather than checking it's bounding box? I'm currently manually transforming a base zone's position for an infinite world simulator, which works fine but could be more elegant.
     
  7. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    411
    Which shader should we use for particles?
     
  8. PiranLBB

    PiranLBB

    Joined:
    Apr 10, 2015
    Posts:
    32
    Hi everyone,

    Firstly, apologies for neglecting this thread. Feel free to email me directly ( piranlbb[at]gmail.com ) for a quick response if you have questions/support issues but I'll make sure to check this thread more often.

    DeepSky Haze is still very much in active development - I'm currently working towards version 2.0, which will take full advantage of shader model 5 and modern GPUs (as well as supporting the existing SM3 rendering path).

    @pauldrummond - Thanks for highlighting the issue with the post-processing stack/Metal, will look into that!

    @Aubrey-Falconer - A default checkbox is a good idea, the zones are actually designed to be 'moveable' so they can be attached to the camera for exactly your scenario, but that would be a good option to have if you don't want to do that :)

    @TJHeuvel-net - Under the Examples\Shaders folder there is ExampleParticle.shader which is the same as Unity's Particle Alpha Blend shader. This is fine for generic alpha blended effects, but is more an example of how to add DeepSky Haze support to any of the existing particle shaders if you want to use different ones. Check out the comments in the source along with the Transparent Shaders section of the user guide, or drop me a mail if you get stuck!

    Piran
     
  9. No0B25

    No0B25

    Joined:
    May 2, 2016
    Posts:
    67
    Hi!

    This is probably pretty specific, but we need to have seamless transitions from outdoors to indoors and as far as I understand the zone system, the zones would only switch between some predefined settings for the fog. This would mean that the player would see the fog fade out or move away when entering buildings, but we don't want fog to be visible inside there (or at least don't have the transition be visible).
    Is there any possibility (maybe in the near future) to have dense fog outside, but no fog inside?

    Greetings,
    Jan
     
  10. PiranLBB

    PiranLBB

    Joined:
    Apr 10, 2015
    Posts:
    32
    Hi there,

    Yeah the zones are intended to cover more general areas where a slow transition is more believeable (like for example the transition from the base of a mountain to the top). Cutting areas out of the fog is definitely an issue that I'd like to solve, but doing that in a way that's fast enough is problematic.

    I think for your use case you'll struggle to get a nice effect currently, and I while I'd like to have a solution eventually (and have a few ideas) I wouldn't want to promise anything at this stage I'm afraid.

    I hope you find something that works for you!
    Piran
     
    No0B25 likes this.
  11. masa045

    masa045

    Joined:
    Nov 22, 2016
    Posts:
    28
    Hi PiranLBB :)
    I'm interesting deepsky haze these day.
    I'm looking for fog image effect and watch youtube video
    that really impressing your asset.

    I'm ask few question about deepsky haze.
    I'm not good understanding your asset and somewhat misunderstanding
    sorry for that.

    1. I'm use time of day asset(unistorm)and suimono(ocean,river asset)now.
    is there any problem integrating these asset with deepsky haze ?
    these asset are a lot problem.
    especially transperancy and fog.
    I wonder how good sync with unistorm and deepsky haze?

    2. I try demo and toggle deepsky haze on and off then slightly change fps
    how about real situation ?
    is there any problem large world and a lot object around here.

    sorry for bad english.
    best regard;)
     
  12. PiranLBB

    PiranLBB

    Joined:
    Apr 10, 2015
    Posts:
    32
    @masa045 - Hi! When using a time of day system you can easily pass the time to DeepSky Haze to sync effects. You will have to disable Unistorm fog but everything else should work I think.
    Ocean assets are difficult to render properly with fog, so you will probably get the same issues unfortunately. DeepSky Haze does include transparent shaders and examples showing how to work with particles/transparent objects.

    The performance cost is more-or-less constant for the fog effects, so the number of objects/scene size doesn't matter. The number of volumetric lights will have an impact, but there are controls to fade them out over distance so you can tune them to fit your game. For reference, the main effect takes between 1 and 2 milliseconds to render (depending on graphics card).

    Kind regards,
    Piran
     
    masa045 likes this.
  13. masa045

    masa045

    Joined:
    Nov 22, 2016
    Posts:
    28
    Hi PiranLBB :)
    I'm really appriciate quick response.
    I getting understanding now.
    but I'm not understanding about ocean asset issue.
    it's mean change suimono shader or deepsky haze setting ?

    I'm also use ufps.
    ufps is 2 camera set up and is deepsky haze compatible ufps ?
    some image effect not good working ufps.

    best regard.
     
  14. PiranLBB

    PiranLBB

    Joined:
    Apr 10, 2015
    Posts:
    32
    Hi,

    If Suimono doesn't work well with existing transparent shaders/fog then it won't work well with DeepSky Haze unfortunately. You can test it using the Global Fog image effect from Unity's own Standard Assets package - if that works correctly then DeepSky Haze will also work :)

    I don't have uFPS but you shouldn't have any problems as long as DeepSky Haze is applied to the main camera (not the weapon camera).

    Hope that helps!
    Piran
     
  15. masa045

    masa045

    Joined:
    Nov 22, 2016
    Posts:
    28
    Hi,
    thank you for help me.
    I'm resolved all question.;)
    greeting
     
  16. wdw8903

    wdw8903

    Joined:
    Apr 2, 2015
    Posts:
    40
    Hello, will new version support MSAA and single-pass in VR? Both of them are very important function in VR, if new version will support will great, because I haven't find a perfect volumetric fog/lighting plugin for VR.
     
  17. PiranLBB

    PiranLBB

    Joined:
    Apr 10, 2015
    Posts:
    32
    Hi, it's unlikely I'll be supporting VR anytime soon. Volumetric effects are just still a bit too expensive to render, although it is something I'm keen to keep an eye on.

    MSAA will be supported though for Unity versions and platforms where that restriction was lifted (around version 5.5 I think?).
     
  18. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    434
    I just tested the latest Deepsky release in Unity 2017.1 b8, and everything appears to be functional other than each Zone variant's time-of-day curves not being editable in the inspector.

    Some quick testing in the DS_HazeZoneEditor script seems to indicate that Unity Editor CurveField controls don't return a new AnimationCurve value immediately, but instead maintain a reference to an AnimationCurve object who's value is updated after each OnInspectorGUI call has executed.

    For instance, the following code provides a functional curve editor - but the "pre" and "post" values printed are always the same. GUI curve manipulations result in the values changing between GUI() calls (post value != following pre value).
    Code (CSharp):
    1.  
    2. using UnityEngine;
    3. using UnityEditor;
    4.  
    5. [CustomEditor(typeof(test_script))]
    6. public class test_script_editor : Editor
    7. {
    8.     public override void OnInspectorGUI()
    9.     {
    10.         test_script t = (test_script) target;
    11.  
    12.         Debug.Log("pre: " + t.TestCurve.Evaluate(.5f));
    13.         t.TestCurve = EditorGUILayout.CurveField(t.TestCurve, Color.green, new Rect(0, 0, 1, 1));
    14.         Debug.Log("post: " + t.TestCurve.Evaluate(.5f));
    15.     }
    16. }
    Perhaps someone has a thought on how to fix zone variant curve editing for 2017.1?
     
    overthere likes this.
  19. PiranLBB

    PiranLBB

    Joined:
    Apr 10, 2015
    Posts:
    32
    Hi, yeah looks like CurveField isn't working properly in the beta. You can work around this by changing the editor to use just a standard PropertyField instead - so change this line in DS_HazeZoneEditor:

    Code (csharp):
    1. cvWeightProp.animationCurveValue = EditorGUILayout.CurveField(cvWeightProp.animationCurveValue, Color.green, new Rect(0, 0, 1, 1));
    to:

    Code (csharp):
    1. EditorGUILayout.PropertyField(cvWeightProp, GUIContent.none);
    Note this will lose the automatic clamping so you'll need to be extra careful about making sure your curves stay within the [0, 1] range!
     
    overthere likes this.
  20. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    434
    Thanks Piran. Back in business!
     
  21. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    411
    Is it possible to have deepsky rendered in reflectionprobes?
     
  22. PiranLBB

    PiranLBB

    Joined:
    Apr 10, 2015
    Posts:
    32
    Unfortunately there's no way to apply post-effects when reflection probes get rendered (either baked or realtime).
    You might be able to do it manually with a script that renders a cubemap from an offscreen camera with DeepSky on, and update the reflection probe yourself. I haven't tried that though and it would probably get quite expensive.
     
  23. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    I just updated DeepSky to the new version and I'm having some issues. I'm getting dark lines on my horizon. I've tried all sorts of things to remove this, but the only one that works is to apply Air to the skybox, and that just washes out the skybox to white.

    DeepSkyHaze_horizonIssue.JPG
     
  24. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    411
    Thanks for your quick reply!
     
  25. PiranLBB

    PiranLBB

    Joined:
    Apr 10, 2015
    Posts:
    32
    @Dorian-Dowse It looks like you're using linear rendering with MSAA? What's happening here is once the antialiasing resolve happens, the colour and depth values don't necessarily match anymore. So pixels in the skydome are receiving colour from the foreground etc. Unfortunately when Unity renders the camera depth texture it doesn't use a multi-sampled depth buffer, so there's no way of correctly blending sub-samples when calculating the atmosphere I'm afraid.

    If you're not using MSAA then let me know because that means something else is going wrong!
     
  26. Dorian-Dowse

    Dorian-Dowse

    Joined:
    Jun 2, 2016
    Posts:
    94
    I am using Forward with MSAA. I've tried various other combinations but Deepsky stops working on anything but Forward with x2 MSAA. I was using gamma but linear is the same.
     
    Last edited: Jul 12, 2017
  27. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    @PiranLBB Great asset, thank you, but we have one Problem. How should we setup deepsky haze when entering a building? It seems the effects are still shown. We don't want to disable deepsky haze completely because the effect should be still visible when looking out of a window.

    p.s. Is deepsky haze compatible with Time of Day?
     
    Last edited: Jul 12, 2017
  28. PiranLBB

    PiranLBB

    Joined:
    Apr 10, 2015
    Posts:
    32
    @Dorian-Dowse Wait is it not working at all in other modes? That's definitely a big issue, could you drop me an email at piranlbb[at]gmail.com and let me know which Unity version you're using and your graphics card. Also do you have any errors in the console at all?

    @silentneedle Handling interiors can be a bit tricky if you have dense fog, one thing you can try is using interior zones that push back the fog start distance as far as you can get away with. If the transition isn't too harsh it can work reasonably well.
    Time Of Day appear to work fine! :)
     
    silentneedle likes this.
  29. daggermouth

    daggermouth

    Joined:
    May 18, 2017
    Posts:
    2
    FYI - your store page link to the forum is broken and does not redirect you here.

    I answered my own original question digging a little more through the forum. This asset looks great and will be purchasing.
     
    Last edited: Jul 15, 2017
  30. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    838
    Hi there, using your asset to great effect in my projects! I have a question: Is this asset compatible with Unity 2017? Many thanks :)
     
  31. PiranLBB

    PiranLBB

    Joined:
    Apr 10, 2015
    Posts:
    32
    @khos - sorry I missed your post! Yes it is, there is an issue currently when importing into a blank project with MSAA enabled in the quality settings but it will be fixed in the next update.
     
  32. khos

    khos

    Joined:
    May 10, 2016
    Posts:
    838
    Thanks, I'm using it quite nicely in 2017:
    Capture.JPG

    Is MSAA related to anti aliasing, ?
     
    PiranLBB likes this.
  33. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,331
    Last edited: Sep 24, 2017
  34. iancomings

    iancomings

    Joined:
    Nov 5, 2017
    Posts:
    1
    I am having a hard time getting DeepSky Haze to work with Vulkan Renderer. Why is that? openGL is supported and are both APIs made by the same company?
     
  35. Grigarosh

    Grigarosh

    Joined:
    Nov 2, 2017
    Posts:
    4
    @iancomings bro, please share your solution or advice, keep our time ;)
     
  36. Emile-Swain

    Emile-Swain

    Joined:
    Jun 23, 2015
    Posts:
    15
    I'm using the Timelines Activation Track and it appears that deactivating the gameObject with the DS_Haze Zone (Script) doesn't in fact stop the Camera from rendering the effect. I've noticed this too in a scene generally, that setting the active state of the obeject doesn't stop it from rendering. Which by an all isn't actually a bad thing, because, setting the object off hides the Zone boundary boxes which is nice).

    I had two overlapping Camera paths using Cinemachine and didn't want the Zone to effect one of the camera shots. I got around it by fortunately shifting the zone. But figured it might be worth noting that it would be good to be able to control the active state of a zone in the timeline.

    Is there a way to do this i'm just missing?
     
  37. PiranLBB

    PiranLBB

    Joined:
    Apr 10, 2015
    Posts:
    32
    Hi @Emile-Swain - that's an interesting use-case, I haven't actually tried using Timeline myself yet. Zones aren't really intended to be turned off/on as they're just providing location info, actual rendering is all controlled by the View component on the camera (disabling that will turn off the effect).
    The Context Override on the View component is designed to allow you to use specific settings that override the Zones, and is intended for cutscenes, although that might not be flexible enough for your needs.

    I should look at integrating that with Timeline though, that's a good shout!
     
  38. Emile-Swain

    Emile-Swain

    Joined:
    Jun 23, 2015
    Posts:
    15
    Thats a good point. I could look at animating one of the values on the Zone script with an Animation track. I hadn't thought of that, and would probably work out of the box with Timeline.
     
  39. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,331
    How do I enable Screen Space Multiple Scattering?
     
  40. Artaani

    Artaani

    Joined:
    Aug 5, 2012
    Posts:
    404
    @PiranLBB
    Hello. This asset looks great!
    I am also interesting in using this asset for group of asteroids in space like in this comment
    https://forum.unity.com/threads/dee...eric-scattering-released.399591/#post-2627094


    Did you tested your asset in such situation?

    Also is this possible to create local fog which will be limited not only from above, but also from below too (in order to create fog in the asteroid belt.

    Something like that
    https://www.universetoday.com/wp-content/uploads/2014/03/spitzer-20061010-full.jpg


    Or that
    http://cdn.edgecast.steamstatic.com...00dea91fd7f9e23bb10526e9572a.jpg?t=1510242285



    Also I noticed small issue. The link on the this forum which on the Asset Store page is not working.
     
  41. PiranLBB

    PiranLBB

    Joined:
    Apr 10, 2015
    Posts:
    32
    @Artaani Hi, thanks for your interest - unfortunately it's not really designed for that kind of scenario so how well it works really depends on your scene setup. If you're making a big open space game then I suspect it won't be suitable.

    I hope you find something that works for you! :)
     
    Artaani likes this.
  42. Aubrey-Falconer

    Aubrey-Falconer

    Joined:
    Feb 13, 2008
    Posts:
    434
    I'm testing DS_Haze with Vulkan in a 2017.3.0f3 project running on Windows 10 with an Nvidia 1080 and all latest drivers installed.

    There is only one shader build error so far: "Shader error in 'Hidden/DS_Haze': 'tex2Dlod': no matching 2 parameter intrinsic function; Possible intrinsic functions are: tex2Dlod(sampler2D, float4|half4|min10float4|min16float4) at line 143 (on vulkan)"

    Has anyone here tried Vulkan, and possibly devised a fix?
     
  43. Elecman

    Elecman

    Joined:
    May 5, 2011
    Posts:
    1,331
    Do you have any plans to support Screen Space Multiple Scattering? The flog blurring gives a nice realistic effect.
     
  44. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    411
    Are there plans to support the upcoming HD renderpipeline?
     
  45. Sickscore

    Sickscore

    Joined:
    Nov 25, 2016
    Posts:
    12
    First of all, I really like DeepSky Haze! I tried several other assets, but this is by far the best solution for me.
    The only issue I'm having right now is, that I don't get it to work with Aquas.
    Sorry for hurting your eyes, I used a really prominent color to better highlight the haze :)



    I'm really no shader specialist, so this is a big problem for me to solve myself. Any ideas how to solve this?

    Best, Sickscore
     
  46. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,001
    Why this asset is no longer available in the asset store?

    Please developers! why are you doing this? why such a cool asset like this should do this? people buying your asset they use your asset in their games please don't do this with people who buying your assets!!!
     
  47. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    651
    According to his twitter account (posted May 4th) @PiranLBB doesn't find the time nor can bring up the effort (seen the Unity 2018 SRP) to continue the Deepsky haze development. A pity he didn't announce it in this forum though, I myself was waiting for an integration with Aquas (through mail) but seems this will also not happen. Sad to see such an outstanding asset disappear.
     
  48. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    183
  49. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,001
    As I know using SRP is a chose in the Unity 2018! Tell me if I'm wrong.
     
  50. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    651
    It is for sure, you don't have to convince me ;-) However it seems some asset store developers take this opportunity to bail out.