Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Nominations have been announced for this years Unity Awards. Celebrate the wonderful projects made by your peers this year and get voting! Vote here!
    Dismiss Notice
  6. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    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. FreeReignPublishing

    FreeReignPublishing

    Joined:
    Oct 22, 2017
    Posts:
    14
    Thanks for the response, yes that is a feature i need so I can
    use this for a 2d game I’m making.
     
  2. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    Great!
    So I had a quick look at it and it's actually pretty easy to implement. I already have a working prototype :)
    gif3.gif

    So I could definitively add this feature in the next update.

    If you are interested in receiving a WIP version before to try it, send me an email at techsaladunity@gmail.com with your invoice ID, I will be happy to share it with your ASAP.

    Thanks.
     
    Lars-Steenhoff and AthrunVLokiz like this.
  3. FreeReignPublishing

    FreeReignPublishing

    Joined:
    Oct 22, 2017
    Posts:
    14
    Thank you so much!
     
    techsalad likes this.
  4. JediNizar

    JediNizar

    Joined:
    Nov 13, 2016
    Posts:
    11
    Hi,
    I purchased yesterday your great asset. Some how I couldn't find out how to change the size of the cone base of the light. I created a volumic spotlight for a my Flashlight but some how the light has more a shape of tube rather than a cone., which could be ok for me, the only problem is that the base is much more bigger than my flashlight.
    I can show a screenshot later if u need.
     
  5. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    Hi and thanks for your message,
    You can customize the shape of the beam using 2 properties:
    - Truncated Radius allows you to change the size of the base of your beam. Tweak this one to make it fit with your flashlight model: http://saladgamer.com/vlb-doc/comp-lightbeam/#truncated-radius
    - Spot Angle allows you to change the shape of the beam, to make it look more like a cone or more like a tube: http://saladgamer.com/vlb-doc/comp-lightbeam/#spot-angle

    Screenshot_40.png

    Do not hesitate if you have more questions.
    Thanks :)
     
  6. JediNizar

    JediNizar

    Joined:
    Nov 13, 2016
    Posts:
    11
    thanks a lot... will try it later....
     
  7. FreeReignPublishing

    FreeReignPublishing

    Joined:
    Oct 22, 2017
    Posts:
    14
    are you able to do circle volumetric lights?
     
  8. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    Hi,
    If by "circle" you mean supporting "point lights" (light going in every directions in 360 degrees), no. The plugin only supports spotlights.
     
  9. FreeReignPublishing

    FreeReignPublishing

    Joined:
    Oct 22, 2017
    Posts:
    14
    yes I mean point lights will you support it in the future?
     
  10. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    This is not planned: it's not really possible with the current technique the plugin is using.
    For example doing volumetric point lights without supporting shadowing doesn't make a lot of sense (otherwise it's just a big glow). And supporting shadowing would involve a much more performance intensive process, which would not run on mobile for example.
     
  11. FreeReignPublishing

    FreeReignPublishing

    Joined:
    Oct 22, 2017
    Posts:
    14
    ok thanks for the reply
     
  12. Johnny_Jr

    Johnny_Jr

    Joined:
    Jan 23, 2015
    Posts:
    8
    Hi!
    When compiling for PS4 I get errors in the Beam shader (the first one in both frag and vert):

    Shader error in 'VolumetricLightBeam/Beam': Program 'frag', 'sampler2D' does not contain a member named 'Sample' at /Unity/2018.1.0f2/Editor/Data/CGIncludes/HLSLSupport.cginc(519) (on ps4)

    Compiling Fragment program with STEREO_INSTANCING_ON VLB_DEPTH_BLEND
    Platform defines: UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP UNITY_LIGHT_PROBE_PROXY_VOLUME UNITY_LIGHTMAP_RGBM_ENCODING


    Shader error in 'VolumetricLightBeam/Beam': undeclared identifier 'sampler_CameraDepthTexture' at Assets/Plugins/VolumetricLightBeam/Resources/VolumetricLightBeamShared.cginc(49) (on d3d11)

    Compiling Vertex program with STEREO_INSTANCING_ON VLB_DEPTH_BLEND VLB_NOISE_3D
    Platform defines: 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 UNITY_LIGHTMAP_RGBM_ENCODING

    I'm on version 1320 and using Unity 2018.0.1
     
  13. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    Hi,
    I don't have a PS4 devkit to try, but we'll find out the issue. Have you tried to update to the latest 1520 version?
    Thanks
     
  14. Johnny_Jr

    Johnny_Jr

    Joined:
    Jan 23, 2015
    Posts:
    8
    No I haven't, for the simple reason that the game is already out on PC and I don't want to update stuff that works... I'll give it a go and see if it the issue is resolved.
     
  15. JediNizar

    JediNizar

    Joined:
    Nov 13, 2016
    Posts:
    11
    Hi,
    I've discovered something weird.
    the light is going through every surface. first I discovered through a character, then I added a box behind the character and I had the same effect, the light is going through the character and the box. and I'm sure I didn't have the same effect prior adding the volumetric light.. please see the picture below: LightBeamBug.png
     
  16. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    Hi,
    The VolumetricLightBeam component is not supposed to change the behavior of the light itself. You can try to disable or remove the VolumetricLightBeam component (and the DynamicOcclusion component) to check if the issue is still the same without them.
    Please let me know,
    Thanks
     
  17. SF_futurlab

    SF_futurlab

    Joined:
    Feb 4, 2016
    Posts:
    4
    Hi,
    Just been through the forum to see if there's talk of a rectangular beam (which I see there is plenty) - great that it's on its way :)

    In the meantime, I found putting the cone segs to 4 gives you a square beam with the only downside that it is created at 45 degrees so you can't use local scale to create a rectangle.
    Now, if this cone was created with this rotation in mind, I'd have the kind of solution I'm looking for... (window light beams).

    Plugin otherwise is really great! Thanks
     

    Attached Files:

  18. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    Hi,
    You are right, you can make a kind of rectangle beam this way. However I think the quality is not satisfying enough to "sell" it as a real feature. Making rectangle beams with a good quality is not as easy as it sounds, and is in fact quite different than making cone beams.
    However, if it helps you, I could definitely make the beam geometry rotated by 45 degrees by default so you could scale it properly. If you are interested in testing it beforehand, please send me an email at techsaladunity@gmail.com
    Thanks
     
    Last edited: Nov 28, 2018
    AthrunVLokiz likes this.
  19. FreeReignPublishing

    FreeReignPublishing

    Joined:
    Oct 22, 2017
    Posts:
    14
    Hi, are you able to round out the point of the cone? I'm using this for 2D
     
  20. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    What do you mean? Do you mean having a half-sphere at the point of the light source like that?
    Screenshot_1.png
     
  21. FreeReignPublishing

    FreeReignPublishing

    Joined:
    Oct 22, 2017
    Posts:
    14
    Yes, thanks for the reply.
     
  22. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    No it's not possible to do that.
    But you should be able to do it by just adding a half-sphere mesh at the light source position.
     
  23. FreeReignPublishing

    FreeReignPublishing

    Joined:
    Oct 22, 2017
    Posts:
    14
    Can you give me an example of how to do that?
     
  24. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    I will try to make you a scene example. I will contact you by private message.
     
  25. FreeReignPublishing

    FreeReignPublishing

    Joined:
    Oct 22, 2017
    Posts:
    14
  26. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,292
    Just purchased the asset and had a go but I am experiencing some issues.

    1. When I set it up in he editor, it all seems to be fine, but when I am in play mode, it seems like the drawing of the beam seems to be weird. It becomes very short and possibly not even drawing the outter pass. In order to view the beam, the only way is to click on the global button and then toggle the "force single pass" check box on or off. It doesn't matter if it is on or not, as long as I click on that check box.

    2. Track changes during playtime - This doesn't work for me. If I turn the play mode off, the values all just go back to what it was before I was in the play mode.

    3. This is probably my fault of not reading the manual before I buy the asset, but partial occlusion was no good for my usage case. :(

    I am using : Unity 2018.3b12. Windows Editor. Linear, Deferred. HDR.
     
  27. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    Hi,
    I am really sorry for the issues you are experimenting:

    1. That is very weird. Are you using a custom SRP, or the default render pipeline (https://blogs.unity3d.com/2018/01/31/srp-overview/ )? Have you tried to export a Windows standalone build to check if the issue is visible?
    I will try to install the exact same Unity version and try to reproduce it. In the meantime, if you can send me your project (or a subset of it) so I can reproduce in better conditions, please not hesitate: techsaladunity@gmail.com

    2. Sorry if it wasn't clear, but this feature is designed to change the volumetric light beam properties at runtime (from script, or from an animation for example). It's not to keep the changes you have made in editor when playing. I hope it makes sense... :)
    However I think this is a very interesting suggestion, and I will definitely investigate to make it.

    3. Like mentioned in the documentation and the asset store page in the limitation part, partial occlusion is not supported yet indeed.

    Thanks
     
  28. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    1,292
    I am using just default rendering pipeline.
    As for the tracking changes during playtime, I am sure it must been mentioned somewhere in the document so it is not entirely your fault, but I bet 9 out of 10 people would think it is supposed to be for the inspector .. haha!
     
  29. OlafsOsh

    OlafsOsh

    Joined:
    Jul 10, 2018
    Posts:
    2
    Hey!
    I need something like this for 2D project - I need exactly lightposts, don't you know :] Does Volumetric Light Beam work in 2D as well?
     
  30. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    Hi and thanks for your interest :)
    Yes it works in 2D. You can customize specific 2D properties like Sorting Layers and Order in Layer, like a regular 2D Sprite: http://saladgamer.com/vlb-doc/comp-lightbeam/#2d
     
  31. OlafsOsh

    OlafsOsh

    Joined:
    Jul 10, 2018
    Posts:
    2
    OK then, you'll have a new customer soon then :]
     
  32. mehrankan

    mehrankan

    Joined:
    Apr 12, 2015
    Posts:
    26
    hi this looks great, I am wondering if I can fake sun-shafts with this somehow, I work in VR so true volumetrics are off the table, which makes this the perfect way.
    a good example can be the light shafts at the top of this image.
     
  33. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    Hi and thanks for your interest. Simply put, no it won't work. The asset is mainly design to simulate volume on spot lights. The result won't be good to simulate directional light like that.
     
  34. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    1,743
    Can't we use the noise texture within the beam? to fake directional light coming to the trees?
    Just now the noise is uniform, it needs to be directional
     
  35. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    It won't look good I think.
    The current 3d noise effect looks good because it's "random" noise and because the noise intensity is usually not too high. If you make the noise pattern more obvious and with higher contrast, the cone shape of the beam will be too visible.
    What you are asking is basically the same than doing the cookie feature: having a "controlled" noise pattern with higher intensity. So it might be possible to have a similar effect with the cookie feature, but since I'm not 100% sure, I prefer not to give you false hopes! :)
     
  36. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    1,743
    Yes like a light cookie, Im also interested in that, how is that progressing?
     
  37. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    Well it's a challenge... I am currently more focused on current performance improvement and on fixing stuff because of API changes in unity such as keeping support of HDRP, LWRP and VR. I am preparing a big update all about drawcall decrease btw, should be released next week.
    But once it will be fine, I will be able to focus more on this long awaited feature!
    Thanks :)
     
    Lars-Steenhoff likes this.
  38. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    164
    I am extremely pleased to announce the release of Volumetric Light Beam 1.60.

    The main feature of this new update is GPU Instancing, a major optimization for high-end devices to draw hundreds of beams in 1 single drawcall. Learn more about this in the new Optimization page of the documentation.
    optim_gpu_instancing_batching.png

    You can now download a Windows PC and Mac OSX demo in addition to the Android and WebGL builds on this page.

    demo_screenshot.png

    Full changelog:
    Hope you'll like it!
     
    Last edited: Dec 11, 2018