Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Join us on Dec 8, 2022, between 7 am & 7 pm EST, in the DOTS Dev Blitz Day 2022 - Q&A forum, Discord, and Unity3D Subreddit to learn more about DOTS directly from the Unity Developers.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

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. simonkingandaoking

    simonkingandaoking

    Joined:
    Dec 27, 2021
    Posts:
    5
    i saw you said "volumetric shadows (which will be supported in a next update though"will this give the shadows i want,if so,when can i expect the update;)really like this plugin if i were to develop vr or andriod in the future,however im now working on a pc game socolumetric shadows is the key thing i want
     
  2. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hello,

    Thank you for your message.

    This asset is not designed to simulate sunlight because it only supports spotlights.

    In addition, like stated in the store page and the documentation, shadows are not supported in the current version.

    However, the version 2.0 will support true volumetric shadows (in addition to other cool features). I have a version almost final, if you are interested I could send you a version.

    Thank you
    TS
     
    DragonCoder and Lars-Steenhoff like this.
  3. simonkingandaoking

    simonkingandaoking

    Joined:
    Dec 27, 2021
    Posts:
    5
    yes,i would definitely love a version,how may i contect you,ah im so lucky,just bought your asset and you happens to bring up volumetric shadows!;);)Oh and why not make a discord server,would be a good place to chat
     
  4. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    I'll PM you on the forum :)
     
  5. simonkingandaoking

    simonkingandaoking

    Joined:
    Dec 27, 2021
    Posts:
    5
    ok,did you pm me,i havent used forum before,not sure what is where:oops:
     
  6. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,263
    Wow version 2.0 sounds very promising! looking forward to it
     
    techsalad likes this.
  7. simonkingandaoking

    simonkingandaoking

    Joined:
    Dec 27, 2021
    Posts:
    5
    its everything i wanted and more!A masterpiece,the quality is amazing,you must bring the update to evryone,then this asset will be the very best volumetric light in the store,i just love the thing!!!and it only cost me about 20 fps,380 to 360,which is nothing,i havent tested it on andriod,ill test it later,just love it,can up exactly when i needed it;);););)
     

    Attached Files:

    techsalad and Lars-Steenhoff like this.
  8. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hey,

    I investigated your issue and think I found the problem. You have to be careful with some of the beam's properties default properties which don't make sense with very tiny scaling like you did.

    I am especially thinking of the 2 properties representing "blending distances": camera and opaque geometry. These distances are NOT scaled accordingly with the GameObject's global scale (which is not mentioned, sorry about that, I will add the info in the documentation). The default values of these distances don't make sense when we speak of beams being 0.001 unit long. So you should set consistent values or disable the feature by setting 0.0:
    upload_2022-6-17_11-15-22.png

    Please try that and let me know if it solves your issue.

    I also noted that Unity doesn't seem to allow to set a camera near clipping plane smaller than 0.01. Be careful with that, since this clipping plane distance can be huge for objects with 0.001 unit width.

    Thanks
    TS
     
  9. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Thanks a lot for the feedback, I am super glad you like the new version :)
    I am looking forward to releasing it too, it just requires a bit of extra work!
    Thanks
    TS
     
  10. TsvetelinaStoyanova

    TsvetelinaStoyanova

    Joined:
    Oct 16, 2020
    Posts:
    7
    Hi, thank you for the idea. I changed the values, but it didn't work. But after that, I tried to set the scale of the GameObjects with the "Light" component to Vector3(1000f, 1000f, 1000f) and it worked! The light beams were just too small before, but if they are compensated this way, it works and they seem correct.

    Thanks and greetings,
    Tsveti
     
    techsalad likes this.
  11. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hey,

    Thanks for the feedback, I am glad you figured it out!

    The Unity Light are NOT modified by the scaling (which I always found strange btw), while the VolumetricLightBeam are.

    So yes, if you have a scaled 0.001 GameObject with a UnityLight + a beam, the UnityLight will keep a regular scale while the beam will be super tiny. So yes you can compensate the scaling like you did.

    I think it could be smart to add an option per VolumetricLightBeam to decide whether or not they are affected by scaling. In your use-case, you could disable the option so the beam would always fit with the unscaled Unity Light.

    Thanks
    TS
     
    TsvetelinaStoyanova likes this.
  12. rahebn

    rahebn

    Joined:
    Oct 30, 2012
    Posts:
    2
    Hi!
    I keep getting an error at random times when I press Play. The game won't start and I have to switch between scenes, and press Play a couple of times before the errors stop.

     
  13. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hello,

    Thanks for your message.

    That's weird, and since it looks like it asserts inside a Unity function (UnityEditor.AssetDatabase:Refresh), not sure I would be able to do something, but I can try.

    Could you please provide me the Unity version and Render Pipeline (built-in, URP or HDRP) you are using please?

    Thanks!
     
  14. rahebn

    rahebn

    Joined:
    Oct 30, 2012
    Posts:
    2
    Sure thing! Unity 2021.3.0f1, URP. It's an VR project, using OpenXR
     
  15. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Thanks for the info, I'll try to reproduce on my side.
     
  16. Magnatales

    Magnatales

    Joined:
    Aug 1, 2020
    Posts:
    3
    I cannot seem to make the Dynamic Occlusion Raycasting in 2D, at this point seems like a bug to me or I'm missing something really obvious

    My process:

    - Make light, add dynamic occlusion raycasting, and select 2D
    - Create a 2D object, put a 2D collider on the object

    It doesn't work

    What I've tried so far:

    Creating a different layer for the object
    Modifying every parameter in the dynamic occlusion raycasting

    My version: 2021.3.0f1
     
  17. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hello,
    Thank you for your message and sorry for the issue you have.
    I'll try to do it on my side and I will send you a scene/project by PM so you can have a look.
    This makes me thing I should add a sample scene featuring 2D beams like that in the plugin data, it would be very convenient.
    I'll keep you posted.
    Thank you
    TS
     
  18. pushingpandas

    pushingpandas

    Joined:
    Jan 12, 2013
    Posts:
    1,417
    Hello, how can I getcomponent the light via script? I want to make it flicker but its not recognized as <Light> in get.component
     
  19. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hello,

    The Volumetric Light Beam plugins is a new component, it's not the same than the built-in Unity light component. To get the Volumetric Light Beam component, you can get it using this script:
    Code (CSharp):
    1. GameObject myGAO = ...
    2. var myBeam = myGAO.AddComponent<VLB.VolumetricLightBeam>();
    More info here: http://saladgamer.com/vlb-doc/scripting-api/

    Btw, if you want to make your Light flicker, the plugin offers 2 convenient scripts to do just that. More info here: http://saladgamer.com/vlb-doc/comp-effect-flicker/

    I hope it helps, do not hesitate if you have more questions.
    Thanks!
    TS
     
  20. Nirvan

    Nirvan

    Joined:
    Nov 16, 2013
    Posts:
    118
    Only one thing I'm missing in the plugin is making soft start area when using truncated radius.
    I did it by myself but I hope seeing something like this in some official update ;)
    I attaching gif to show what exactly I mean.
     

    Attached Files:

    techsalad likes this.
  21. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Thank you for the feedback, it’s very valuable to me.

    I was wondering how you did achieve what you wanted. Because I would say it would be doable using gradient color mode and playing with the alpha, even if I admit it’s not the most convenient and user friendly.
     
  22. Nirvan

    Nirvan

    Joined:
    Nov 16, 2013
    Posts:
    118
    I added new argument in ShaderUtils.cginc in ComputeAttenuation(args..., float softStart)
    added line before 'return'
    float softStartMul = invLerpClamped(0, softStart, pixDistZ);
    and multiplied return with softStartMul
    Then added parameter to be controllable through inspector window.

    It's not perfect, since at value 0 it's still soft start but it's all I need :D
     
    techsalad likes this.
  23. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Thank you for the information.
    I am glad you were able to modify the plugin to your convenience, that's why keeping the plugin's source open is important!
    I will definitely consider adding this feature in a future update :)
    Cheers!
     
    Nirvan likes this.
  24. EricFFG

    EricFFG

    Joined:
    May 10, 2021
    Posts:
    85
    Hey
    This asset does a "find object of type" which is terrible for performance, probably even multiple times per light
    This makes randomization of our scene take a full minute. Going through thousands or tens of thousands of objects for some slight convenience is not good practice.


    How can we fix this on our end? I assume it tries to find the dust etc add-ons
     
  25. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hello,

    Thank you for the report.

    The asset doesn't call any function like FindObject(s)OfType (except when using very specific and scoped editor actions).

    However, it calls Resources.Load multiple times in editor to make sure to always use the proper configuration asset (it calls it only once when playing or when in standalone build). I guess this call could end up pretty expensive when having a huge amount of resources. I'll send you a custom version with a workaround, please let me know if it helps.

    Thanks
    TS
     
  26. MysleyMakers

    MysleyMakers

    Joined:
    Jul 27, 2021
    Posts:
    30
    Hi there, loving Volumetric Light Beam so far.

    I am using its Effect Flicker component for immersion purposes, but it seems that after the lights' stopped flickering, it does not go back into its original intensity. How do I make it so that it does?
     
    techsalad likes this.
  27. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hello and thanks!

    It doesn't work if you enable this property on the flicker component? http://saladgamer.com/vlb-doc/comp-effect-flicker/#restore-base-intensity

    Thank you
     
  28. MysleyMakers

    MysleyMakers

    Joined:
    Jul 27, 2021
    Posts:
    30
  29. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Ok.
    What do you mean by "after the lights' stopped flickering"?
    How do you make them stop flicker?
    If you stop the playmode in the editor, the light intensity goes back to normal right?
    Thanks
     
  30. MysleyMakers

    MysleyMakers

    Joined:
    Jul 27, 2021
    Posts:
    30
    I mean it stopped like, it's performing pauses like I told it to. I don't tamper with their components so everything is done by your scripts only.

    The intensity goes back to the original if I disable the Effect Flicker component or exit playmode. I want it to go back to the original during the pause.
     
  31. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Ok I got it.
    I designed it like that. But if you want I can simply add an option to restore the original intensity during the pauses.
    I'll cook you a custom version for you, I'll keep you posted.
    Thanks
     
    MysleyMakers likes this.
  32. binster

    binster

    Joined:
    Oct 16, 2012
    Posts:
    13
    Hi, in the API it says that to disable the light beam you need to disable the light beam script. This doesn't seem to work for me - the scripts says that it is disabled, but the beam remains visible. Is this a known situation, and have I done something in the inspector to cause this?
     
  33. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hello
    That's weird, because the beam is supposed to be not rendered when the component is disabled. I'll test on my side.
    In the meantime, have you tried to set the Game object inactive? This should work.

    EDIT: I checked and I found the problem. There is a bug in the plugin when the "fade out" feature is enabled: you are right, in this case disabling, the component at runtime doesn't hide the beam.
    I'll fix it and send you a custom version ASAP.
    In the meantime, you can disable simply the GameObject, it will do the job.
    Sorry about that!

    Thanks
    TS
     
    Last edited: Aug 13, 2022
    EpicMcDude likes this.
  34. binster

    binster

    Joined:
    Oct 16, 2012
    Posts:
    13
    Glad I could help with finding a bug for you, thanks for fixing :)
     
    techsalad likes this.
  35. EpicMcDude

    EpicMcDude

    Joined:
    Apr 15, 2013
    Posts:
    79
    Hey techsalad,

    Is there a way to recreate rectangular or other volumetric shapes with the asset? And to extend the bottom part of the mesh outwards? Currently it looks like this, from the front or behind it looks ugly as you can see the mesh cutting off. From the side it looks fine.
    upload_2022-8-23_1-56-28.png

    Trying to use this asset to make something like the fake volumetric effects below, do you think it's possible?
     
  36. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hello,

    Thank you for your message!

    It's possible to have squared beams by using a custom mesh with 4 sides.
    In your beam, switch the "Mesh Type" property to Custom and then adjust the "sides count" property to 4: http://saladgamer.com/vlb-doc/comp-lightbeam/#mesh-type

    However, I have to admit that it's not ideal: for example to have rectangle beams, you'll have to play with the scaling. The plugin has been designed to handle cone light beams in priority.
    I would like to improve the support of this kind of shapes, but right now it's not a high priority TBH.

    What do you mean by "extend the bottom part of the mesh outwards"? I am not sure to follow you on this question.

    Thanks
    TS
     
    EpicMcDude likes this.
  37. EpicMcDude

    EpicMcDude

    Joined:
    Apr 15, 2013
    Posts:
    79
    Fair enough, I guess I'm just trying to do something the asset wasn't designed for.
    With extruding the bottom part of the rectangular mesh, I just meant for example extruding the bottom vertices of the mesh outwards, so one goes left, the other vertex goes right.

    I have another question, is it possible to have the beam fade out when the player gets too close? For example, if I am less then 2 meters to the volumetric beam, the beam will start to fade out as I get closer. It's basically what you did in the recent update, but in reverse as that option fades the beam in as you get closer.
     
  38. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hello,

    The FadeOut feature included in the plugin allows you to fade out beams when they are located further away a specific distance from the camera.
    But there is no "out of the box" solution to do the reverse like you ask.

    However, it would be very easy to implement it through another component.
    TBH, I regret the way I implemented the FadeOut feature in the current version of the plugin. It shouldn't be directly on the VolumetricLightBeam component, it would have been better to handle it through another component, so I could add more ways to customize it. I am currently working on polishing the rewrite of the plugin for the release of the version 2.0, and the new implementation won't have a FadeOut feature implemented directly in the main component. I was planning to have a new component. And I am saying all this because it would be the chance to add the possibility to fade out beams when they are close to the camera, like your would like.

    I could start working on a 1st draft and keep you posted when I'll have something to share, if that's fine with you.

    TS
     
    EpicMcDude likes this.
  39. jakerr21

    jakerr21

    Joined:
    Apr 29, 2020
    Posts:
    3
    Hi I'm working on VR project for Oculus Quest 2 and am getting some strange jagged edges where the light beam collides with surfaces. Has anyone else come into this issue? Does anyone have any settings recommendations I should be using to fix this? They all look fine running through the editor.
    QuestBuild2.jpg QuestBuild1.jpg
     
  40. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hello,

    Sorry for the issue you have, I’ll do my best to help you.

    It looks like an issue with the depth buffer, because the plugin uses it to blend the beams with the geometry where they collide. Can you validate that by setting the “camera soft intersection blending distance” at 0 on your beam and checking the artifacts are gone? (http://saladgamer.com/vlb-doc/comp-lightbeam/#camera)

    To help you I would need more info about your configuration please:
    - unity version
    - plugin version
    - render pipeline (built in, URP, HDRP)
    - vr stereo rendering mode on the quest (multi pass or multi view) http://saladgamer.com/vlb-doc/virtual-reality/
    - are you running your game natively on the quest, or on the pc to the headset via oculus link?

    Thank you
    TS
     
  41. jakerr21

    jakerr21

    Joined:
    Apr 29, 2020
    Posts:
    3
    Wow thank you for the fast response!

    After setting Camera to 0 in Soft Intersections Bending Distances there were still artifacts.

    I am currently running:
    Unity Version 2019.4.37f1
    Plugin version 1990
    Built in render pipeline
    I've tried both multipass and single pass with the same result

    When ran through the editor play mode on the headset through oculus link it looks fine.
    When ran through the headset natively with new install it has the artifacts.
    I've included my settings here:

    config.PNG vlbsettings.PNG
     
  42. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Thank you.
    I'll try to reproduce in my side.
    Do you think it would be possible to send me your project by PM? If you prefer you can remove all the assets that don't appear in the simple scene we see in your screenshots.
    Thanks!
     
  43. jakerr21

    jakerr21

    Joined:
    Apr 29, 2020
    Posts:
    3
    Appreciate the help!
    I'll try and see if I can get everything simplified and working for you. I'll send you a PM most likely tomorrow.
     
    techsalad likes this.
  44. TsvetelinaStoyanova

    TsvetelinaStoyanova

    Joined:
    Oct 16, 2020
    Posts:
    7
    Hi, is there any progress with the light cookies?
     
  45. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hello,
    Thanks for your interest.
    Yes it's almost final. Would you like to get a version to give it a try?
    Thank you
     
  46. TsvetelinaStoyanova

    TsvetelinaStoyanova

    Joined:
    Oct 16, 2020
    Posts:
    7
    Hi,
    I would really love to try it!
    We released the first version of the lights in our app two months ago, and the users are crazy about the volumetric light beams. Currently, we're working on importing cookies and .ies files.
    The light beams with cookies will really bring the app to the next level!

    Best wishes for you and thanks for your insane library!
     
    techsalad likes this.
  47. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Great, let me prepare a version for you, I'll send it to you by PM.
     
    TsvetelinaStoyanova likes this.
  48. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    346
    Hello guys,

    I am super excited to announce the release of Volumetric Light Beam 2.0, the result of months of work.



    This new version offers 2 different Volumetric Light Beam implementations, each one optimized for specific use-cases:
    • SD Beams (legacy beams) are super fast with limited features (no true volumetric shadow nor cookie support): they are optimized to run on mobile and standalone VR (Oculus Quest).
    • HD Beams offer more advanced features (true volumetric shadow & cookie) but are heavier on performance: they should be used only on high-end platforms (PC & consoles).
    With the HD Beams, you can achieve really cool effects with Volumetric Shadows and Volumetric Cookies:
    ScreenShadows.png

    And the best part: this new rewrite doesn't come as a new paid package nor as a paid upgrade. It's a free update for any VLB 1 users!
    Please note that the price will increase a bit after the holiday sales period, so be sure to grab discounted before!

    I sincerely hope you will like this new update and all the work put in it. If you do, please consider writing a short review on the store, it would be very appreciated! http://u3d.as/WQU#reviews

    Thank you
    TS
     
    zIyaGtVm, Zarkow, adamgolden and 6 others like this.
  49. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    3,263
    Thank you for the long term support!
    This is a nice Christmas gift, I will let you know later on how it works for me.
     
    techsalad likes this.
  50. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    391
    Thank you TechSalad for a great asset. It works well with minimal fuss. Thank you!
     
    techsalad likes this.