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

    JKB55406

    Joined:
    Dec 22, 2021
    Posts:
    5
    I have been brought in on a project that has already begun development. When I run this scene I see this error:
    https://drive.google.com/file/d/1Go7sk6CuX4VqpfHBCBMdvigULFxG7_FF/view?usp=drive_link


    I didn’t find the VolumetricLightBeam directory, so I assume it was deleted after it was installed.

    We are using Unity 2020.3.10f1 with the standard rendering pipeline.

    I am unable to find any element for “Dust Particle Prefab” or “3D Noise Texture”. What asset could I use for this? What is the fix?? If there is no other option, how would I properly uninstall???


    Thank you!
     
  2. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    379
    Hey, we will deal with that through emails, it will be more efficient and will create less noise.
    Thanks
    TS
     
  3. pallavimankame77

    pallavimankame77

    Joined:
    Nov 14, 2018
    Posts:
    9
    Hi there
    Please Help me. I am applying HD beam with Built In Render pipeline (extra 3D). Beam effect is working on scene editor but could not get render with game camera. Why is that so, am I missing something ? upload_2023-12-6_4-5-33.png
     
  4. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    379
    Hello,
    Can you check on which layer your beams are declared (by default on TransparentFX): http://saladgamer.com/vlb-doc/config/#override-layer
    And check if your game camera renders this layer (in its culling mask).
    thanks!
    TS
     
  5. pallavimankame77

    pallavimankame77

    Joined:
    Nov 14, 2018
    Posts:
    9
    Thank you.
     
    techsalad likes this.
  6. bgebitekin

    bgebitekin

    Joined:
    Dec 22, 2020
    Posts:
    11
    Hi, is it possible to have the light not make distant objects that are in the dark suddenly visible through the cone? In a scenario where all the lighted areas are close to the player and the distant objects are in the dark and hence not visible (at night), when the volume light comes in, even at very low intensities, it suddenly makes the trees, mountains and buildings that are outside the lit up area visible. Turning on a street lamp would not suddenly make the buildings 500m away visible when looked through its cone. Any help would be appreciated.
     
  7. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    379
    Hello,
    Thank you for your message.
    That’s probably because of the Additive Blending Mode. All pixels behind the light beam will receive additive color, so they might look brighter.
    Please try other kind of Blending Mode, such as “Traditional Transparency”: http://saladgamer.com/vlb-doc/comp-lightbeam-sd/#blending-mode
    Thanks
     
  8. bgebitekin

    bgebitekin

    Joined:
    Dec 22, 2020
    Posts:
    11
    Thank you for the quick reply. Unfortunately, the additive and trad transparency modes are visibly almost identical to each other (I cannot tell any difference between the two visually) and the problem exist in both cases.

    This is the darkest night possible in our game, (3x zoom, shiny sea weed for brightness ref., the blocks behind the hill are thousands of units away) Untitled-1.jpg
     
  9. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    379
    Hey,
    I am sorry it didn’t fix your issue.
    I am not sure to understand what I see in your screenshot.
    Maybe we can take this discussion offline. It would be better if you could share some videos of the problem.
    Thanks!
    TS
     
  10. ponx

    ponx

    Joined:
    Sep 13, 2010
    Posts:
    44
    Hello! I'm using VLB V.2.2.0 with the built-in render pipeline on Unity 2021.3.34.
    It looks great, but I need to set the color at runtime. I tried every option listed in the documentation:
    • checked the Track changes during playtime checkbox
    • called beam.UpdateAfterManualPropertyChange();
    • also tried calling beam.GenerateGeometry();
    As soon as I try any of these, the beam will completely turn invisible.
    Please help! Best, Andy
     
  11. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    379
    Hello and thank you for your message.

    I am glad you find it looks great :)

    I guess you are using a SD beam right?
    In this case enabling the “track changes during playtime” option should be enough indeed: https://saladgamer.com/vlb-doc/comp-lightbeam-sd/#track-changes-during-playtime

    How are you trying to change your beam at runtime? Via script? Via an animator or timeline?

    Thank you!
     
  12. ponx

    ponx

    Joined:
    Sep 13, 2010
    Posts:
    44
    Hi techsalad, thanks for the quick reply!
    I noticed that I hadn't run the VLB's package install script after updating, so now I'm really up-to-date and I am using VolumetricLightBeamHD. However I am running in the same issues. I try to set the color in a script via:

    MyVolumetricLightBeam.colorFlat = color;

    .. and as soon as I do so, the volumetric light disappears completely. I tried to:
    • attach the script TrackRealtimeChangesOnLightHD
    • call VolumetricLightBeam.UpdateAfterManualPropertyChange(); after setting the colorFlat.
    .. and I also switched to Point light and tried to set the color there, but it's always the same effect.
    Any further ideas are highly appreciated!
     
  13. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    379
    Ok thanks for the details.

    To be able to change the color of a HD beam at runtime, you don’t have to do anything. Just change the colorFlat property via script and that’s it.

    However, if your HD beam is “attached” to a Unity light with the color property bound to the light, it won’t work, because you have to update the unity’s light color instead.

    However you should never have the beam disappear, that’s weird.

    I am not currently in front of my computer, but let me cook you some samples tomorrow first thing in the morning.

    thank you :)
     
    ponx likes this.
  14. techsalad

    techsalad

    Joined:
    Oct 9, 2017
    Posts:
    379
    Hello again.

    So here 2 samples to change the color of a Volumetric Light Beam HD from script at runtime:

    1st case:
    If your beam is not attached to a Unity Light, or the color property is not bound to the Unity Light's color, you can change the colorFlat property directly:
    Screenshot_1.png


    Code (CSharp):
    1. // Change the color of the Volumetric Light Beam HD
    2. public class ChangeBeamColor : MonoBehaviour
    3. {
    4.     VLB.VolumetricLightBeamHD beamHD = null;
    5.  
    6.     void Start()
    7.     {
    8.         beamHD = GetComponent<VLB.VolumetricLightBeamHD>();
    9.     }
    10.  
    11.     void Update()
    12.     {
    13.         if(beamHD)
    14.         {
    15.             float t = Mathf.PingPong(Time.time, 1f);
    16.             beamHD.colorFlat = Color.Lerp(Color.red, Color.green, t);
    17.         }
    18.     }
    19. }
    20.  

    2nd case:
    Your beam is attached to a Unity Light and the color property is bound to the Unity Light's color.
    So it means you can't change the beam's color directly: you have to change the Unity Light's color instead. And you need the TrackRealtimeChangesOnLightHD component attached to your GameObject to automatically update the beam's color when the Unity Light's color changes.
    Screenshot_76.png

    Code (CSharp):
    1. // Change the color of the Unity Light
    2. // Will update the color of the beam HD automatically thanks to the TrackRealtimeChangesOnLightHD component
    3. public class ChangeLightColor : MonoBehaviour
    4. {
    5.     Light lightComponent = null;
    6.  
    7.     void Start()
    8.     {
    9.         lightComponent = GetComponent<Light>();
    10.  
    11.         // In this case, since we are changing the color of the Unity light and not the color of the beam HD,
    12.         // we need the TrackRealtimeChangesOnLightHD component attached first.
    13.         if (GetComponent<VLB.TrackRealtimeChangesOnLightHD>() == null)
    14.         {
    15.             Debug.LogError("Please attach the TrackRealtimeChangesOnLightHD component to the same GameObject as this script, in order to have the beamHD properties updated with the Unity Light.");
    16.         }
    17.     }
    18.  
    19.     void Update()
    20.     {
    21.         if (lightComponent)
    22.         {
    23.             float t = Mathf.PingPong(Time.time, 1f);
    24.             lightComponent.color = Color.Lerp(Color.red, Color.green, t);
    25.         }
    26.     }
    27. }
    28.  
    And here the result during playtime:
    ChangeBeamHdColor.gif

    I will send you the project with these script samples as PM.

    I hope it helps, please let me know :)
    Thanks
    TS