How many lights do you have?

yimmasabiyimmasabi Join Date: 2006-11-03 Member: 58318Members
<div class="IPBDescription">Did u consider this when mapping?</div>Have you ever count lights in your map?

I filter all objects and filter only lights and it says 40 !! This is really bad because my map is not finished yet
and i just optimized ligthts which mean in general I need more.

I'm so serious about those number of lights because this affects game performance due to high calculations.
So for the mid range gfx card maps, maps have to be optimized for this.

I think when I finish my map it will probably have 60 lights aproximetly. This is really huge i think.

In a quick calculation if you have 9 res and 9 tech points, and 2 lights for each, you need (9+9)x2=36 lights.
This is my minimal calculation that we consider those lights also lights corridors :)

What about your lights ?

Comments

  • SgtBarlowSgtBarlow Level Designer Join Date: 2003-11-13 Member: 22749Members, NS2 Developer
    about 40 lights in a tech area and 10/20 in other areas. Im into the 100's in total no performance issues in game.
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    There's no hard and fast limit for this that I'm aware of. For a start, the engine is still undergoing optimisation, something which is probably going to continue for a while. I think it's going to be a case of testing and tweaking as you go along. One thing to note is that shadow-casting lights are a fair bit more expensive, so that would be your first port of call for optimising your lighting.

    So in general I'd get your lighting looking the way you want it, and then optimise and improve it if you think it's impacting performance.
  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    Avoid using too many lights in the same area, avoid using too many lights with lots of coverage, avoid too much overlapping coverage, avoid using shadows where not neccesary.

    Just bear all those in mind when lighting and you will get an efficient lighting setup.
  • TSSTSS Join Date: 2010-05-11 Member: 71716Members
    my single cargoroom must have 75+ lights in it. actually runs a bit smoother then dm_range_2, no matter which wya i look.

    Leaks are your main performance drop. When i finished the room for the screenshots in my thread, i blocked off all the entrances to the room with a face, just to seal off leaks, and performance got lifted by like 10 fps. there's not really a way to check for leaks other then keeping in mind what you did and did not seal off. Any leaks between faces will show up in game (where the reflection seems to go through the roof).

    With no cast shadows on, i think you can make 200 lights an area for about the same performance dev maps will bring (a guesstimate with optimization and the DM_ranges in mind). With cast shadows, i think you'll be around 100. Yeah i know it's high but for some sort of reason i can keep adding stuff in the editor till that runs like crap and ingame it just keeps running smooth.
  • pSyk0mAnpSyk0mAn Nerdish by Nature Germany Join Date: 2003-08-07 Member: 19166Members, NS2 Playtester, Squad Five Silver, NS2 Community Developer
    edited June 2010
    Holy crap, I was just checking for comparison and found 131 lights in my marine spawn, and that doesn't include the open, curved corridor leading to it.
    Only 4 of them casting shadows though and many (probably expendable), with very small radius just illuminating lights on textures further.
    No performance issues so far, dunno about low-spec systems though.

    I only noticed performance issues, when there are too many shadow casting lights.
  • LazerLazer Join Date: 2003-03-11 Member: 14406Members, Contributor, Constellation, NS2 Playtester
    The reason shadow casting lights are so expensive is because it requires the game to render the scene from the perspective of the light into a depth map. By using different matrix transformations you can then take the depth map and the player's view in order to figure out what gets colored with light and what doesn't (where the shadows appear). So you can see this process can be really costly if the scene has to render from many angles per frame (many light sources).

    For lights that don't cast shadows it is just checking the distance each pixel of the texture is from the light source and the dot product between the face and the direction of the light source to give correct intensity.

    Sorry to get so technical figured it's nice to know why one method is so much more costly than the other. This being said I am quite impressed with the way this engine handles lighting as even point lights in theory are quite costly.
  • FehaFeha Join Date: 2006-11-16 Member: 58633Members
    <!--quoteo(post=1775973:date=Jun 24 2010, 12:00 AM:name=Lazer)--><div class='quotetop'>QUOTE (Lazer @ Jun 24 2010, 12:00 AM) <a href="index.php?act=findpost&pid=1775973"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The reason shadow casting lights are so expensive is because it requires the game to render the scene from the perspective of the light into a depth map. By using different matrix transformations you can then take the depth map and the player's view in order to figure out what gets colored with light and what doesn't (where the shadows appear). So you can see this process can be really costly if the scene has to render from many angles per frame (many light sources).

    For lights that don't cast shadows it is just checking the distance each pixel of the texture is from the light source and the dot product between the face and the direction of the light source to give correct intensity.<!--QuoteEnd--></div><!--QuoteEEnd-->

    <3

    I already knew about shadows being expensive and all, but I didnt know how it figured out the intensity (last paragraph). Love to know.

    <!--quoteo(post=1775973:date=Jun 24 2010, 12:00 AM:name=Lazer)--><div class='quotetop'>QUOTE (Lazer @ Jun 24 2010, 12:00 AM) <a href="index.php?act=findpost&pid=1775973"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Sorry to get so technical figured it's nice to know why one method is so much more costly than the other. This being said I am quite impressed with the way this engine handles lighting as even point lights in theory are quite costly.<!--QuoteEnd--></div><!--QuoteEEnd-->

    NOES! I love when it gets technical, thats the fun part of following the progress of ns2 aswell as being on those forums XD.
  • yimmasabiyimmasabi Join Date: 2006-11-03 Member: 58318Members
    <!--quoteo(post=1775973:date=Jun 24 2010, 12:00 AM:name=Lazer)--><div class='quotetop'>QUOTE (Lazer @ Jun 24 2010, 12:00 AM) <a href="index.php?act=findpost&pid=1775973"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->The reason shadow casting lights are so expensive is because it requires the game to render the scene from the perspective of the light into a depth map. By using different matrix transformations you can then take the depth map and the player's view in order to figure out what gets colored with light and what doesn't (where the shadows appear). So you can see this process can be really costly if the scene has to render from many angles per frame (many light sources).

    For lights that don't cast shadows it is just checking the distance each pixel of the texture is from the light source and the dot product between the face and the direction of the light source to give correct intensity.

    Sorry to get so technical figured it's nice to know why one method is so much more costly than the other. This being said I am quite impressed with the way this engine handles lighting as even point lights in theory are quite costly.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Thanks, that is why I'm so serious about this.
  • ThaldarinThaldarin Alonzi&#33; Join Date: 2003-07-15 Member: 18173Members, Constellation
    Here's a top down of one of my style test levels:

    <img src="http://imgur.com/rHap0.jpg" border="0" class="linked-image" />

    To me 75 lights seems excessive, when I actually look at it now.
  • LazerLazer Join Date: 2003-03-11 Member: 14406Members, Contributor, Constellation, NS2 Playtester
    The engine is not going to render every light in your map at all times. It is only going to deal with the lights you can currently see from the player's perspective. Also, when dealing with shadow casting lights, currently they appear as non shadow casting lights until you get close enough for the engine to start displaying them as shadow casting. So the only real concern here is how many light sources do you have on screen at once when in game, not how many in total.
  • w0dk4w0dk4 Join Date: 2008-04-22 Member: 64129Members, Constellation, Reinforced - Shadow
    <!--quoteo--><div class='quotetop'>QUOTE </div><div class='quotemain'><!--quotec-->This being said I am quite impressed with the way this engine handles lighting as even point lights in theory are quite costly.<!--QuoteEnd--></div><!--QuoteEEnd-->

    Ever heard about deferred rendering? ;)
    But yeah, if you're speaking of point lights casting shadows, you are right.
  • LazerLazer Join Date: 2003-03-11 Member: 14406Members, Contributor, Constellation, NS2 Playtester
    <!--quoteo(post=1776209:date=Jun 26 2010, 07:52 AM:name=w0dk4)--><div class='quotetop'>QUOTE (w0dk4 @ Jun 26 2010, 07:52 AM) <a href="index.php?act=findpost&pid=1776209"><{POST_SNAPBACK}></a></div><div class='quotemain'><!--quotec-->Ever heard about deferred rendering? ;)
    But yeah, if you're speaking of point lights casting shadows, you are right.<!--QuoteEnd--></div><!--QuoteEEnd-->
    Well yes but I haven't actually implemented it before so I was a bit unfamiliar however I can see this must be what they are doing. Makes a lot more sense now how the engine handles so many lights at once so easily.
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    It is a deferred renderer. That, however, is more or less the limit of my technical knowledge of rendering techniques.
  • pSyk0mAnpSyk0mAn Nerdish by Nature Germany Join Date: 2003-08-07 Member: 19166Members, NS2 Playtester, Squad Five Silver, NS2 Community Developer
    Talking about many lights; are there some hints how to use this new ambient-light properly?

    It seems a lot of work to adjust the 6 colors properly and the whole thing seems very inflexible to me considering that you only have one brightness, which means you have to use proper colors to adjust brightness for different directions. The basic color (not the directions) doesn't seem to work either.
    Moreover, unless I screwed up somewhere, I noticed that additional of those special lights don't work, if they overlap?!?

    I get far better results with placing omnis all over a location with different color and brightness depending on the environment, so I'm wondering if I miss something.
  • Chris0132Chris0132 Join Date: 2009-07-25 Member: 68262Members
    You probably will get better results like that, however I would expect the ambient would be far more efficient performance wise, which would be the main point of using it.
  • morbidarmorbidar Join Date: 2010-07-22 Member: 72660Members
    Theoretically the game shouldn't be rendering what you cannot see to begin with so as far as that goes you could have many lights all over because when in one room you might only see the second room and its lighting from that point but anywhere else is being ignored.
  • spellman23spellman23 NS1 Theorycraft Expert Join Date: 2007-05-17 Member: 60920Members
    Yeah, but overdoing it in terms of lights/volume can really strain stuff.

    However, at this point, it's hard to get good performance numbers. So, the real answer is as many lights as needed to make it look good!!!
  • MastoriatMastoriat Join Date: 2010-06-30 Member: 72212Members
    *agree*
    the only thing you need to remember is, that you have to work with layer's. Otherwise your performance in the editor is just horrible. Ingame i didn't realized any performance issues with few or many lights.
  • yimmasabiyimmasabi Join Date: 2006-11-03 Member: 58318Members
    btw commander view of tram map shows more than 400 lights in a partial view.

    That is really WOWWWWWWWWWWW !!

    I just wonder how monay total light did it have?
Sign In or Register to comment.