Search Unity

Need help: 480 Point Lights runs too lagging in DK2

Discussion in 'AR/VR (XR) Discussion' started by torson, Apr 8, 2015.

  1. torson

    torson

    Joined:
    Mar 15, 2015
    Posts:
    6
    Hi,
    Thank you for reading this,
    I am an absolutely beginner in Unity, I started to learn unity5 two weeks ago and I really have fun in learning this excellent engine!

    I am a uni student and currently doing a VR project:
    Creating the Japanese artist Yayo Kusama's ''infinity room" in Unity and gonna use Oculus DK2 to experience it in the virtual world.

    If you would like to know what does it look like, here is the link to Kusama's infinity room :



    I have been trying to create the lights effect ( attached screenshots ) but it seems doesn't run well in my 2013 macbook pro retina. It is too laggy when I run this scene in Oculus ! And it runs butter-smooth when I turn all 480 point lights off .
    Screen Shot 2015-04-08 at 10.25.38 pm.png

    Will the particle system helps? I just watched a tutorial but didn't figure out how to create one like this

    Screen Shot 2015-04-08 at 10.39.41 pm.png

    Could anyone please give me some insights in creating this effect?
    It will be much appreciated.

    Tommy
     
  2. El Maxo

    El Maxo

    Joined:
    May 23, 2013
    Posts:
    177
    Lighting in games is quite an expensive thing, just a quick question what frame rate are you running on that scene with the lights tunred off, then we cat start moving from there-
     
  3. wetcircuit

    wetcircuit

    Joined:
    Jul 17, 2012
    Posts:
    1,409
    Lights in 3D are among the most resource-intensive things you can add to a 3D scene.... Particles is definitely the way to go, since there are no mesh objects in your scene that actually need to be lit.
     
  4. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    I think I know how to go about this, but you'll need to answer a question first:
    How big is that room supposed to be?
    Not how large it should feel, but how much the player is actually supposed to be able to walk in there?
     
  5. El Maxo

    El Maxo

    Joined:
    May 23, 2013
    Posts:
    177
    could you use light producing small spheres?
     
  6. torson

    torson

    Joined:
    Mar 15, 2015
    Posts:
    6
    Thank your EI, it is around 30fps if I turn on the lights, and 80fps if I turn off the lights
     
  7. torson

    torson

    Joined:
    Mar 15, 2015
    Posts:
    6
    Yes and I am currently working on Particle system. Thanks !
     
  8. torson

    torson

    Joined:
    Mar 15, 2015
    Posts:
    6
    The room is supposed to be 1m length * 10m * width * 2 height
    and the player will be just walking at normal speed
    plz have a look of youtube link if it still does't make sense
    Thanks for your help!
     
  9. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    Only 1m length? Anyway, you'll need to fake a lot, because realtime raytracing is is still far away. Those mirrors would be quite easy (and cheap) with raytracing.
    Anyway, here's how I would try to do it:

    1. You need a good skybox. This should be the first thing you should do. Pitch black and only very small lights that are far away. The problem is that they will have no depth. Therefore only use it for the lights that are far away.
    You can fake the glass reflections the old way. When you wanted a truly reflective floor in old engines such as Source, what you did was copy the level geometry, flip it, align both halves and make the floor half-transparent. Here is a pic from a tutorial. It's a bit small, but it should give you the idea.

    2. Place the player in a glass room. Make sure the glass has no specular highlight and is completely invisible. Inside this glass box you place detailed lights that the player can walk around and see up close.
    Then you take the box, copy all the lights and place them in boxes on each side (delete the glass boxes though).
    Outside these boxes, place fewer and fewer lights, the further you get away from it.
    You'll have to experiment how far you need to go. Ideally, the skybox and the real lights will blend together.

    Here's a quick and dirty sketch.
    Infinity Room.png
    Be careful!
    This results in 540m³ filled with max. detail, plus more outside those boxes.

    I'd probably create the lights using a small lightbulb model from Blender and an emissive material so they glow. If you make them static, you can take advantage of Unity's batching for better performance.
    That way you'd get less polys than when using Unity's sphere model (which is overkill for such small spheres) and could take advantage of LOD. improving performance even further.