Search Unity

Volumetric Light Beam - Volumetric Lighting solution compatible with Mobile, VR and WebGL

Discussion in 'Assets and Asset Store' started by techsalad, Oct 9, 2017.

  1. GrassWhooper

    GrassWhooper

    Joined:
    Mar 25, 2016
    Posts:
    109
    thanks, that worked like magic, really glad to have found an asset for volu lighting, that supports multiple platforms properly.
     
    techsalad likes this.
  2. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Glad it worked, thanks for the feedback! Unfortunately the system to update assets in unity doesn’t work that well, so you have to do that sometimes.
    Do not hesitate to leave a review if you enjoy the plugin and it’s support: http://u3d.as/WQU
    Thanks!
     
  3. NeatWolf

    NeatWolf

    Joined:
    Sep 27, 2013
    Posts:
    924
    Hi there!
    Here to say that I finally published the last chapter of game I was working on, making heavy use of VLB:
    This asset from Tech Salad is now decorating "THE" Museum of Florence :)
    https://www.themedicigame.com/


    Yet, it's been a heck of a ride since the 4 months the Museum had available is nothing to produce a fully polished game of that importance, and the team was quite small, so the bitter reviews are, well, quite right about it being "rushed"
    (I'm still working on it btw)

    Unfortunately I wasn't allowed to put anyone extra in the credits... because of bureaucracy and of the client (3 clients, actually)

    I'm now beginning to tinker with Unity 2019.3, with that nice "make unselectable" feature in the Hierarchy Tab.

    My biggest complaint is actually that the spotlight meshes get in the way pretty constantly when doing some level design and clicking objects in the Scene View.
    Could you please add support for the 2019.3 feature, and/or put a global flag on the global options to make them unselectable in the Scene view? :)

    Support for point lights, as done in "Foggy Lights" on the store would be great! :)

    Thanks for everything! :)
     
    wetcircuit likes this.
  4. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    Hey @techsalad

    I'm in the process of upgrading my game to HDRP and I've noticed that the volumetric beams are now intersecting with the level geometry (see at the bottom of the stairs) does the blend feature not work in HDRP?

    intersection.jpg
     
    NeatWolf likes this.
  5. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Hi, yes this feature works with HDRP, but you have to follow these steps: http://saladgamer.com/vlb-doc/compatibility/#scriptable-render-pipelines
    Let me know if it works or if you need something else.
    Thanks

    (your screenshot looks awesome btw!)
     
  6. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Thank you very much for the news! Looks really great!
    No worries about the credits ;)
    About your suggestion, it's very interesting, I will look at it ASAP and let you know.
    Cheers
     
  7. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    thanks @techsalad

    I'm using 2019.3.0f3 HDRP(7.1.7) I decided to try a fresh HDRP stock scene just in-case their was something wrong in my scene, but it did the same thing, so then I decided to try it on a stock URP scene and it works (left URP, right HDRP)

    It don't look like it works in HDRP at least on the latest version, can you confirm thanks

    intersection.jpg
     
  8. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Thanks for the detailed feedback. I will give it a try.
    Do you have the issue happening in the editor or in exported build?
    What is your target platform?
    Are you running on Windows or Mac?
    Thanks
     
  9. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    Thanks

    Do you have the issue happening in the editor or in exported build? Editor, not in a position to try a build
    What is your target platform? PC
    Are you running on Windows or Mac? Windows
     
    techsalad likes this.
  10. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    I checked and you are right, depth sampling is broken with these versions. I have to investigate which update of the HDRP package broke it... Supporting SRP is really a huge pain.
    I'll let you know what I find.
    Sorry about the inconvenience.

    UPDATE:
    Hi @punk
    I found why it's broken. Basically Unity changed the HDRP code so the depth texture of the main camera now uses a texture array instead of a regular texture...
    I can send you a quick fix soon, because it will take a bit more time to fix it properly, since the depth texture is now stored differently with URP and HDRP, so I have to adapt the way I access it depending to the SRP in use.
    I'll send you the quick fix ASAP by PM.
    Thanks again for your patience.
     
    Last edited: Jan 7, 2020
  11. punk

    punk

    Joined:
    Jun 28, 2013
    Posts:
    408
    Thanks so much
     
  12. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    If you are encountering some issues with depth blending when using the plugin with the latest Unity version and HDRP package, I have a quick fix for you. Please get in touch with me so I could send it you.

    A proper fix will take a bit more time to be released, since the modifications done in the HDRP code require some refactoring on the plugin side, and a lot of testing!

    Thank you and sorry for the inconvenience.
     
  13. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    So I investigated to support these new "Scene visibility" flags to disable picking and or visibility in the scene view. Unfortunately, it's not possible. The VLB beams are procedurally generated and marked as "DontSave". And the "Scene visibility" feature only works for persistent objects. I really hope Unity will make this feature compatible for procedural objects too...
     
    Pourya-MDP likes this.
  14. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    Hi, I have a question about HDRP.
    HDRP now supports volumetric lights out of the box.
    So what is the benefit in using Volumetric Light Beam there then?

    Cheers!
     
  15. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Thank you for your interest and relevant question.

    The main purpose of the Volumetric Light Beam asset is to offer a simple and efficient way to have volumetric lighting across all platforms, including low performance ones. So the high end platforms (and so the HD Render Pipeline) are not the primary targets of this asset, which doesn't pretend to simulate realistic light propagation.

    So indeed, if you are looking to achieve photo-realistic sun light scattering through tree leaves, this asset wouldn't be the good choice and I would definitely recommend you to use the builtin volumetric lighting or other assets.

    However if you want to achieve more "game-y" effects, such as very obvious car lights or a flashlight, using this asset could bring some benefits. Also, using the HDRP solution, customizing a specific light could require to tweak some global lighting config, which could be tricky without changing the whole mood of your scene/game. In the opposite, each beam's properties are totally independent with this asset.

    In addition, since this asset is optimized to run on platforms such as mobile, it's very fast. I wouldn't pretend to compare it with the HDRP builtin solution performance-wise, but achieving this kind of more advanced effect could be quite performance intensive and not necessarily appropriate on games requiring very high framerate such as VR games.

    I hope these information were instructive and that you could figure out the best solution fitting with your needs.

    Cheers.
     
    Gooren likes this.
  16. Gooren

    Gooren

    Joined:
    Nov 20, 2015
    Posts:
    332
    Thank you for the quick, informative response :)
     
  17. iceb_

    iceb_

    Joined:
    Nov 10, 2015
    Posts:
    95
    hello! I am trying to get Volumetric Light Beam to work in 2019.3 with Opaque Geometry, but so far I can't seem to make it work. I'm trying to achieve a soft transition for the light beam next to opaque surfaces. Any ideas? thanks!

     
  18. AcuityCraig

    AcuityCraig

    Joined:
    Jun 24, 2019
    Posts:
    66
    @techsalad Will area/box lights be available in this asset anytime soon? I really need to do rectangular lights and would love to use this asset. Even if the shader was exposed so I could just apply it to my own mesh that would work too.

    Thanks!
     
  19. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Really sorry about the late reply, Unity's forum didn't send me any email alert about your post.
    It's supposed to work without any issues.
    What's you issue? Is the transition always "hard", even when changing the property?
    Have you try to open the demo scene? There is a place in which this feature is demonstrated. Does it work?
    prop_blend_geom_on.png

    Are you using the built-in render pipeline or a SRP?
    Try to update to the new 1.76 version, and please let me know.
    Thanks
     
  20. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Really sorry about the late reply, Unity's forum didn't send me any email alert about your post.
    Thank you for your interest.
    Unfortunately I don't have plans to release this feature soon.
    Since the release of SRP, most of my work has been is to maintain the support of this feature, which doesn't let me lot of time to develop box lights.
    FYI you can already create beams with only 4 sides by setting the custom sides property. I know it's far from perfect, but some users are using it to simulate box lights. Have you tried it?
    Thanks
     
  21. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    Nice looking asset, do you have any plans to support Cookies on spot lights? Also could you add adjustment to change the height/width of the cone so it could more closely fit an IES cookie on the spot light, or allow a custom mesh to be used?
     
  22. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Thank you :)

    Regarding the support of cookies, I have tried for months, and I still have a WIP branch, but it runs quite poorly and is not compatible with mobile devices. On top of that, supporting both the legacy render pipeline and SRP bring even more complexity to the mix. So I don't plan to support this feature in a near future.

    About the cone adjustments, I am not sure to understand what you mean. You can already customize the length of the beam and the truncated radius. What kind of other properties would you like to customize?

    And about custom meshes, no I don't plan to support this feature. The rendering quality is highly dependent of the normals of beam's mesh. And I would have no way to control them with custom mesh.

    Regards
     
  23. SpookyCat

    SpookyCat

    Joined:
    Jan 25, 2010
    Posts:
    3,762
    I guess it is possible to scale the beam object using the transform, I have IES data on my lights which means the spot lights arnt really circular but oval, so that could be done using scaling?
    The custom mesh would be a mesh provided by an artist, so I export the mesh generated by your asset and edit that in a 3d package or deform it procedurally, and then be able to use that mesh, so can i just set the sharedmesh value to use my own mesh in that case.
     
  24. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Yes you can scale the beam to make it look oval if you want.
    Regarding the custom mesh, I could investigate. I already deform it in the shader, so I think you won't be able to modify it procedurally. But it might be possible to provide a custom mesh made by an artist I guess.
    I'll let you know.
     
  25. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    Everytime i click in unity editor i select at first time volumetric lights instead of the object i want, there is any option, instead of disable all lights to prevent this behaviour?
    Best regards.
     
  26. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Hi,
    If you click at a position where a beam is located, yes it will select it. Otherwise it's not normal. Could you please record a video/gif of the behavior you are encountering so I could see exactly what's going on?
    Thanks
    TS


     
    IndieFist likes this.
  27. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    Yes, but i want to select other objects

    any option like hide items in scene window could be interesting
    In this video i want to select the vending machine and everytime i try it i get the volumetric light.

    When you make a Light Probe group you can disable it in Gizmos option to prevent be able to select by anymistake.
    An option to do somethign similar could be nice
    Apologies about my english.
     
    Last edited: Mar 15, 2020
  28. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Thanks for the info. I understand.

    Actually, since 2019.3, Unity has introduced a way to disable the picking of individual GameObjects directly in the hierarchy window. Unfortunately this only works with persistent objects, but the beams are transient since procedurally generated. I asked Unity to support this feature with transient GameObjects too, it should work in Unity 2020.2:
    Screenshot_55.png

    In the meantime, I can suggest you a workaround. Using the "Layers" drop down button at the top right corner of the editor, you can show/hide and/or lock layers.
    Screenshot_56.png

    But default, the beams' geometry are generated on the "TransparentFX" layer (this can be customized). So you could lock this layer: by doing so, it will disable picking when clicking on the beams. You can still select the beams by clicking the gizmo icon:
    mongif.gif

    Do you think this workaround could work for you?
    Thanks
     
    wetcircuit and IndieFist like this.
  29. IndieFist

    IndieFist

    Joined:
    Jul 18, 2013
    Posts:
    520
    THATS AWESOME!
    Thanks! its so easy with this solution.
    Best regards and thanks for support again!
     
    techsalad likes this.
  30. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Glad it works, thanks for the feedback!
    If you are satisfied with the asset and its support, please consider writing a short review on the assetstore, it helps a lot :)
     
  31. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Hi everyone,
    FYI, a new version 1.80 has just been released today.
    It adds a main new feature: a more advanced Dynamic Occlusion system supporting partial occlusion: Dynamic Occlusion Depth Buffer.
    In addition, the update includes a bunch of bug fixes, optimization, and better SRP support. Full changelog here.
    Cheers
    TS
     
  32. Rexoto-Games

    Rexoto-Games

    Joined:
    Jan 11, 2013
    Posts:
    41
    Just a heads up to delete the old dynamic occlusion script and its editor when updating to 1.80
     
    techsalad likes this.
  33. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    102
  34. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Hey, thanks for the info.
    You are right it should work now! That’s great news.
    Because of the current events I don’t have access to all my testing devices and so I can’t give it a try. But if you try, please let me know if the issue has been fixed by unity.
    Thanks
     
  35. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    102
    Hi TechSalad,

    I've just tested it, seems to behave exactly the same as before sadly. 2019.3.6f1
    It very much looks like it's a single pass stereo (double wide) rendering issue in the shader.
    reminds me of issues I had implementing a mirror shader. Same weird right eye offset. In the end it worked out with different methods in the shader code taking into account the double wide rendering method. (more info from unity here: https://docs.unity3d.com/Manual/SinglePassStereoRendering.html)

    I'll be happy to test some stuff quickly for you if you don't have access to hardware. Do you have a discord/teams/.. more instant messaging like platform where we can discuss and send around code/examples? if you're interested ofcourse.

    Thanks!
    Tom
     
  36. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Thanks for the feedback.
    I had a look and it appears that the issue has been fixed from Unity 2019.3.0, even I don't really understand the meaning of the line mentioning it in the release note:
    I had a look at your webpage, thanks about that. But from my understanding it's supposed to work out of the box when using the function ComputeScreenPos to compute the screen space position (and that's the function I use in the plugin). The function ComputeScreenPos is already doing this particular stereo offset handling in the UnityCG.inc file...

    Anyway, thank you very much for the offer, it's really appreciated! I will try some stuff on my side and send you some versions to test. I will contact you by PM if that's ok.

    Thanks
     
  37. Tom-Goethals

    Tom-Goethals

    Joined:
    Mar 6, 2015
    Posts:
    102
    feature request:
    Fall-off Attenuation could be expanded to have a "Start" and "End distance".
    The current "Start Distance" would then make more sense to be renamed to "End Distance"

    The screenshot should make clear why.. I rather not add another beam to avoid overdraw (mobile VR) but it does not look good if i can't fade the start distance.

    [EDIT: Nevermind, you can totally do that using the gradient color! Thx!]
     

    Attached Files:

    Last edited: Apr 8, 2020
  38. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Thanks for the suggestion.
    Indeed you can achieve this effect with a colo gradient, that's why this feature has never been a high priority to me :)
    But you are not the first to ask about it, and it would be probably easier to use with a dedicated property. I'll investigate.
    Thanks!
     
  39. ash4640

    ash4640

    Joined:
    Jan 19, 2018
    Posts:
    66
    I just purchased the asset and when I load it into 2019.3.5 and create a new light Volumetric beam, Unity crashes and exits.
    URP project, Other asset packages loaded into the project
    - Amplify shader
    - Octave 3D
    - Polaris v2
    - Optimizers
    - Nature Renderer
    - Bolt
    - Odin
    - Jupiter
    - Polaris
    - Poseidon
    and some VFX (projectile) packs
     
  40. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Thanks for your purchase and sorry for the issue you encounter.

    Before creating a beam, have you followed the specified steps to configure the plugin with URP? http://saladgamer.com/vlb-doc/compatibility/#scriptable-render-pipelines

    Does Unity stop crashing if you remove the Volumetric Light Beam asset (folder Assets/Plugins/VolumetricLightBeam)?

    When it crashes, can you share the Unity Editor logs with me please?

    Thank you :)
     
    Last edited: Apr 15, 2020
  41. ash4640

    ash4640

    Joined:
    Jan 19, 2018
    Posts:
    66
    hi thanks
    - yes now I have enabled depth texture and gpu instancing in urp, seems to work ok now.
    _ probably it was the bolt causing the issue, I reconfigured bolt again after reimporting vol lights, then now it seems to work fine.
    Till now no issues, just trying to play around with the output, it is really good
    can I set the unity's light animations (intensity color) to it, will it react the same way a spot light would react.
    Also is there a way to control the 3d noise (a texture? / noise map to control the pattern and speed).
     
    techsalad likes this.
  42. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Thank you very much for the feedback. I am really glad it works fine!

    Yes the light beam can be animated in real-time according to the changes made to the unity light. Just make sure to enable this property on the beam first: http://saladgamer.com/vlb-doc/comp-lightbeam/#track-changes-during-playtime

    Regarding the 3D noise, you can control how it repeats and its animation (speed and direction) globally (http://saladgamer.com/vlb-doc/config/#global-3d-noise) or per beam (http://saladgamer.com/vlb-doc/comp-lightbeam/#scale).
    The 3D texture used for the noise is specified in the config file (http://saladgamer.com/vlb-doc/config/#3d-noise-data-binary-file) and you can change it, but the plugin doesn’t offer an easy way to generate a new one.

    Hope it helps :)
     
    ash4640 likes this.
  43. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    145
    Hello and thanks for such a great asset
    I wonder How to change the intensity (or any parameter) on the fly?
    Thanks in advance
     
    techsalad likes this.
  44. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Hi and thank you for your message.
    Everything is explained here: http://saladgamer.com/vlb-doc/scripting-api/#modify-properties-during-playtime
    If you want to modify some properties from script, you can call the function UpdateAfterManualPropertyChange right after your changes.
    Otherwise just enable the track changes during playtime property: http://saladgamer.com/vlb-doc/comp-lightbeam/#track-changes-during-playtime
    Hope it helps :)
     
    Pourya-MDP likes this.
  45. Pourya-MDP

    Pourya-MDP

    Joined:
    May 18, 2017
    Posts:
    145
    So much thanks for the fast reply
    Will def dive into it!
     
    techsalad likes this.
  46. ash4640

    ash4640

    Joined:
    Jan 19, 2018
    Posts:
    66
    Errrr some issue happened with my project it crashes during runtime, so I removed Vol lights and it's working fine now, I also had one vfx pack using LWRP so was trouble shooting which was causing the issue, when both were on the scene everytime it crashed, once I removed the vfx pack and only vol light was left in the scene, the crash didn't happen often but it did happen a couple of times. My guess is since Vol lights uses particles and that there is some or the other issues with particle assets when used in unity 2019. The version I used was 2019.3.5 and URP 7.18, now have to go back to built in render if I need to use any particle fx.
    The edge of the spot light using vol lights is not blending it's very sharp and cut unlike in the demo videos, maybe I'm doing something wrong. Also request to please add more options for more volumes, more than just spot lights and hopefully it stays at this price as it's a reasonable price for indies like me. And this with more features has the potential to easily better the version two of A more famous light asset on the store as this already supports URP and HDRP. Hoping to see more options soon as this can just be just one goto asset for a project for lighting without depending on other assets.
     
  47. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Hi,

    Sorry to hear the issue you encountered. Would it be possible to share with me (using PM) your project, or maybe the VFX pack you mentioned so I could investigate what could cause the crashes? Also have you tried to upgrade to a higher (and hopefully more stable) version of Unity?

    Regarding the edges not blending properly with the geometry, since you are using LWRP/URP it's probably the missing "Depth Texture" option in the RenderPipelineAsset. Please follow these steps: http://saladgamer.com/vlb-doc/compatibility/#universal-urp-or-lightweight-lwrp-render-pipelines

    Thank you for your suggestions and kind words.
     
  48. ash4640

    ash4640

    Joined:
    Jan 19, 2018
    Posts:
    66
    Maybe I can do this, cause now I have my project running on URP without, I don't want to disturb it now, but I have upgraded to a new unity version 2019.3.7 and also have 2019.3.5 running, so I can try running both Vol lights and the VFX pack in both versions and regress it and test it.
    Yes I had already set the DepthTexture in URP properties.
     
  49. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380
    Yes please let me know how it goes. If the plugin can cause a crash, even with a specific combination of other assets, I want to fix it.
    Thanks
     
  50. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    380