Search Unity

[RELEASED] Hx Volumetric Lighting

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

  1. tapawafo

    tapawafo

    Joined:
    Jul 25, 2016
    Posts:
    170
    I see, thanks for the clarification. So, for those using VR, is there a viable alternative to MSAA out there yet? (Sorry if this is off topic - I thought I remembered you saying you were working on a VR project so I'm curious.)
     
  2. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    If the volumetric lighting isn't super strong, you don't notice the aliasing, You can also mess with the blending values to make light leak over edges a little bit.
     
    tapawafo likes this.
  3. tryptic

    tryptic

    Joined:
    Nov 13, 2012
    Posts:
    55
    Hi, any ideas on the dual-camera double-rendering issue? (from this post & the next one with the example project). Thanks! :)
     
  4. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Ill have to convert the lights to render as full quads if your inside them to support a small far plan like this.
    I could also add a flag that the volumetric effect is only calculated on pixels that arn't the skybox. That way the second camera would only calculate the effect on the area of the screen that the arms take up.

    Will take a little while to change this, Ill add to my todo list.
     
  5. tryptic

    tryptic

    Joined:
    Nov 13, 2012
    Posts:
    55
    Thanks for taking the time to look into this! We appreciate it.
     
  6. Wothanar

    Wothanar

    Joined:
    Sep 2, 2016
    Posts:
    122
    Its all right was bad imported on my side THE PLUGIN ITS AWESOME good job!
     
    Last edited: Dec 1, 2017
  7. Black_Raptor

    Black_Raptor

    Joined:
    Nov 3, 2014
    Posts:
    181
    I fix my problem
     
    Last edited: Dec 7, 2017
  8. F4ARY

    F4ARY

    Joined:
    Mar 27, 2016
    Posts:
    1
    Hello, i just upgraded to unity 5.6 and this errore showed up :

    Severity Code Description Project File Line Suppression State
    Error CS0619 'VRSettings' is obsolete: 'VRSettings has been moved and renamed. Use UnityEngine.XR.XRSettings instead (UnityUpgradable)' Atric.CSharp.Plugins C:\Users\dsqd\Desktop\CARTELLO GIOCO\Atrick\Atric\Assets\Plugins\HxVolumetricLighting\Scripts\HxVolumetricCamera.cs 227 Active
     
  9. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646

    Unity should have upgraded your scripts, If you delete the plug-in and re import it, it will force unity to update the scripts so they become compatible with 5.6+
     
  10. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    Hello,

    I just purchased the plugin and it looks awesome! Good job, I'm pretty happy to start building content with it.
    I've a little problem with Windows Mixed Reality and Multi Pass rendering (Single pass is going to be supported very soon on this platform), some shafts are only rendered in the left eye. This is maybe it's only compatible with Single pass stereo?

    Regards,
     
  11. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    It only supports single pass rendering, Multi pass is too slow so I didn't implement it.
     
  12. demonixis

    demonixis

    Joined:
    Aug 20, 2013
    Posts:
    185
    OK, It's not a problem for the long term because we'll only support Singlepass Stereo too when it's ready. Thank you for your quick reply.
     
  13. imaginationrabbit

    imaginationrabbit

    Joined:
    Sep 23, 2013
    Posts:
    349
    Hello,

    My Hx Volumetric lights were working perfectly both at runtime and in the game window when working in the editor- for some reason now the volumetric lights only work in the editor- they disappear during runtime- the light still works but there is no volumetric light-

    For example- in the editor's game window


    Then if I press play the effect disappears


    I checked the demo scene that comes with the asset and its showing the same behavior-

    Are there any settings/things I should be checking to fix this? Would appreciate any tips- Thank you.

    FIXED: Deleted and re-imported the asset and now it is working correctly
     
    Last edited: Dec 12, 2017
    hopeful likes this.
  14. mons00n

    mons00n

    Joined:
    Sep 18, 2013
    Posts:
    304
    Has anyone on macOS had issues with this asset with 2017.3 and Metal? Something seems to be up with the shadows; here is an openGL vs Metal comparison.

    openGL:


    metal:
     
  15. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    check you have the latest version from the asset store, unity once again changed the way shadow maps are stored and sampled. should work with the newest version.
     
    mons00n likes this.
  16. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
  17. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    No, this uses unity's shadow maps to generate the volumetric lighting, It does not generate its own shadow maps, That looks like a combination of the bias on the light source being a little too high and really thin walls, Turning down the bias can help but will also introduce other issues, You could check out NGSS, they modified the shadow sampling unity uses, It might fix the issue for you (I haven't used it, So im not 100% sure, ask on the forums)
     
  18. boxhallowed

    boxhallowed

    Joined:
    Mar 31, 2015
    Posts:
    513
    I'll give it a shot, I tried tanking the bias, making the walls super thick, shoving stuff between the walls, everything. I've been through every available solution. I will check out NGSS.
     
  19. greengremline

    greengremline

    Joined:
    Sep 16, 2015
    Posts:
    183
    HX Volumetric lighting in the unity remake of SCP: Containment Breach:

     
  20. Eriks-indesign

    Eriks-indesign

    Joined:
    Aug 15, 2012
    Posts:
    50
    Would this work with unity's experimental real time area lights from the Adam demo? I really want to use it for the Neon challange :)
     
  21. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    I wont be adding support for them until they become officially supported by Unity.
     
  22. churi24

    churi24

    Joined:
    Sep 17, 2013
    Posts:
    98
    Hi, we are using HX and NGSS together and we are stuck in one problem..

    1)In this image you see HX Volumetric with Strength in ~0.25, which is the value our NGSS shadows needs, but it's not the volumetric shadows we need.


    2) In this other image you see HX Volumetric with Strength in 1, which is the value that HX Volumetric needs to generate the effect we want, (but not for our NGSS shadows because the fps down from 75 to 30)


    Our NGSS shadows should have the strength value at 0.3 and the HX Volumetric should have the Strength value at 1. We know that NGSS use the strength parameter to smooth the shadow so the question is, if there any way to solve this from HX Volumetric without using the strength parameter, to not affect NGSS shadows?
     
  23. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Check this box on the hxVolumetriLight script to use this value for the shadow strength instead.

     
    Shodan0101, wetcircuit and hopeful like this.
  24. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Flurgle, elbows, Lexie and 1 other person like this.
  25. olix4242

    olix4242

    Joined:
    Jul 21, 2013
    Posts:
    1,962
    Right now I have switched to Post Processing Stack V2, and I have found that Tonemapping doesn't influence HX Volumetric Lighting. It influences whole scene, but volumetrics colour remains constant in intensity and colour. This is a huge deal breaker. Is there anything that I can do about this?
     
  26. brisingre

    brisingre

    Joined:
    Nov 8, 2009
    Posts:
    277
    HXVL automatically adds two little dummy scripts to the camera: "Hx Volumetric Image Effect"
    and "HX Volumetric Image Effect Opaque". Try moving that script up and down on the camera -- where HXVL is applied before or after another post process effect depends on whether that script is before or after the other post process effect's script.You could also try using the Opaque version, I'm not totally sure what the difference is but I think it says in the HXVL docs somewhere.

    If that doesn't help, it might be a bug. I haven't personally used it with Post Processing Stack V2 I don't think.
     
  27. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Options.
    1)Use an external tonemapper that tonemaps after all image effects.

    2)In the advanced settings on the HXVolumetricCamera, Change the render order to ImageEffectOpaque to get it to render the effect before unity. Note: This will make the effect render before transparent objects.

    3)Ask unity why on earth they are tonemapping before image effects have rendered, then wait for V3 of the post processing stack...
     
    Rich_A, Anticleric, hopeful and 2 others like this.
  28. Eriks-indesign

    Eriks-indesign

    Joined:
    Aug 15, 2012
    Posts:
    50
    Any chance of making this work correctly together with SEGI? I'm experiencing the sun light bounce getting cancelled out when enabling Hx Volumetric Camera component :)
     
  29. Eriks-indesign

    Eriks-indesign

    Joined:
    Aug 15, 2012
    Posts:
    50
    Nevermind, I see it was your "Shadow Fix" feature that was doing it :)
     
  30. Mikekan13

    Mikekan13

    Joined:
    May 30, 2015
    Posts:
    90
    So no answer... I am guessing that is a no then?
     
  31. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Sorry missed this.

    It would require a bit of work to get it working. My issue with the lab renderer is its pretty outdated for a single pass forward renderer. Unity should be releasing their custom render loops soon that should super seed the labs renderer in terms of speed and functionality. So I'm hesitant to add support.
     
    chiapet1021, brisingre and one_one like this.
  32. Ruonan

    Ruonan

    Joined:
    Dec 6, 2012
    Posts:
    53
    Hey, Lexie

    HX has a problem with VR Multipass, we have to use it for TAA reason.
    It only render for eye. Can you fix this?
     
  33. Mikekan13

    Mikekan13

    Joined:
    May 30, 2015
    Posts:
    90
    Oh really? That is exciting. Do you have a link that mentions this?
     
  34. elbows

    elbows

    Joined:
    Nov 28, 2009
    Posts:
    2,502
    https://blogs.unity3d.com/2018/01/18/2018-and-graphics/

    https://github.com/Unity-Technologies/ScriptableRenderPipeline

    And various technical posts in the 2018.1 beta forum and graphics experimental previews forum.

    It will be easier to jump straight into this stuff when they update the unity launcher in a later 2018.1 beta to enable pipeline template selection when creating a new project.
     
  35. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    The effect is too slow with multipass rendering so it was never supported. It would limit VR to 1-2 lights at most. Single pass rendering cuts down the render cost a lot, which is needed to render volumetric lighting at such high resolutions needed for VR.
     
  36. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    Heya,
    somehow building my game (Windows) needs an hour now. After inspecting the Editor.log, it's apparent that there's a problem with this shader:

    Compiled shader 'Hidden/HxVolumetricPointLight' in 3111.07s
    d3d9 (total internal programs: 192, unique: 160)
    d3d11 (total internal programs: 256, unique: 192)
    So this single shader needs nearly 50 minutes to compile. I get a lot of errors, they look like this:
    errors_hx_shader.jpg

    What could be the problem (or rather: solution)?
     
  37. Karearea

    Karearea

    Joined:
    Sep 3, 2012
    Posts:
    386
    I've just shifted the OSX version of my project to Metal, and see this issue also. I'm using HxVL 1.3.0c, Unity 2017.3.0f3.

    It appears that Unity inverts something to do with the shadow maps on Metal; on OpenGL Core and DX11 everything looks correct, running Metal results in an exact inversion of the volumetric effect.
     
    Last edited: Jan 28, 2018
  38. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Looking into it, Should have a new build in a few days.
     
  39. greene_tea92

    greene_tea92

    Joined:
    Jun 26, 2017
    Posts:
    22
    I'm excited to see the power this tool has to offer, but it doesn't work out of the box for me. I've attached a picture of a live demo scene. I've followed the manual but alas, no luck. Any help would be appreciated.
     

    Attached Files:

  40. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    You have shadows disabled in your unity quality settings, Enabling that in the quality settings will allow shadow casting lights to work.
     
    glenneroo likes this.
  41. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    What could be the problem (or rather: solution)?[/QUOTE]
    Could you confirm you have the newest version from the asset store, Also what version of unity are you using. I've tried many versions of unity and I haven't been able to reproduce. My guess is your using an older version of the plug-in or one designed for older versions of unity.
     
  42. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    I think it was Unity 5.6.3, with the latest version of HxVL I could download with that Unity version.
     
  43. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    There seems to be a few issues with mac/linux support in 5.6.3. I'm looking into it now.
    I havent been able to recreate the bugs on my setups so its taking me longer then usual.

    I'm testing out on some new Mac's and other linux setups during this week.
     
  44. ratking

    ratking

    Joined:
    Feb 24, 2010
    Posts:
    350
    I don't use Mac or Linux, but Windows 10. I just made a blank project within Unity 5.6.3p1, didn't change anything, and imported HxVL, then built the example scene. The problem persists:

    Compiled shader 'Hidden/HxVolumetricPointLight' in 577.80s
    d3d9 (total internal programs: 2, unique: 2)
    d3d11 (total internal programs: 4, unique: 3)
    Shader error in 'Hidden/HxVolumetricPointLight': unable to unroll loop, loop does not appear to terminate in a timely manner (119 iterations) or unrolled loop is too large, use the [unroll(n)] attribute to force an exact higher number at line 278 (on d3d9)

    etc.
     
    Last edited: Feb 1, 2018
  45. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Thanks for the report. Looks like its a compiling issue with DX9 as DX11 works fine. Had to force unity into DX9 to find the bug. Will include a fix in the next update. For now you can disable DX9 support in the player settings under automatic graphics API.

    Or edit HxVolumetricPointLight and add
    #define UNITY_FAST_COHERENT_DYNAMIC_BRANCHING
    to the same spot all the other defines are (line 8-10) Put it on line 11 after the rest of them.

    Note: the above fix only works in unity 5.6+ for 5.5 you will need to wait for the update.
     
    Last edited: Feb 1, 2018
    ratking likes this.
  46. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    I've pushed a new build that fixes issues Mac with Metal and OpenGL and the newer macbooks.
    It also fixes some issues with DX9. 1.3.1 Should be live in a couple of days, If you need it sooner just send me a PM with invoice number.

    Thanks for every ones reports, took a while to track down the issues on Mac is my machine was old enough not to have them.

    I'm going to work on an update with a couple of features people have asked for. Hopefully have that ready in a couple of days. But for now those bug fixes should be good to go.
     
    Last edited: Feb 6, 2018
    Karearea, mons00n and Flurgle like this.
  47. TeohRIK

    TeohRIK

    Joined:
    Jan 22, 2014
    Posts:
    106
    Hi, after I updated latest version from asset store I getting this error. I using Unity 5.6.5 with NGSS plugin

    Shader error in 'Hidden/HxVolumetricPointLight': 'texCUBElod': no matching 2 parameter intrinsic function; Possible intrinsic functions are: texCUBElod(samplerCUBE, float4|half4|min10float4|min16float4) at line 156 (on d3d11)​

    Compiling Vertex program
    Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_NO_SCREENSPACE_SHADOWS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP UNITY_LIGHT_PROBE_PROXY_VOLUME​
     
  48. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    1.3.1 should be live in a couple of days. pm me and I can send you a download link. (You have PM disabled.)
     
    Flurgle likes this.
  49. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    hey @Lexie I have one directional light using noise (version1.3.1) works in the editor, but when I do a build the noise is not working
     
  50. Lexie

    Lexie

    Joined:
    Dec 7, 2012
    Posts:
    646
    Run the game once in the editor so it can build the list of shaders it needs for the game. Then it will build out fine. If you want to manually assign the shader used there is a prefab called HxUsedShaders. Make sure Noise it enabled on that object.
     
    hopeful likes this.