Light Strategies in Luxcore

User avatar
sigstan
Posts: 416
Joined: Sat Jan 24, 2015 3:59 pm
Location: Denmark

Light Strategies in Luxcore

Postby sigstan » Sun Jul 03, 2016 3:12 pm

The accelerated modes in Reality are provided by the new Luxcore engine, which has many differences from the original Luxrender engine (classic Luxrender). One of these differences is in the area of light strategies. Luxcore has several different light strategies that can have a huge impact on how your scene renders.

Therefore you should consider the impact of the Luxcore light strategy, especially when rendering a scene in accelerated modes that includes emission materials, objects turned into light or just a lot of lights with different power settings. I hope that this little mini-guide can help you in this area.

PDF
This guide has been converted to PDF, if you prefer this format.
Luxcore_light_strategies_v1.pdf
(633.06 KiB) Downloaded 313 times


Luxcore Light Strategies
Luxcore (all accelerated modes) basically has 3 light strategies available:
  • UNIFORM
  • POWER
  • LOG_POWER
UNIFORM
The light strategy is to randomly pick one light to sample. This means all lights are assigned same priority regardless of light power.

POWER
The light strategy is to randomly pick one light to sample with a probability proportional to the light power. This means the most powerful lights are prioritized over weak lights.

LOG_POWER
The light strategy is to randomly pick one light to sample with a probability proportional to the logarithm of light power. This means Luxcore will tend to prioritize weak lights to avoid oversampling powerful lights and under sampling weak lights.

How To Change the Light Strategy
Changing the Luxcore light strategy is currently not supported by Reality and therefore you have to perform a manual change. The best way to go about is outlined here:

1) Create your scene
2) Tick the "Export Only" box on the Render -> Output tab
3) Modify the *.lxs file using the below specified changes
4) Load the scene in Luxrender for rendering

In the *.lxs file you will need to modify this section:

Code: Select all

Renderer "luxcore" "string config" [
  "renderengine.type = PATHCPU"
  "accelerator.type = EMBREE"   
]


To this:

Code: Select all

Renderer "luxcore" "string config" [
  "renderengine.type = PATHCPU"
  "accelerator.type = EMBREE"
  "lightstrategy.type = <strategy>"   
]

Where <strategy> should be replaced with either POWER, UNIFORM or LOG_POWER.

How To Select The Right Light Strategy
In a lot of cases "LOG_POWER" will be the right selection (that is why it is the default), so you should only consider changing light strategy, if you are experiencing issues that cannot be solved by other means like changing gain, exposure etc.

To select an alternative light strategy you basically need to look at your scene and decide what the primary lights should be, and then select the light strategy that prioritizes those lights.

LOG_POWER
Kind of the auto selection, since it will try to create a balance between the powerful and the weak light sources. If the number of weak light sources outnumbers the powerful light sources by a large number then balance will be skewed and lighting will suffer. This is the default for Luxrender.

POWER
Works best when you want the most powerful lights to be the primary ones

UNIFORM
All lights are equally prioritized. In my opinion the least useful light strategy. I have yet to find a situation where this is the better choice.

Practical Examples
While the above sounds easy it is not always as straight forward, so I will give a couple of examples:

Sunlight and many weak light sources.
You should change light strategy to "POWER"
The Sun is the most powerful light source and the default "LOG_POWER" will prioritize the weak light probably causing the scene to be under-lit.

A couple of big mesh lights and a lot of small weak light sources
"POWER" light strategy is most likely the best option.
Think about a dark sci-fi hallway with a few big main lighting panels and lots of small LEDs. The LEDs would be prioritized using "LOG_POWER", but even though there are many of them, they are not the primary lights and they are not expected to provide a lot of illumination. The individual relationship between the main light panels and the LEDs can be handled with gain.

Torches or candles plus a few mesh lights
"POWER" light strategy is most likely the best option.
since the mesh lights probably will provide the main lighting. Torches and candles are typically meshes with emissive materials or meshes converted to light. Depending on the number of faces involved this will create a lot of small weak lights, which would be prioritized by "LOG_POWER" causing bad lighting and a lot of grain.

Show case
To illustrate the differences in light strategies I have made a small example scene with a ground plane, a single meshlight and a single sphere (4512 polys) with an emission material (gain 0.050000). The scene was rendered using the three different light strategies, but otherwise using same rendering options and halting at 1000 spp.

My expectations for this scene:
The mesh light should be the primary light providing an even light on the plane, while the sphere should just look illuminated.

You will need to click the pictures in order to see the differences clearly.

"LOG_POWER"
Emissive_log_power.jpg

Not really good. Notice the level of graininess, which is caused by the prioritizing the many weak light faces in the sphere.

