Search Unity

  1. Get the latest news, tutorials and offers directly to your inbox with our newsletters. Sign up 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. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Good news, this issue has been fixed in latest 1.85 update: http://saladgamer.com/vlb-doc/changelog/
    While the Built-In Render Pipeline, URP and HDRP support is more stable than ever, maintaining support of the obsolete LWRP was more and more complicated, so I had to drop it.
    I am pretty sure you won't be affected by this since Unity moved from LWRP to URP months ago (from Unity 2019.3.0). But in case it's a problem for you and you can't upgrade your Unity version to a more recent one with URP, please get it touch with me.
    Thanks
     
    DrOcto likes this.
  2. pdinklag

    pdinklag

    Joined:
    Jan 24, 2017
    Posts:
    99
    First off, thanks for this asset! :)

    I get this shader compilation error message in URP (8.2.0 in Unity 2019.1.2) in the 1.85 update:

    Shader error in 'Hidden/VolumetricLightBeamSRP': undeclared identifier '_ScaledScreenParams' at Assets/Plugins/VolumetricLightBeam/Resources/Shaders/ShaderSpecificURP.cginc(43) (on d3d11)
    In the git diff of 1.85 compared against 1.84 the definition was clearly removed
    Code (CSharp):
    1. CBUFFER_START(_PerCamera)
    2. float4 _ScaledScreenParams; // only used by LWRP for render scale
    3. CBUFFER_END
    Apparently something was forgotten? Everything seems to be working fine despite the error message, just wanted to report that.
     
  3. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Hi,
    Thank you for your message,
    How are you using URP with 2019.1.2 ? I thought URP was introduced with 2019.3.0.
    Are you sure you are not using LWRP ?
    Thanks

    EDIT:
    when creating a new project with 2019.2.0, it only offers me LWRP (and not URP)
    Screenshot_1.png
     
    Last edited: Sep 8, 2020
  4. pdinklag

    pdinklag

    Joined:
    Jan 24, 2017
    Posts:
    99
    Argh, I am in Unity 2020.1.2. :confused: Sorry for the confusion.
    But yes, I am very sure I am using URP version 8.2.0, that's what the package manager reports.

    In any event, in VLB version 1.85, you removed that ScaledScreenParams variable declaration that is still being used literally a few lines below (in VLBSampleDepthTexture).
     
    techsalad likes this.
  5. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Ok thanks for the clarification.
    Yes I know that ScaledScreenParams is still used, but it's supposed to be declared in the URP package, that's why I removed it. I will investigate using the exact same version as you.
    I'll let you know.
    Thanks.
     
  6. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Hi,
    So I tried many things, with Unity 2020.1.1, 2020.1.2, 2020.1.3, with all the Rendering Modes, but I don't manage to reproduce the issue. Here is a screenshot:
    Screenshot_20.png

    Could you please provide me a screenshot of your plugin configuration?
    Are you running on Windows or Mac?
    Thanks
     
  7. pdinklag

    pdinklag

    Joined:
    Jan 24, 2017
    Posts:
    99
    OK, for whatever reason, the render pipeline in my VLB config override was set to Built-In. Setting that to URP gets rid of the compilation error as one would expect. I know I had it set to URP before at some point, but I created a new configuration after an update. Is Built-In maybe the default selection that I overlooked? If not, who knows what I was thinking (if anything) when changing it.

    Thank you for clearing it up!
     
  8. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Hi,
    Thanks for the feedback. I am glad it works fine :)
    This property is supposed to be automatically set to the proper value depending on the detected render pipeline. But you are not the only one to warn me that it didn't work. I'll investigate...
    Thank you.
     
  9. The_Equinox

    The_Equinox

    Joined:
    Mar 16, 2020
    Posts:
    1
    I know it states it in the product description but i just want to make sure, this can't be used with VRC SDK? theres no way to bake the geometry/shader into the scene?
     
  10. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    No sorry it's definitely not possible. The plugin relies to much on scripts to send data to the shader at start-up and during runtime.
     
  11. zagreekie

    zagreekie

    Joined:
    Nov 20, 2017
    Posts:
    28
    So far loving the asset, but i had a question in regards to the dust particles, currently, we can select the direction of "random" or "beam" would it be possible to add an option for world coordinates? I .e.make the particles flow on the X-axis, positive speed = going one-way negative speed going the other way?
     
  12. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Thank you very much for your message, I am glad you love the asset :)
    Thanks for suggestion, I think it's doable, I'll investigate to implement it and I'll let you know.
    Cheers!
     
  13. zagreekie

    zagreekie

    Joined:
    Nov 20, 2017
    Posts:
    28
    That would be outstanding if possible! I just noticed you do something very similar with 3d noise direction, although I would assume it's far simpler with a noise texture than particles.
     
    techsalad likes this.
  14. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    I have developed the feature, I will send it to you by PM.
     
  15. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    AthrunVLokiz and Lars-Steenhoff like this.
  16. Lars-Steenhoff

    Lars-Steenhoff

    Joined:
    Aug 7, 2007
    Posts:
    2,984
    Very nice update! Thanks
     
    techsalad likes this.
  17. DragonCoder

    DragonCoder

    Joined:
    Jul 3, 2015
    Posts:
    42
    This a really awesome asset! Especially the performance is great.

    Though I have one usecase help would be greatly appreciated for.
    Am trying to use this in a 2.5D design. That means the 3D terrain is "cut" in half and the camera is in a fixed position perpendicular to the cutting plane.

    The issue now is that with Depth Buffer occlusion, the light bleeds into the foreground across the cut plane (the mossy stone) like you can see here:
    Occlusion.png
    I'd like to prevent light from ending up there.
    Is there a way to enforce that the depth buffer of my foreground mesh (it is a separate mesh from the rest of the terrain) is set in such a way the volumetric light occlusion sees it as a solid wall all the way to the camera plane and thus stops the light beam?

    Or maybe alternatively have the mesh be drawn always ontop of the light?

    Huge thanks in advance!
     
  18. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Hi,
    Thank you for your message, I am glad you like it!
    I am not sure to exactly understand the problem, and sorry but I don't really get what's on the screenshot :)
    Would you like the Depth Buffer occlusion to work in 2D instead of in 3D? Maybe could you provide me a video showing the problem in more details please, so I could give you more relevant suggestions? You can PM me or contact me on techsaladunity@gmail.com if you prefer :)
    Thanks!
     
  19. gewl

    gewl

    Joined:
    May 19, 2016
    Posts:
    22
    Hi,

    I'm using URP with 2019.4.15f1. Whenever I use volumetric light beam with the Dynamic Occlusion Depth Buffer enabled, I get a
    error once per frame while looking at the light beam. My scene is lightmapped and my pipeline renderer has "Depth Texture enabled"—the error also doesn't seem to be causing any problems with functionality. Do you have any idea what this might be?
     
  20. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Hi,
    Sorry for the error you are having. Is there any callstack available in the console when this error message is outputed?
    Meanwhile I'll check on my side.
    Thanks

    EDIT:
    I have tested on my side with a similar setup (Unity 2019.4.15, URP 7.3.1, a beam with Depth Occlusion Depth Buffer component), but I don't manage to reproduce the issue.
    Screenshot_1.png
    The Depth Occlusion Depth Buffer component creates a RT with a 16 bits depth buffer, so I don't think it can cause this error message.
    If possible, please share with me by email or PM your project so I can have a look on my side.
     
    Last edited: Dec 4, 2020
  21. gewl

    gewl

    Joined:
    May 19, 2016
    Posts:
    22
    Thanks for the quick reply! Here's the callstack:
    Capture.PNG
    I'm sure it's some bizarre setting or conflict I have on somewhere—I'm pretty sure I wasn't getting it a week ago, it seems to be a new development in the past few days.

    Unfortunately I'm not available to send my project to you for the next few days, but once my workload clears up a bit I should be able to help debug this more, if one of us still hasn't figured out what it is by then.

    Also forgot to mention that it happens in Scene view and Play mode whenever the Scene camera or active game camera is pointing at the VLP lightbeam—no logging when pointing elsewhere.

    Thanks again! Really love the tool otherwise, very easy to use and looks great.
     
  22. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Hi,
    Thanks for the details.
    The error comes from the plugin code, so I did some investigation, but I couldn't find what could cause this issue.
    The RenderTexture is properly created with a 16 bit depth buffer, so I don't get why this error is reported.
    According to the URP API, the UniversalAdditionalCameraData.cameraOutput property has to be setup to create a Depth RT (in addition to the regular camera) with URP. But in fact the documentation is not up-to-date at all and this extra property has been deprecated months ago...
    So if you can send me some files related to your project someday, I would be interested.
    I hope this issue doesn't prevent you from working and enjoying the plugin.
    Cheers
    TS
     
  23. gewl

    gewl

    Joined:
    May 19, 2016
    Posts:
    22
    Hi,

    Sorry that I still haven't had time to send the project! However, I think I've found the culprit: I'm using SC's Post Effects (https://assetstore.unity.com/packag...en-camera-effects/sc-post-effects-pack-108753) in the same project, and using the Blur effect from that package. Enabling this requires putting a Blur Renderer component on my URP Renderer object. When the Blur component is present, I get the RenderTexture warning logging—when it's gone, no warnings.

    I don't really know anything about graphics programming, so this is a little out of my weight class, but I noticed that SC's Blur Renderer was calling CommandBuffer.GetTemporaryRT with a value of 0 for the depthBuffer—changing that to 16 stopped the warnings again.

    Not really sure what any of this means, and it seems like it might ultimately be more of an SCPE thing, but I hope it's helpful! Thanks again for a great tool.
     
    techsalad likes this.
  24. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Thank you for the feedback. I am glad you managed to figure it out.
    I'll investigate if there is anything I can do to improve and maximize the compatibility.
    Thanks
    TS
     
  25. adrian-taylor09

    adrian-taylor09

    Joined:
    Dec 22, 2016
    Posts:
    40
    Hi there, I'm trying to achieve an effect similar to what you've shown in this post... would you mind explaining how you achieved this?
     
  26. Personuo

    Personuo

    Joined:
    Mar 19, 2014
    Posts:
    70
    I manually add each beam of light, in fact, after a long period of research, I found that in addition to raymatch, it is difficult to make a good-looking volume of light, but because I do hand games, so it is impossible to use raymatch that performance is too poor
     
  27. jsunandmax

    jsunandmax

    Joined:
    Jan 12, 2013
    Posts:
    16
    so, does this thing work well in URP for 2020.2.0f1 ???
     
  28. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Hello.
    Yes the plugin works perfectly fine with URP and Unity 2020.2.0.
    Do you encounter any issues?
    Please follow this very quick guide and video to learn how to setup the plugin with URP.
    Thanks
     
  29. purejenix

    purejenix

    Joined:
    Jun 15, 2017
    Posts:
    2
    Hi,
    Is it possible to set distinct configuration file for each platform (desktop, android, ios) as we need to vary some parameters depending on platform (like Soft Intersections)?
     
  30. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Hi,
    No it's currently not possible to do that. However I think it's a very relevant suggestion.
    I already thought it would be useful to create specific Configuration asset for a platform, mainly to tweak the Rendering Mode. With this, you would also be able to enable/disable certain features per platform like the Soft Intersect with Opaque Geometry.
    Would it be useful for you? Or would you need to tweak other features which are not accessible through the Config asset?
    Thanks
     
  31. purejenix

    purejenix

    Joined:
    Jun 15, 2017
    Posts:
    2
    It will be useful and enough for us to have configuration asset per platform. I will be very grateful If you could implement this feature. Thank you :)
     
    techsalad likes this.
  32. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Thanks for the feedback. I'll investigate to implement it and I'll contact you as soon as I'll have something working.
    Cheers
     
  33. robinkuijs

    robinkuijs

    Joined:
    Dec 29, 2020
    Posts:
    4
    I'm having an issue with the volumetric lights in VR. It seems like there is some shadow problem.

    I have recorded this video:
    . At 0:13 I'm switching on the volumetric light and and switched it off at around 0:20. Could oyu please help me solve this?
     
    Last edited: Mar 3, 2021
  34. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Hi,
    Sorry for your issue. Sure I'll do my best to help you.
    Could you please provide me the following info:
    - Unity version
    - VLB plugin version
    - Render Pipeline (Builtin, URP, HDRP)
    - Which VR Stereo rendering mode are you using (visible in the XR settings)?
    Screenshot_1.png
    - Does the issue happen when running in the editor?
    - Which is your target headset/platforn? Does the issue happen when running on your target platform from a exported build?

    Thanks
     
  35. robinkuijs

    robinkuijs

    Joined:
    Dec 29, 2020
    Posts:
    4
    Thank you for the quick reply!
    My Unity version is 2019.4.19f1 with built-in RP. VLB version is 1.92. Stereo Rendering Mode is set to Multipass. I observed this in play mode using Oculus Link with Quest 2. I will try to build the scene, I haven’t tried that yet.

     
  36. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Thanks for the info! That's weird, you should not have any issue for this setup. Using the Oculus cable, it should behave like any regular VR Headset.

    Btw, are you using the old (and deprecated) VR settings (through Player settings)?
    Screenshot_21.png

    Or the new one (through XR Plugin Management)?
    Screenshot_23.png

    Can you please also take a screenshot of your XR/VR settings so I can see exactly which VR plugin and settings you are using?

    Thanks!
     
  37. robinkuijs

    robinkuijs

    Joined:
    Dec 29, 2020
    Posts:
    4
    Trying to build the file now, it takes a while.
    These are my settings in the attachment. I think these are the new settings right?

    Edit: I built the file and it's the same when I run it straight from the Quest 2.
     

    Attached Files:

  38. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Thanks!
    Yes these are the new settings.
    I don't know what's going on, I will run some tests on my side.
    In the meantime, have you tried to change the VR stereo rendering mode to single pass to see if it works better?
    Last question, can you please take a screenshot of the plugin config so I could try with the exact same settings than you?
    Thank you again!
     
  39. robinkuijs

    robinkuijs

    Joined:
    Dec 29, 2020
    Posts:
    4
    Thanks for the reply again!
    I changed my XR plugin settings to single pass and this solved the issue. I also changed the settings to single pass in the plugin settings as you can see in the screenshot. I would however prefer to use multi pass. But please take your time, I am not in a hurry to solve this :)
     

    Attached Files:

    Last edited: Mar 3, 2021
    techsalad likes this.
  40. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Glad this workaround works!
    I'll investigate the issue anyway, it should work fine with multipass stereo rendering mode.
     
  41. Dobalina

    Dobalina

    Joined:
    Sep 6, 2013
    Posts:
    77
    Hello, when grabbing the latest version I ran into two errors.

    Assets\Plugins\VolumetricLightBeam\Scripts\DynamicOcclusion.cs(9,21): error CS0117: 'Consts' does not contain a definition for 'HelpUrlDynamicOcclusion'

    Assets\Plugins\VolumetricLightBeam\Scripts\DynamicOcclusion.cs(15,16): error CS0246: The type or namespace name 'OccluderDimensions' could not be found (are you missing a using directive or an assembly reference?)

    I'm on default render pipeline, Unity 2020.1.11. Just a side note that I'm using "Shader Control" in my build to trim out any unused shader keywords, though I'm not altering any of the Volumetric light beam shaders.
     
  42. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    295
    Hello,
    This is a common problem with the package manager which doesn't properly update plugin package and doesn't delete removed files. Please follow these steps to properly update it: http://saladgamer.com/vlb-doc/troubleshooting/#errors-after-updating-the-plugin
    Please let me know if it fixes your issue.
    Thanks
    TS
     
  43. Dobalina

    Dobalina

    Joined:
    Sep 6, 2013
    Posts:
    77
    Oops, I should have known to check the online manual. Thanks! All is good now.
     
    techsalad likes this.
unityunity