Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[RELEASED] Hx Volumetric Lighting

Discussion in 'Assets and Asset Store' started by Lexie, Aug 1, 2016.

  1. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Its hard to say what performance you can expect as it depends on the amount of pixels x lights that need to be calculated.

    A GT550M (guessing its an M series as its a laptop) Is a pretty low end GPU that's now 7 years old. I really don't think it would be be able to handle this effect even on the lowest settings.

    You could try setting the sample count to something extremely low and set the resolution to half (quarter is only faster if you're rendering a lot of lights). also turn off some of the advanced effects like density particles. But even then i think that GPU would only be able to handle 1 low quality realtime volumetric light.
     
  2. _eternal

    _eternal

    Joined:
    Nov 25, 2014
    Posts:
    303
    No worries, thanks for confirming. This isn't my main dev machine so I can see how it performs when I have access to my desktop again. Good to know I didn't have something set incorrectly.
     
  3. Marked

    Marked

    Joined:
    Feb 24, 2015
    Posts:
    32
    Hey Lexie!

    I was wondering if it was possible change the HxDensityVolume to other simple shapes with out changing the shader.

    Anyway great asset , thank you for making it !
     
  4. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    What shapes would you like? I can add them to my list.
     
  5. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Finally tracked down the issue with directional lights and cascades not calculating correctly in some situations.

    I've pushed another build to the asset store, should be live in a few days.
     
  6. pixelsplit

    pixelsplit

    Joined:
    Sep 16, 2013
    Posts:
    173
    I already told via e-mail but this might get lost in the shuffle. We can't build on Linux due to HX Volumetric Lights.
    Code (CSharp):
    1. 90187: [Unity] Assets/Plugins/HxVolumetricLighting/Scripts/HxVolumetricCamera.cs(202,94): error CS0103: The name `VRSettings' does not exist in the current context
    2. 90188: [Unity] (Filename: Assets/Plugins/HxVolumetricLighting/Scripts/HxVolumetricCamera.cs Line: 202)
    It seems like that "VRSettings" is not available on Linux, so we would need some sort of platform dependenent workaround here.
     
  7. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Thanks. so strange that unity doesn't include them...
     
  8. pixelsplit

    pixelsplit

    Joined:
    Sep 16, 2013
    Posts:
    173
    Yeah, i know :( Any ETA for a workaround?
     
  9. v3_matt

    v3_matt

    Joined:
    Aug 10, 2015
    Posts:
    8
    I love this plugin, it looks beautiful. However, we deployed an app to a client location where it was running on a kiosk for long days. We had a memory leak (3 Megabyte/second) with no perceivable source. I turned off this plugin, and the memory leak went away.

    So just FYI, there may be a big leak somewhere in this plugin. Hope it helps!
     
  10. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Do you have the newest version? a very old version had a memory leak due to a bug with unity 5 and command buffers. the newer versions should not have that issue.
     
  11. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Working on this today, Its only a couple lines of compiler tags. Ill send you a download link when its done.
     
  12. rsklnkv

    rsklnkv

    Joined:
    Sep 8, 2012
    Posts:
    62
    Hey

    Is there a way to use Fog without Light? We need to add extra fog during the night and as soon as I disable sun light all fog goes as well

    Thanks
     
  13. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Right now the ambient fog is calculated in the same pass as the directional light to speed things up.
    Ill add the ability for it to be calculated with no directional light active in an upcoming update.

    Edit: temporary solution would be to add a moon to your game or add a game object with a HxDummylight and hxVolumetricLight to your scene and set it up as a directional light and use that for ambient fog.

    The ambient fog uses the ambient light settings in unity or you can overload them in the volumetric camera script.
     
    Last edited: Feb 6, 2017
  14. magique

    magique

    Joined:
    May 2, 2014
    Posts:
    4,030
    Your information says that this works on consoles. Has it been verified to work on the Wii U?
     
  15. Sickscore

    Sickscore

    Joined:
    Nov 25, 2016
    Posts:
    12
    Hey,

    any ideas why I'm getting this error from "HxVolumetricLight.cs" script:
    Code (CSharp):
    1. The copied command buffer is in an intermediate state.
    2. UnityEngine.Light:RemoveAllCommandBuffers()
    3. HxVolumetricLight:ReleaseBuffer() (at Assets/Plugins/HxVolumetricLighting/Scripts/HxVolumetricLight.cs:201)
    4. HxVolumetricCamera:ReleaseLightBuffers() (at Assets/Plugins/HxVolumetricLighting/Scripts/HxVolumetricCamera.cs:1523)
    5. HxVolumetricCamera:OnRenderImage(RenderTexture, RenderTexture) (at Assets/Plugins/HxVolumetricLighting/Scripts/HxVolumetricCamera.cs:1158)
    Error line:
    Code (CSharp):
    1. myLight.RemoveAllCommandBuffers();
    Thanks in advance, cheers!

    EDIT:
    Demo is not working either :/

    EDIT 2:
    Nevermind, when I uncheck the "Shadows" option on the Hx light, the error is gone ;)
     
    Last edited: Feb 10, 2017
  16. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Hi man, I've download new version but now I can't find this section to remove!!!!! I need to remove this [ImageEffectOpaque] so then I can't place Hx camera script before my contrast effect to looks better.
     
    Last edited: Feb 11, 2017
  17. RavenTravelStudios

    RavenTravelStudios

    Joined:
    Oct 15, 2015
    Posts:
    100
    Hi guys, this is working with transparences too so it means i can actually use sprite diffuse shaders on plane/quad without any issue, right? I would make some spotlight from street lamps in a scenario. How many draw calls it does? And can i use it too to produce glowing light like shop neon signs? I already have a glow shader but i was wondering if i could use this one too.
     
  18. TeohRIK

    TeohRIK

    Joined:
    Jan 22, 2014
    Posts:
    106
    Hi, want to ask is it the shader that inside the BuiltIn-Replacement folder are use to replace the built in shader in the graphics scene. If so which shader is belong to which section, thanks!

     

    Attached Files:

  19. Deckard_89

    Deckard_89

    Joined:
    Feb 4, 2016
    Posts:
    315
    Hi, I have had to disable Temporal Sampling as I was getting a pretty bad "flicker" effect around my character when moving through the environment. Is the flickering just an unfortunate expected side effect of TS or is it conflicting with something?

    By the way this is a great volumetric lighting solution for a game engine - barely any impact on performance at all.
     
  20. Lesovoy

    Lesovoy

    Joined:
    Mar 18, 2016
    Posts:
    7
    Hi!!! I got to errors after compilling my project for WIN (Unity 5.3.3)


    Shader error in 'Hidden/TerrainEngine/BillboardTree': texlod not supported on this target at Assets/Plugins/HxVolumetricLighting/BuiltIn-Replacement/HxVolumetricCore.cginc(262) (on d3d9)

    Compiling Fragment program with VTRANSPARENCY_ON
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING

    and


    Shader error in 'Hidden/TerrainEngine/BillboardTree': texlod not supported on this target at Assets/Plugins/HxVolumetricLighting/BuiltIn-Replacement/HxVolumetricCore.cginc(262) (on d3d11_9x)

    Compiling Fragment program with VTRANSPARENCY_ON
    Platform defines: UNITY_NO_LINEAR_COLORSPACE UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF3

    Whats that? It doesnt seem to have any influase to my final exe, but its annoying. How to fix afterbuild error? THanks!
     
  21. Lesovoy

    Lesovoy

    Joined:
    Mar 18, 2016
    Posts:
    7
    Ok the solution was to add #pragma target 4.0 to volumetric billboard shader... If i only know that does that mean )
     
  22. Multithreaded_Games

    Multithreaded_Games

    Joined:
    Jul 6, 2015
    Posts:
    122
    Hi all, thinking about picking this up! I just wanted to see if anyone could confirm that it plays 'nicely' with the following assets:

    -Aquas Water
    -Azure[sky]
    -Beautify (can't imagine why it wouldn't)
    -RTP/Gaia (again, can't imagine why it wouldn't, but just wanted to check)

    Thanks!
     
  23. Koara92

    Koara92

    Joined:
    Nov 9, 2014
    Posts:
    100
    Hi there,

    Just saw this asset, and it looks great! I was just wondering, what is the garbage collection like in this asset? Any allocation during runtime, or is it all taken care of on startup?

    Thanks in advance!
     
  24. Marked

    Marked

    Joined:
    Feb 24, 2015
    Posts:
    32
    Sorry for a late replay ! It would be great to have a simple cylinder in our case. Thanks a lot !
     
  25. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    I'd have uses for a sphere as well.
     
  26. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
  27. RizingGames

    RizingGames

    Joined:
    Mar 3, 2017
    Posts:
    2
    Hey Lexie,

    Just brought this plugin which looks great. Sadly when running on PS4 DevKit the effect is not visable?
    Followed the documentation for set up but no luck at all?
    Any help would be majorly appreciated. Thank you!
     
  28. RizingGames

    RizingGames

    Joined:
    Mar 3, 2017
    Posts:
    2
    Just to follow up, the error is coming from the ApplyDirect script.
     
  29. TimNedvyga

    TimNedvyga

    Joined:
    May 18, 2015
    Posts:
    95
    Hi @Lexie

    Just bought your asset. Have a question.
    Will be possible to work volumetric lights with unity's new mixed lighting in 5.6?
     
  30. TimNedvyga

    TimNedvyga

    Joined:
    May 18, 2015
    Posts:
    95
    Got some troubles with shadows in Close Fit and no Cascades. I suppose HX VL reduces the shadowmap size, because shadows become blurry and buggy when I turn on Volumetric Lights.
    Could you fix it?

    I put test project in attachments. Try to turn off/on plugin on camera and play with shadow distance in quality settings.

    I'm using Unity 5.6b10 and HX Volumetric Lighting 1.2.0b
     

    Attached Files:

  31. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    507
    Please don't leave this cool volumetric lighting, my game depends on this asset now.
     
  32. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Just as a heads up:

    I've just spent about a day isolating an issue because our game, when built with Unity 5.5 crashes, while in Unity 5.4.3 everything was butter-smooth. Turns out it's the following combination (I used the scene from the examples in the package to test this ... after I figured out HxVolumetricLighting was involved in the crash):
    • HxVolumetricLighting (current version from the Unity Asset Store)
    • Unity 5.5 (I tried 5.5.2p1 and 5.5.2p2 ... and also Unity 5.6.0b11)
    • Graphics Jobs enabled
    • Single Pass (Fast) enabled
    • OpenVR (or maybe just VR in general, see below)
    It may be that this also happens when using the Oculus-SDK. I don't have an Oculus Rift attached to this machine, so when I use Oculus as Virtual Reality SDK, the crash does not occur - but I also don't have VR that way, so it's either "OpenVR" or "VR" in general, probably VR in general.

    Changing any of the above conditions makes the crash go away.

    Also tried 5.6.0b11. In that Unity version, I'm getting several errors:

    RendererUpdateManager only synchronizes renderers that are added to the scene, so AssertIsTransformInfoUpToDate can only be called on renderers that are added to the scene

    In order to call GetTransformInfoExpectUpToDate, RendererUpdateManager.UpdateAll must be called first.


    ... and it also crashes. So, 5.4.3 does not crash, 5.5.2p2 and 5.6.0b11 crash when the conditions outlined above are met.

    I can probably work around this in my project by disabling Graphics Jobs until this is fixed either on Unity's side or in HxVolumetricLighting. Will file a bug report with Unity but if there's a way to work around the issue in HxVolumetricLighting that would be quite awesome because we probably take quite a performance hit by disabling Graphics Jobs and the sooner we can enable it again, the better ... plus ... having a workaround in HxVolumetricLighting is likely to isolate it more for UT to fix whatever is wrong there.

    Just in case it's relevant: This is on a 980 Ti, GeForce Game Ready Driver V378.66, Intel i7-5820K, 3.30GHZ, 6 Cores, 12 logical processors.
     
  33. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    It looks like the last time Lexie was seen was February 8. SHe hasn't responded in a month, I hope SHe is ok.
     
  34. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
  35. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    Thank goodness, that's really weird that he seems to be ignoring this recent months support requests.
     
  36. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    Yeah... IDK. This isn't Hitbox's main project. It's something they developed for Spire, and it makes sense that Lexie's seemingly moved on to other aspects of Spire's lighting now that it's mostly working, but "not getting much new development" is not the same as "not checking the thread." IDK.
     
    Shodan0101 likes this.
  37. chiapet1021

    chiapet1021

    Joined:
    Jun 5, 2013
    Posts:
    605
    Lexie's also been pretty open about how much time/effort he has to spend supporting this asset, relative to the revenue it brings in. I can totally understand why he's focusing on Spire more and being less responsive on this thread, as I'm guessing new purchases are only trickling in at best, while support needs from existing customers continues to increase.
     
  38. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    Also it is sometimes the case that people rely on the 'email watched thread' functionality of the forum and its not that reliable.
     
    chiapet1021, hopeful and one_one like this.
  39. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    If you need support, use the dev's support email address.
     
  40. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Our company has been a bit busy getting a build of our game ready for GDC.
    Now that that's all over i can divert time back to looking over these issues.

    Sorry for being MIA. I really should have made a post.
     
    Last edited: Mar 9, 2017
    Crossway, Shodan0101 and brisingre like this.
  41. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    You are running an old version of the plug-in. If you download the newest version from the asset store that will fix your issue.


    The camera will add a new script to the camera called hxImageEffect, changing the order of this script will change when it renders. So you can place this above your contrast script so it renders first.

    no need to edit the scripts every time i update it now.
     
    Last edited: Mar 9, 2017
  42. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    The transparency support tries its best to composite transparent objects into the scene. It's not 100% accurate but looks convincing enough, it doesn't add anymore draw calls to your transparent objects. but it does cost a little more to render the data out. I've included some transparent shaders that work with the effect.
    you don't have to overide the shaders there. Instead in your material where you select what shader you need. change it to one in the hxvolumetric option in the drop down.


    You only need to do this if you use transparent shaders and have transparency support enabled on the hxVolumetricCamera.
     
  43. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    I'll add a cylinder and a sphere.

    Thanks for the bug report. I've had to create different version of all the shaders for different version of unity. looks like i missed something. I'll look over them again.
    It probably wont work with the water very well unless the water plugin supports opaque mode. but that would make the water not transparent which is something you probably don't want.

    My plan is to try and get the plug-in working with some of the bigger ocean/water plug-ins on the asset store. but its hard to find time.
    There should be no garbage during runtime.
    Thanks for the report. Ill have a look.
     
    brisingre likes this.
  44. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Looking into this now, Sorry for the wait.
     
  45. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Thanks for the detailed report. Ill see if i can do anything my end. Might be an issue of when I'm submitting the render jobs to the GPU.
     
  46. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Yes the effect around moving objects is a result of the temporal sampling. If you lower Feedback max to something lower like 0.3-0.5 and feedback min to something lower like 0.1 it will make the ghosting effect from moving objects less noticeable while still improving the effect. Temporal sampling is only really worth it if you have multiple lights. if you just have 1 then it can be more cost effective to just increase the sample count.
     
    Last edited: Mar 10, 2017
    Deckard_89 likes this.
  47. SilverStorm

    SilverStorm

    Joined:
    Aug 25, 2011
    Posts:
    712
    He's alive! Thank goodness, I can now put the purchase in my priority list. I am currently planning to purchase this water pack very soon, I have asked the developer if his built-in fog can be toggled on and off and if it is then custom integration might not be necessary, we will see....you wouldn't by any chance already know if it's compatible with it?

    https://www.assetstore.unity3d.com/en/#!/content/76960

     
  48. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    The issue is the volumetric pass uses the depth buffer to figure out how far away it needs to calculate the volumetric lighting. Because the ocean is transparent it doesn't write to the depth buffer. some ocean plug-ins have a opaque version that does write to the depth buffer, but then things like the rocks under the ocean in this image wouldn't show up.

    The only good way to make it compatible would be to render the oceans depth to the downsampled depth buffer that gets created during the volumetric pass. I could add the ability to do this pretty easily but the issue is i'd be copying one of their shaders to create one that renders the waves to the downsampled depth pass. It would be 99% their code so I wouldn't be able to distribute it. Each ocean package would need a custom shader as well.
     
  49. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646

    Looking into this it looks like an issue on unity's end. I'm seeing other reports of a similar issue with other people not using my plugin. My guess is doing any rendering that isn't getting done by a mesh renderer is causing issues with the unity's experimental render jobs. Not sure if i can do anything my end unfortunately.
     
  50. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,676
    Is it possible to supply the few lines of code that would be needed to adapt the water? Maybe have that in a DIY section of the docs.