"POWER"
emissive_power.jpg

Here the mesh light is prioritized as it should and the graininess is gone.

"UNIFORM"
Emissive_uniform.jpg

Both mesh light and sphere light are prioritized. Since there are many weak lights and only one powerful light, the balance is still skewed. Better than "LOG_POWER", but not that much.
Last edited by sigstan on Wed Jul 13, 2016 6:43 pm, edited 15 times in total.
/Sigstan

User avatar
Marcel2586
Posts: 413
Joined: Sat Mar 05, 2016 7:42 am

Re: Light Strategies in Luxcore

Postby Marcel2586 » Sun Jul 03, 2016 3:17 pm

Great! thank you!
this would be funny if it weren't happening to me :shock:

User avatar
Nathanomir
Posts: 135
Joined: Tue Mar 01, 2016 9:52 am
Location: North Texas
Contact:

Re: Light Strategies in Luxcore

Postby Nathanomir » Sun Jul 03, 2016 8:57 pm

Excellent! Thank you.
Sometimes, my wife wakes up grumpy. Sometimes, she lets me sleep.

User avatar
Nathanomir
Posts: 135
Joined: Tue Mar 01, 2016 9:52 am
Location: North Texas
Contact:

Re: Light Strategies in Luxcore

Postby Nathanomir » Mon Jul 04, 2016 3:33 pm

I threw together a quick test to test this strategy on one of my favorite props from the R2.5 era -- the candle from Faveral's Medieval Tavern. Unlike most 3D candlemakers, he uses a mesh prop for the flame instead of a plane with a transmap. It was easy to convert it to a mesh light and get great ambiance. Lux 1.5 didn't much like it. The mesh slogged down the render time, overriding any increase in speed, and causing massive grain.

Using the above light strategy, and adding the POWER line, this is the result at only 100 s/P (five minutes). At the last second, I threw in some candle glow in Lux.

Image

Lights are just the candle with the flame turned into a mesh light, and one of Lee's IBL spots. The scatter is expected from a scene that is only partially cooked. But overall, it looks like the Medieval Tavern candle is back in action.

So, thank you again, Sigstan!
Sometimes, my wife wakes up grumpy. Sometimes, she lets me sleep.

User avatar
sigstan
Posts: 416
Joined: Sat Jan 24, 2015 3:59 pm
Location: Denmark

Re: Light Strategies in Luxcore

Postby sigstan » Sat Jul 09, 2016 3:45 pm

Nathanomir wrote:Using the above light strategy, and adding the POWER line, this is the result at only 100 s/P (five minutes). At the last second, I threw in some candle glow in Lux.

So, thank you again, Sigstan!

You're welcome.

Actually I originally had the same problems as you with candle light in accelerated modes and that is why I started looking for a solution. But it took me some time, before realizing that it was Luxcore light strategy causing the issue.
/Sigstan

Fatbear
Posts: 25
Joined: Wed Mar 09, 2016 1:32 pm

Re: Light Strategies in Luxcore

Postby Fatbear » Wed Jul 13, 2016 4:24 am

Amazing info, thanks!

User avatar
sigstan
Posts: 416
Joined: Sat Jan 24, 2015 3:59 pm
Location: Denmark

Re: Light Strategies in Luxcore

Postby sigstan » Wed Jul 13, 2016 6:44 pm

I have added a PDF version of the guide to the original post.
/Sigstan

SamWM
Posts: 18
Joined: Sat Jul 09, 2016 8:42 am

Re: Light Strategies in Luxcore

Postby SamWM » Mon Jul 18, 2016 5:25 pm

Just a quick question - could you change the light strategy on an already partly rendered file? For instance, do uniform for an hour or so, then change to one of the others? Perhaps for doing a test to see which lights you may want to use for a long render in case you aren't quite sure what to start with, or perhaps just for creative effect

pciccone
Site Admin
Posts: 1720
Joined: Mon Feb 25, 2013 6:25 pm

Re: Light Strategies in Luxcore

Postby pciccone » Mon Jul 18, 2016 5:31 pm

Nope, if you change strategy then you need to restart.
--
Paolo

User avatar
Kimberly58
Posts: 206
Joined: Sun Apr 27, 2014 12:52 am

Re: Light Strategies in Luxcore

Postby Kimberly58 » Sun Jul 24, 2016 10:45 am

I have another question, and I'm pretty sure the answer is no, you need to start over. I have a scene that I let render over night only to find I had something I need to modify in the scene. Will I need to export the the .lxs file again and change the light strategy, or will it keep the change since I'm not re naming the file?


Return to “Tips, techniques, and recipes”

Who is online

Users browsing this forum: No registered users and 1 guest