Search Unity

[RELEASED] Hx Volumetric Lighting

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

  1. coaster_unity

    coaster_unity

    Joined:
    Feb 20, 2018
    Posts:
    9
    I have the same problem. I see the following error message with some of the HX shaders with Unity 2020.3 LTS:
    Code (CSharp):
    1. Hidden/HxVolumetricPointLight shader is not supported on this GPU (none of subshaders/fallbacks are suitable)
    The same applies for the projector and the spot light shader.
     
  2. SoyUnBonus

    SoyUnBonus

    Joined:
    Jan 19, 2015
    Posts:
    43
    Removing dx11 from exclude_renderers in HxVolumetricLightCore.cginc gets rid of the error, but the volumetrics don't work. I don't see any unsized arrays as the Comment before suggests...
     
  3. coaster_unity

    coaster_unity

    Joined:
    Feb 20, 2018
    Posts:
    9
    Removing the dx11 exclude helped fixing 2020.3 LTS problems on my system. I also initialized the variables as suggested in the previous "PS4 Fix" post.
     
  4. SoyUnBonus

    SoyUnBonus

    Joined:
    Jan 19, 2015
    Posts:
    43
    Does it work in your project correctly though? I removed the dx11 and did the ps4 fix but the volumetrics don't show at all in mine.
     
  5. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    It dit it for me as well in 2020LTS just removing the "dx11" keyword, did not need the PS4 fix.

    Did you manage to resolve your issue ?
     
  6. SoyUnBonus

    SoyUnBonus

    Joined:
    Jan 19, 2015
    Posts:
    43
    No but, to be fair, I didn't tried much more and reverted to 2019LTS. We already have our game out on Steam so we rather have it on a stable state for now. I hope we can try again later once we're out of Early Access.
     
    Whatever560 likes this.
  7. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Hey,
    Tried to reach you by email but it seems to not exist anymore so I try here.

    I´m a happy longtime user of you XC Volumetric Lighting package.
    I had to upgrade to Unity 2020.2 recently and now I get a compile error:

    Assets\Plugins\HxVolumetricLighting\Scripts\HxVolumetricCamera.cs(20,19): error CS0234: The type or namespace name 'VR' does not exist in the namespace 'UnityEngine' (are you missing an assembly reference?)

    I have read that Unity changes VR to XR at some point. So I already tried to replace that in the script: using UnityEngine.XR;
    But no success and I am no programmer by any means So I hope you could help me with this ?

    Thanks for your time !
     
  8. PierreGuinedor

    PierreGuinedor

    Joined:
    Jan 22, 2021
    Posts:
    1
    Hi,
    I faced the same problem as you today where the volumetric effects were not working anymore in Unity 2020.3.
    Here is my fix:

    1. Remove #pragma exclude_renderers d3d11 xbox360 gles line in HxVolumetricLightCore.cginc file to use d3d11
    2. In the OnRenderImage method of the HxVolumetricImageEffect.cs and HxVolumetricImageEffectOpaque.cs scripts, replace
    Graphics.Blit(VolumetricTexture, dest);
    by
    if (volumetricCamera == null)
    {
    Graphics.Blit(src, dest);
    }
    else
    {
    volumetricCamera.EventOnRenderImage(src, dest);
    }


    Hope it can help someone else,
    Pierre
     
  9. Burglebutt

    Burglebutt

    Joined:
    Jul 24, 2014
    Posts:
    51
    I am using Unity 2021.1.6f1 and it doesn't work. I can't find HxVolumetricLightCore.cginc btw. Anyone know of a fix?
     
  10. RickF

    RickF

    Joined:
    Sep 12, 2012
    Posts:
    33
    Also looking for a solution in 2021.1.6f1. Currently using just the built in render pipeline. HX Volumetrics appear broken. Either completely invisible, or causing "pink material" error where the volumes should be.

    Handful of errors looking similar to those above.
     

    Attached Files:

  11. Gua

    Gua

    Joined:
    Oct 29, 2012
    Posts:
    455
    I'm using 2018.4.5 but for some reason over righting max light distance for point light doesn't work.
     
  12. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Gua likes this.
  13. churi24

    churi24

    Joined:
    Sep 17, 2013
    Posts:
    98
    1- Put the file XRUtil.cs in this path: Assets/Plugins/HxVolumetricLighting
    Code (CSharp):
    1. using System;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEngine.XR;
    5. internal static class XRUtil
    6. {
    7.     public static bool isPresent()
    8.     {
    9.         var xrDisplaySubsystems = new List<XRDisplaySubsystem>();
    10.         SubsystemManager.GetInstances<XRDisplaySubsystem>(xrDisplaySubsystems);
    11.         foreach (var xrDisplay in xrDisplaySubsystems)
    12.         {
    13.             if (xrDisplay.running)
    14.             {
    15.                 return true;
    16.             }
    17.         }
    18.         return false;
    19.     }
    20. }
    2- Open to HxVolumetricCamera.cs
    2.1- Line 20 : using UnityEngine.VR; -> using UnityEngine.XR;
    2.2- Line 227: VRSettings.enabled && VRDevice.isPresent -> XRSettings.enabled && XRUtil.isPresent()
    2.3- Line 1151: VRSettings.enabled && VRDevice.isPresent -> XRSettings.enabled && XRUtil.isPresent()
    2.4- Line 1153: VRSettings.eyeTextureHeight -> XRSettings.eyeTextureHeight
    2.4- Line 1163: VRSettings.enabled && VRDevice.isPresent -> XRSettings.enabled && XRUtil.isPresent()
    2.5- Line 1165: VRSettings.eyeTextureWidth -> XRSettings.eyeTextureWidth
    2.6- Line 1165: VRSettings.renderScale -> XRSettings.eyeTextureResolutionScale
    2.7- Line 2071: VRSettings.enabled && VRDevice.isPresent -> XRSettings.enabled && XRUtil.isPresent()

    3- HXVolumetricLightCore.cginc
    Line 3 - #pragma exclude_renderers xbox360 gles //d3d11
     

    Attached Files:

  14. vertexx

    vertexx

    Joined:
    Mar 18, 2014
    Posts:
    379
    Looking to purchase something like this. Sort of pleased that this one is off the list! My God, what a disaster??
    Anyone with an alternative to Hx Volumetric Lighting, 2019lts upwards, hopefully an asset that doesn't require the work needed to get this one going! I hope you folk are getting some reward from your hard work on this asset!! You all certainly deserve it. I gather refunds are out of the question?!
     
    Shodan0101 likes this.
  15. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,687
    Aura 2?
     
  16. twitchfactor

    twitchfactor

    Joined:
    Mar 8, 2009
    Posts:
    356
    Somewhat, but not really. The performance hit is exponential, compared to HX Volumetric. Really annoyed about losing this one.
     
    Shodan0101, Crossway and hopeful like this.
  17. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579
    Still using HX, works with standard pipeline pretty well. (apart from inspector lag).
     
    hopeful likes this.
  18. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    509
    This is best volumetric lighting asset on the asset store I don't know why he left it to die.
     
    churi24, Shodan0101 and twitchfactor like this.
  19. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    How did you get it to work ? I´ve tried it with standard pipeline under unity 2020.x but only get compile errors.
     
  20. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    churi24, secondsight_ and SoyUnBonus like this.
  21. SoyUnBonus

    SoyUnBonus

    Joined:
    Jan 19, 2015
    Posts:
    43
    In case you didn't know, he worked on Dustforce, a great platformer released almost 10 years ago. They started working on their next game, and then they needed good lighting for Unity so he made this plugin in 2016... it's been a while.


    So he's probably working in other stuff now, judging by his twitter. I hope he's doing fine.
     
    Shodan0101 and Crossway like this.
  22. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579
    See the previous posts in this thread.
     
    secondsight_ likes this.
  23. twitchfactor

    twitchfactor

    Joined:
    Mar 8, 2009
    Posts:
    356
    It really was the best for volumetrics. Sure it didn't have a pretty icon-filled interface, but what good is a pretty interface if it does nothing but cycle through a handful of presets?

    Since I'm not a hobbyist and creating games is actually my livelihood, I don't like unsupported things in my project, so I unfortunately had to remove it. I'm currently testing Kronnect's Volumetric Lighting and I think it's probably the best substitute out there (for Standard pipeline).
     
    Shodan0101 and wetcircuit like this.
  24. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    I also bought Kronnect Volumetric Fog & Myst 2 to study a possible subtitute for the standard pipeline. My highest concern is to be able to work with transparent shaders such as RAM rive material or simply the default standard one.

    When I'll have bandwidth I'll give it a go. For the time being I'll keep with Hx.
     
    Shodan0101 likes this.
  25. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,687
    I don't think that's allowed, is it?
     
    wetcircuit and Crossway like this.
  26. glenneroo

    glenneroo

    Joined:
    Oct 27, 2016
    Posts:
    231
    IANAL but as long as you both bought the asset it should be ok I would think? But you would have to send it privately after he proves that that they actually bought it (copy of Unity receipt). I should think though that the changes posted by @churi24 should be sufficient at least for 2020.x... then again does anyone even have it working with 2021.1?
     
    Crossway likes this.
  27. churi24

    churi24

    Joined:
    Sep 17, 2013
    Posts:
    98
    In Unity2021 it also works. Just follow what I wrote there and it should work. I just downloaded Unity2021 to see if it works, and yes, it works.

    upload_2021-11-14_15-16-21.png
     
  28. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    509
    Why not? I bought this asset as soon as it was released but now he left the asset we have to help each other that can't be illegal. Same happened to me with SEGI :(
     
  29. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,687
    But SEGI was made open source, right? HX Lighting has not.
     
  30. dizzymediainc

    dizzymediainc

    Joined:
    Apr 6, 2014
    Posts:
    433
    I can confirm that the fix @churi24 mentioned does work for Unity 2020.3.7 :)
     
  31. dizzymediainc

    dizzymediainc

    Joined:
    Apr 6, 2014
    Posts:
    433
    It really is unfortunate that Hx was deprecated, it truly is the best volumetric lighting asset on the store, i've tried others and i cannot get the same look/feel as Hx provides.

    Please come back to us! :)
     
    churi24, ratking and SunnySunshine like this.
  32. CGDever

    CGDever

    Joined:
    Dec 17, 2014
    Posts:
    156
    "Please come back to us! :)"
    YES! I SUPPORT! It is a really cool asset, please back to us!
     
    twitchfactor likes this.
  33. iddqd

    iddqd

    Joined:
    Apr 14, 2012
    Posts:
    501
    SunnySunshine, churi24 and hopeful like this.
  34. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    509
    Performance is really bad I set resolution on half but it reduces frames from 420 to 140! That really bad can anyone optimize this asset?
     
  35. SoyUnBonus

    SoyUnBonus

    Joined:
    Jan 19, 2015
    Posts:
    43
    Volumetric Lighting is a VERY HEAVY postprocessing effect in terms of performance. I think that the asset works fairly well, but there's a point where you have to optimize your project rather than rely on the assets.

    Disable lights if they're far away from the camera, remove as many shadowcasters as you can or replace them with simple shadowcasting geometry, etc.

    Complaining is fine, but at some point you have to buckle up and work with what you have.
     
    Last edited: Feb 23, 2022
    Crossway likes this.
  36. SunnySunshine

    SunnySunshine

    Joined:
    May 18, 2009
    Posts:
    977
    I can confirm this works. Thank you so much. You saved us a lot of time!
     
    greene_tea92, churi24 and hopeful like this.
  37. pointcache

    pointcache

    Joined:
    Sep 22, 2012
    Posts:
    579
    Anyone fixed it failing to work in scene view?
     
    Gua likes this.
  38. Koogi-Krain

    Koogi-Krain

    Joined:
    Jun 17, 2014
    Posts:
    7
    Can anyone post the HXCamera.cs fix script on this forum. I trying to write that code but having trouble. Please n thankyou
     
  39. secondsight_

    secondsight_

    Joined:
    Mar 2, 2014
    Posts:
    163
    Seconded !
     
  40. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
    Replacement files for it to work on 2021 LTS thanks @SunnySunshine
    (Rename cging.txt extension to cginc, was not allowed otherwise)
     

    Attached Files:

  41. Whatever560

    Whatever560

    Joined:
    Jan 5, 2016
    Posts:
    519
  42. Ninja_Coder

    Ninja_Coder

    Joined:
    Dec 31, 2012
    Posts:
    5
    Thank you very much.
     
  43. dizzymediainc

    dizzymediainc

    Joined:
    Apr 6, 2014
    Posts:
    433
    Replacement files for Hx to work in Unity 2020.3.7 and up

    Contains:

    1. HxVolumetricCamera
    2. HxVolumetricLightCore.cginc
    3. VRPresent
     

    Attached Files:

  44. simpa975

    simpa975

    Joined:
    Feb 15, 2019
    Posts:
    9
    Does anyone know how to purchase this asset? Now when it's deprecated. I tried contacting them through their support email, but they won't respond... :(
     
  45. SoyUnBonus

    SoyUnBonus

    Joined:
    Jan 19, 2015
    Posts:
    43
    I don't think they intend to sell it anymore. They've moved on. Maintaining an asset like this is a lot of work and they might not have enough sales.
     
  46. churi24

    churi24

    Joined:
    Sep 17, 2013
    Posts:
    98
    In Unity2021 this error appeared.

    CreateAsset() should not be used to create a file of type 'prefab' - consider using AssetDatabase.ImportAsset() to import an existing 'prefab' file instead or change the file type to '*.asset'. This error will in a future release be changed to an exception. UnityEngine.StackTraceUtility:ExtractStackTrace () HxVolumetricShadersUsed:SetVolumetricValues (bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool) (at Assets/Plugins/HxVolumetricLighting/Scripts/HxVolumetricShadersUsed.cs:110) HxVolumetricCamera:SaveUsedShaderVarience () (at Assets/Plugins/HxVolumetricLighting/Scripts/HxVolumetricCamera.cs:2261) HxVolumetricCamera:OnDestroy () (at Assets/Plugins/HxVolumetricLighting/Scripts/HxVolumetricCamera.cs:2247)

    It can be fixed by modifying the following. Simply change the prefab extension to asset. You have to look for the class HxVolumetricShadersUsed which is a scriptableObject and inside modify these lines

    Line 105
    Code (CSharp):
    1. instance=AssetDatabase.LoadAssetAtPath("Assets/Plugins/HxVolumetricLighting/Resources/HxUsedShaders.asset", typeof(HxVolumetricShadersUsed)) as HxVolumetricShadersUsed;
    Line 110
    Code (CSharp):
    1. AssetDatabase.CreateAsset(instance, "Assets/Plugins/HxVolumetricLighting/Resources/HxUsedShaders.asset");
    Line 145
    Code (CSharp):
    1. instance=AssetDatabase.LoadAssetAtPath("Assets/Plugins/HxVolumetricLighting/Resources/HxUsedShaders.asset", typeof(HxVolumetricShadersUsed)) as HxVolumetricShadersUsed;
    Code (CSharp):
    1. AssetDatabase.CreateAsset(instance, "Assets/Plugins/HxVolumetricLighting/Resources/HxUsedShaders.asset");
    The file HxUsedShaders will look something like this:
     
    hopeful likes this.
  47. churi24

    churi24

    Joined:
    Sep 17, 2013
    Posts:
    98
    In Unity2021 this warning appeared.

    Serialization depth limit 10 exceeded at 'HxOctreeNode`1.Parent'. There may be an object composition cycle in one or more of your serialized classes.

    Serialization hierarchy:
    11: HxOctreeNode`1.Parent
    10: HxOctreeNode`1.Parent
    9: HxOctreeNode`1.Parent
    8: HxOctreeNode`1.Parent
    7: HxOctreeNode`1.Parent
    6: HxOctreeNode`1.Parent
    5: HxOctreeNode`1.Parent
    4: HxOctreeNode`1.Parent
    3: HxOctreeNode`1.Parent
    2: HxOctreeNode`1.Parent
    1: NodeObject.Node
    0: HxVolumetricLight.octreeNode


    This warning indicates that there may be a cyclic reference in your serialized classes, and the serialization depth limit has been exceeded.
    To fix this you can do this.
    - Open the class HxOctreeNode
    - Add this:
    Line 8
    Code (CSharp):
    1.   [System.NonSerialized] public HxOctreeNode<T> Parent = null;
    Line 37
    Code (CSharp):
    1.   [System.NonSerialized] public HxOctreeNode<T>[] Children = null;
     
    Ghat-Smith, hopeful and ratking like this.
  48. dizzymediainc

    dizzymediainc

    Joined:
    Apr 6, 2014
    Posts:
    433
    Does this fix the yellow Hx errors that display during runtime?
     
  49. churi24

    churi24

    Joined:
    Sep 17, 2013
    Posts:
    98
    Yes, it resolves some warnings.
     
    dizzymediainc likes this.
  50. rossetagotstoned

    rossetagotstoned

    Joined:
    Jan 12, 2020
    Posts:
    8
    Still no support for HDRP? It's not a preview anymore.