Search Unity

Realtime point lights in VR

Discussion in 'AR/VR (XR) Discussion' started by Keaneo, Mar 19, 2018.

  1. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    Hi,
    We have a multiplayer game with a mix of indoor/outdoor scenes and are trying to use as much static/baked lighting as possible to keep performance up in VR. However, players can create objects that would benefit from realtime lighting for short bursts (e.g. flamethrowers, handheld torches, etc.). Just to cast tinted light and shadows if possible.

    Could someone please advise us on:

    1) If this is even a good idea - we don't want to kill performance if 10 players each suddenly create a realtime point light!
    2) What's the lighting setup? "Forward rendering" seems to be preferred for VR, but "deferred" is the suggestion for "lots of lights".

    We'd really appreciate any advice/articles on how to set it all up.

    Thanks!
     
  2. StickyHoneybuns

    StickyHoneybuns

    Joined:
    Jan 16, 2018
    Posts:
    207
    So, I am no expert in this by any means and I am pretty much in the same boat as you. However, I will give my advice on what I am currently doing.

    All of my lighting is indoor at this point with the majority of my objects as static objects, therefore I bake most of my lighting. Like most games though the player is non static and therefore needs to cast realtime shadows. This is particularly important for VR to give the player more immersion.

    So, right now I am using mixed lighting so that I get the majority of items baked and the player and enemies will cast dynamic shadows. To make sure performance is good I am going to make sure a certain percentage of lights are occluded at all times. Therefore the scene from the players perspective will only have 3-4 lights on them at any given time.

    Currently I am using forward rendering but probably don't have as many lights as you do. Now, my methods could change over time as I experiment more with the lighting.

    There are lighting tutorials but there isn't a perfect scenario and will require you to play with the lighting to get the performance/affect you are looking for.

    I would just try forward rendering with mixed lighting and look at performance. Then, if it is not to your liking then try other methods.
     
  3. NotQuiteSmith

    NotQuiteSmith

    Joined:
    Oct 27, 2013
    Posts:
    92
    Thanks so much for replying! Sometimes it's just a case of hearing that other people are trying the same things. I'm just going with forward/mixed/etc and I'll see how far I can push it!

    Thanks!
     
    StickyHoneybuns likes this.
  4. StickyHoneybuns

    StickyHoneybuns

    Joined:
    Jan 16, 2018
    Posts:
    207
    Awesome! If you don't mind, keep this updated with your progress so we can learn as well. I can also contribute my results as well if you would like.
     
  5. alisiam

    alisiam

    Joined:
    Dec 1, 2017
    Posts:
    1
    Hey all, interested to see any results you all might have! Also stuck in the same position. Thanks!
     
  6. arybak89

    arybak89

    Joined:
    Nov 27, 2017
    Posts:
    9
    Hey just wanted to chime in. I'd be very interested to hear what you both come up with. We are beginning to hit this issue at work and I'm not sure how to proceed. Ours isn't a game, it is a simulator, but the premise is the same. Keeping everything baked won't work (especially since you can't bake lighting on non-static items in Unity) so trying to find the best path forward. Thanks!
     
  7. Keaneo

    Keaneo

    Joined:
    Mar 7, 2015
    Posts:
    99
    We just stuck with forward rendering and keep light sources to a minimum. It does mean that reality/immersion is sacrificed but I'd rather keep the frame rate up! Haven't moved to 2018 yet - maybe the new render pipelines allow much better control here?
     
  8. arybak89

    arybak89

    Joined:
    Nov 27, 2017
    Posts:
    9
    My team is using 2018 currently. I was able to have a couple realtime lights in the scene at a time while keeping FPS at 90 (VR standard). All reflection probes are baked though. Granted, I also am applying post processing which hogs a bit of performance, so maybe without that you could include more. I also am using a forward render on the camera. Like you said framerate is key, its just hard to sacrifice immersion.
     
    Keaneo likes this.
  9. FiveFingerStudios

    FiveFingerStudios

    Joined:
    Apr 22, 2016
    Posts:
    510
    I’m currently using mixed lights as well.

    What I do is for real-time and mixed lights:

    1. Make sure you avoid overlapping lights as much as possible, as multiple lights hitting the same object waste resources.

    2. I design my levels so that the player can only see 1 or 2 lights at a time. I then turn lights on/off via triggers.
     
  10. pixelfilm

    pixelfilm

    Joined:
    Feb 15, 2021
    Posts:
    10
    I am only using two lights and one is baked. But I’m seeing a flicker in the Quest 1 when I look at the light. Any tips?