Understanding Iray lights

SotoSoto Posts: 1,450

Hi!

I have a simple aproach when rendering. IBL+mesh lights, so I have never paid attention to how everything really works but now I want to know some basic things.

  1. Are regular photometric lights faster than mesh lights?
  2. A point light set to "sphere" in the "light geometry" options is slower than "point"? What`s the difference? Same or faster than a sphere mesh light?
  3. The more polygons on a mesh light, the slower the render?
  4. A bright scene will render faster than a dark one?

Thanks!

«1

Comments

  • mjc1016mjc1016 Posts: 15,001
    edited October 2016

    1, 3, and 4, kind of...yes.

    In general, photometric lights are faster, but with very simple geometry (single poly planes) there's not much of a difference. 

    2.  No, there's no noticeable difference when switching the geometry type.  And they are a point set to sphere is going to be noticeablye faster than even the lowest poly sphere.

    The kind of on 4...it depends on a couple of factors...one of which is the NUMBER of lights.  More light (overall) generally means faster renders, but if that is acheived by adding a bunch of 'lamps', then no, there won't be a benefit.

    Post edited by mjc1016 on
  • SotoSoto Posts: 1,450

    Thank you! That`s exactly what I needed to know! laughyes

  • ArtiniArtini Posts: 10,311

    The mesh lights can be instanced and that opens the possibility to have many mesh lights in the scene without increasing render time significantly.

     

  • 3Diva3Diva Posts: 11,973
    Artini said:

    The mesh lights can be instanced and that opens the possibility to have many mesh lights in the scene without increasing render time significantly.

     

    How do you do that?

  • nicsttnicstt Posts: 11,715
    Artini said:

    The mesh lights can be instanced and that opens the possibility to have many mesh lights in the scene without increasing render time significantly.

     

    How do you do that?

    Create > New Node (Instance or Instances)

  • ArtiniArtini Posts: 10,311
    edited October 2016

    ... or one can use UltraScatter: http://www.daz3d.com/ultrascatter-advanced-instancing-for-daz-studio

    Below is an example Daz Studio iray render of 51 lamps, each lamp has 3 bulbs, so there are 153 mesh lights in the scene.

    Rendering time was 2 hours in CPU only mode (i7 860 @ 2.93 GHz).

    image

    Lights104pic03.jpg
    1280 x 1024 - 217K
    Post edited by Artini on
  • pdspds Posts: 593

    Hmmm...I'm not sure why instancing mesh lights would cut down substantially on render time; isn't the reason higher poly mesh lights take longer to render because there are that many more surfaces to calculate the light emissions/interactions from? It seems as though instancing is like using a mirror--you don't amass the overhead of real geometry of lots of duplicate objects, but if I have a single light source and reflect it off multiple mirrors, wouldn't the calculations of all those light particles bouncing around be just as taxing as if I had multiple lights instead?

  • SotoSoto Posts: 1,450

    I`m wondering the same thing... How instancing works here? Doen`t Iray still have to calculate each light source (polygon)?

  • mjc1016mjc1016 Posts: 15,001

    I'm not sure how much it will matter, but you will get the geometry reduction benefit...I guess some timing tests are in order, but just using 'logic' says that while you will speed some things up, it won't be as much as not using them/using other lights.  Although one big advantage may be that it will allow the render to proceed as a GPU render, instead of being dumped to CPU only, due to the reduction in memory used because of the lower geo count.

  • fastbike1fastbike1 Posts: 4,078

    Still, unlike 3DL, Iray tends to render faster with more lights than with fewer.

  • SickleYieldSickleYield Posts: 7,649
    edited October 2016

    I'm deeply interested in the mesh instancing question, so I created this test scene to check in a repeatable way.

    It uses only free content from Daz and primitive spheres as mesh lights.  They are grouped as single (the actual mesh light), 10 instances and 50 instances.  Turning a group to invisible removes its lights from the scene.

    My results were (2x GTX 980, 2x GTX 740):

    Single mesh light: 25 sec

    Single mesh light +10 instances: 40 sec

    Single mesh light +50 instances: 1 min 21 sec

    Surprisingly, instances of a mesh light appear to be treated as lighted geometry and multiplied accordingly.  I would love for anyone to confirm or replicate these results.

    Post edited by SickleYield on
  • SickleYieldSickleYield Posts: 7,649

    P.S., if there's interest I could also create a photometric version to test comparative times on that.

  • barbultbarbult Posts: 26,235
    edited October 2016

    I rendered each scene twice. Here are the results. I have one GTX 980 Ti. It also drives my monitor. I rendered with Daz Studio 4.9.3.71 Public Beta.

    Single Mesh:
    2016-10-11 23:06:00.413 Total Rendering Time: 29.54 seconds
    2016-10-11 23:08:01.485 Total Rendering Time: 29.64 seconds

    Single Mesh Light + 10 Instances:
    2016-10-11 23:09:28.303 Total Rendering Time: 38.11 seconds
    2016-10-11 23:10:52.639 Total Rendering Time: 37.37 seconds

    Single Mesh Light + 50 Instances:
    2016-10-11 23:46:48.917 Total Rendering Time: 1 minutes 40.15 seconds
    2016-10-11 23:49:33.381 Total Rendering Time: 1 minutes 40.38 seconds

    Single Mesh Light + 10 Instances + 50 Instances:
    2016-10-11 23:13:28.437 Total Rendering Time: 1 minutes 47.13 seconds
    2016-10-11 23:18:57.492 Total Rendering Time: 1 minutes 46.28 seconds

    Post edited by barbult on
  • SickleYieldSickleYield Posts: 7,649

    Thank you!  Could you do one for Single Mesh Light +50 without the 10 so we can compare?

  • barbultbarbult Posts: 26,235

    Thank you!  Could you do one for Single Mesh Light +50 without the 10 so we can compare?

    Oops. I didn't read carefully. I redid the test with Single + 50 and edited the post above.

  • SickleYieldSickleYield Posts: 7,649
    edited October 2016

    Thank you!

    If anything it's also an excellent remind of why more graphics cards are not a great investment for Iray (something we did not know yet when I bought mine).  It will use the additional cards a little, but the time saved beyond the first one isn't that much when you consider how much the cards cost.  When the 1080's become Iray compatible I will only get one.

    Post edited by SickleYield on
  • barbultbarbult Posts: 26,235
    edited October 2016

    I thought it was strange that my Single Mesh + 10 Instances was less time than yours. I closed DS, reopened the scene and made sure I had the correct things on. Then I ran it again. I got 2016-10-11 23:55:09.918 Total Rendering Time: 39.1 seconds. So it is fairly consistent. I only have 1 card and you have 4 cards. What do you think is going on? It is taking most of the time to load the scene into 4 different cards on yours?

    Edit: Oh, you addressed this question even before I asked it.

    Post edited by barbult on
  • SickleYieldSickleYield Posts: 7,649

    Very likely.  It's not a big bottleneck, but it's there.  If we ran just the Single Mesh +10 instances again at 1500x1500 the time ratio might differ, want to try it?

  • barbultbarbult Posts: 26,235
    edited October 2016

    I will try it and post the results in this message.

    Single Mesh + 10 Instances rendered at 1500 by 1500 pixels on GTX 980 Ti. DS 4.9.3.71 Public Beta.

    2016-10-12 00:12:06.034 Total Rendering Time: 5 minutes 9.18 seconds

    Now we are seeing that your multiple cards are quite a benefit.

    Post edited by barbult on
  • SickleYieldSickleYield Posts: 7,649

    I went again at 1500x1500 with the same scene (again, all four cards, Single Mesh Light + 10 instances) and got a time of 3 minutes 50 seconds.

  • barbultbarbult Posts: 26,235

    I put my results in the message above.

    What are your results for 1500 by 1500 if you select just a single 980 and nothing else in your Render Settings?

  • SickleYieldSickleYield Posts: 7,649

    With just the one 980 (it's not a TI, just a regular GTX 980 with 2048 CUDA cores and 4gb memory) at 1500x1500 with a single mesh light and 10 instances I have a time of 7 minutes 15 seconds.

    This strikes me as odd.  Given we both have CPU off for this one the TI should be faster, shouldn't it?  Do you have OptiX Acceleration off or something?

  • pdspds Posts: 593

    I'm curious what results you would get if you used all mesh lights and no instances. I suspect the render times wouldn't change much since the math to calculate each pixel should be the same regardless of mesh vs. instance. If that turns out to be the case, then I'd say with sufficient memory headroom to handle the geometry, there's no significant benefit to using instanced mesh lights in terms of render performance. As mjc1016 points out, it seems as though the main benefit would be to help keep bigger scenes from falling back to CPU rendering, which is certainly a good thing. And I suppose another benefit would be that if you wanted a bunch of lights to have the same properties, then instances would make it much faster to manage them all.

  • barbultbarbult Posts: 26,235

    With just the one 980 (it's not a TI, just a regular GTX 980 with 2048 CUDA cores and 4gb memory) at 1500x1500 with a single mesh light and 10 instances I have a time of 7 minutes 15 seconds.

    This strikes me as odd.  Given we both have CPU off for this one the TI should be faster, shouldn't it?  Do you have OptiX Acceleration off or something?

    Mine was faster (unless I'm misreading something again) Total Rendering Time: 5 minutes 9.18 seconds.

  • ToborTobor Posts: 2,300

    Instancing won't help with light exitance calculations. Those are made per surface. Instances only replicate the mesh to make for a smaller scene database, as noted in some of the posts above.

    Most people use mesh lighting as light sources; any test should replicate this use-case, rather than simply making a geometry nominally emissive. Render times are dictated by light path tracing, so the more the geometry actually lights the scene, and objects in the scene interact with one another (including floor, walls, etc.), the more accurate the benchmark for real-world rendering.

    The number of CUDA cores non-geometrically influences render times. A rig with 1000 cores will not simply be twice as fast as one with 500 cores, though this also depends on the specific architecture of the card(s). 

    It's important to also consider the quality of the light, which should dictate the choice. It's not simply a technical rendering matter. Unless you use an IES profile, mesh lights produce a diffuse lighting. This can alter the appearance of light and shadow. These things are, after all, what we're rendering.

  • kaotkblisskaotkbliss Posts: 2,914
    pds said:

    I'm curious what results you would get if you used all mesh lights and no instances. I suspect the render times wouldn't change much since the math to calculate each pixel should be the same regardless of mesh vs. instance. If that turns out to be the case, then I'd say with sufficient memory headroom to handle the geometry, there's no significant benefit to using instanced mesh lights in terms of render performance. As mjc1016 points out, it seems as though the main benefit would be to help keep bigger scenes from falling back to CPU rendering, which is certainly a good thing. And I suppose another benefit would be that if you wanted a bunch of lights to have the same properties, then instances would make it much faster to manage them all.

    I was going to ask the same question, what is the time of 11 mesh lights, vs 1 mesh light and 10 instances?

  • SickleYieldSickleYield Posts: 7,649
    barbult said:

    With just the one 980 (it's not a TI, just a regular GTX 980 with 2048 CUDA cores and 4gb memory) at 1500x1500 with a single mesh light and 10 instances I have a time of 7 minutes 15 seconds.

    This strikes me as odd.  Given we both have CPU off for this one the TI should be faster, shouldn't it?  Do you have OptiX Acceleration off or something?

    Mine was faster (unless I'm misreading something again) Total Rendering Time: 5 minutes 9.18 seconds.

     

    Aha!  Well that makes more sense!

     

    And LOL, Kaotkbliss.  If you think I'm even going to attempt that you're crazy.  I'm doing this in between work, I don't have the two hours it took Artini.

  • kaotkblisskaotkbliss Posts: 2,914

    And LOL, Kaotkbliss.  If you think I'm even going to attempt that you're crazy.  I'm doing this in between work, I don't have the two hours it took Artini.

    I was wondering where that straightjacket came from...

  • SickleYieldSickleYield Posts: 7,649

    And LOL, Kaotkbliss.  If you think I'm even going to attempt that you're crazy.  I'm doing this in between work, I don't have the two hours it took Artini.

    I was wondering where that straightjacket came from...

    Hey look, mine matches!

  • NovicaNovica Posts: 23,924

    Depending on the cost, if I am understanding you are using one versus four? -  It's not enough benefit to pay for all those cards! About 4 minutes vs 5 minutes? (Or as usual, am I missing something here?) 

Sign In or Register to comment.