Performance cost of a black constantinfinite light

Discussion related to the LuxCore functionality, implementations and API.
User avatar
B.Y.O.B.
Developer
Posts: 3553
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Performance cost of a black constantinfinite light

Post by B.Y.O.B. » Sun May 10, 2020 2:10 pm

To make my life easier in the addon, I am considering to add a black constantinfinite light (always) in order to fix problems caused by the runtime error LuxCore throws when there are no light sources in the scene.

Would this be detrimental to performance, or would this light just never be sampled by the light strategy anyway?
I'd set importance to 0 to account for the uniform light strategy.

Or would you prefer that I remove the runtime error in LuxCore and take care that everything still works with 0 lights?

User avatar
Dade
Developer
Posts: 4218
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Performance cost of a black constantinfinite light

Post by Dade » Sun May 10, 2020 4:48 pm

B.Y.O.B. wrote:
Sun May 10, 2020 2:10 pm
To make my life easier in the addon, I am considering to add a black constantinfinite light (always) in order to fix problems caused by the runtime error LuxCore throws when there are no light sources in the scene.

Would this be detrimental to performance, or would this light just never be sampled by the light strategy anyway?
I'd set importance to 0 to account for the uniform light strategy.
It is horrible, don't.
B.Y.O.B. wrote:
Sun May 10, 2020 2:10 pm
Or would you prefer that I remove the runtime error in LuxCore and take care that everything still works with 0 lights?
What is exactly the point in rendering a pitch black image ? Albedo AOV ?
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 3553
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Performance cost of a black constantinfinite light

Post by B.Y.O.B. » Sun May 10, 2020 5:00 pm

The main problem is when the runtimeerror is thrown when scene editing, on calling EndSceneEdit().
It is annoying to handle and even if it succeeds, it stops the whole rendering just because the user has hidden the only light source for a brief moment.
Getting a black render result would be much more convenient than an error message.

User avatar
Dade
Developer
Posts: 4218
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Performance cost of a black constantinfinite light

Post by Dade » Sun May 10, 2020 11:32 pm

B.Y.O.B. wrote:
Sun May 10, 2020 5:00 pm
The main problem is when the runtimeerror is thrown when scene editing, on calling EndSceneEdit().
It is annoying to handle and even if it succeeds, it stops the whole rendering just because the user has hidden the only light source for a brief moment.
Getting a black render result would be much more convenient than an error message.
But why to even start exporting the scene if there are no lights ? Can't you show a message/warning/error before start ?
Support LuxCoreRender project with salts and bounties

User avatar
B.Y.O.B.
Developer
Posts: 3553
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Performance cost of a black constantinfinite light

Post by B.Y.O.B. » Sun May 10, 2020 11:36 pm

I meant that a viewport render is started with lights, but then the user for example enters local view on one object (which effectively removes all other objects and lights), or the user deletes the only light in the scene (e.g. to replace it with another).
Of course nobody would render a black viewport for an extended period of time, but during work it can sometimes happen that there are no lights in the scene for a few moments.

For final renders, I could still get the number of lights from the LuxCore API and show a warning if it is 0.

juangea
Donor
Posts: 132
Joined: Thu Jan 02, 2020 6:23 pm

Re: Performance cost of a black constantinfinite light

Post by juangea » Mon May 11, 2020 7:18 am

I agree with B.Y.O.B.

We need to be able to render a scene without lights, we may start in the dark, then add a light, then hide that light, add another one, and while usually you won’t be hiding all your lights, it’s possible that at a given point in time you do so, and that should not break or stop the render.

@B.Y.O.B. Maybe add an environment internally when there are no lights at all? A Black one, but like an HDRI, not sure if it’s the same you are proposing.

kintuX
Posts: 558
Joined: Wed Jan 10, 2018 2:37 am

Re: Performance cost of a black constantinfinite light

Post by kintuX » Mon May 11, 2020 9:57 pm

Ho about a "Default Light" solution (like in C4D, Houdini...)?
No pitch black export or infinite black light or error report, but instead auto-created point light relative to where the camera/ viewpoint is. And, if possible, with custom setting (basically "use a light" from referenced/ linked scene).

juangea
Donor
Posts: 132
Joined: Thu Jan 02, 2020 6:23 pm

Re: Performance cost of a black constantinfinite light

Post by juangea » Tue May 12, 2020 6:37 am

But it’s important to be able to have a pitch black scene, we don’t want a default light, at least we don’t want it, but may be an option to you or others, I always hated the default lights from 3Ds Max in the old days

kintuX
Posts: 558
Joined: Wed Jan 10, 2018 2:37 am

Re: Performance cost of a black constantinfinite light

Post by kintuX » Tue May 12, 2020 1:33 pm

Honestly, I see no sense in having a pitch black scene. Please, enlighten me - what's your point?
Cuz' you can have a Default Light (preset scene) with 0.0001 light intensity (i.e. that 0.0 causes an error), if that's what you seek for. IMHO this seems the simplest way to prevent a whole new clusterfuck (Pardon my English.) in the code base while giving more power to the user (advancing and customizing its own tool set).

User avatar
B.Y.O.B.
Developer
Posts: 3553
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Performance cost of a black constantinfinite light

Post by B.Y.O.B. » Tue May 12, 2020 1:41 pm

Detecting in the addon if a runtime error about missing light sources will be thrown is not easy, it is exactly this complexity that I want to avoid.

I will not add default lights.
Anyway, it would be a decision to be made in each individual addon/plugin integration, not on LuxCore level.
kintuX wrote:
Tue May 12, 2020 1:33 pm
Honestly, I see no sense in having a pitch black scene. Please, enlighten me - what's your point?
B.Y.O.B. wrote:
Sun May 10, 2020 11:36 pm
I meant that a viewport render is started with lights, but then the user for example enters local view on one object (which effectively removes all other objects and lights), or the user deletes the only light in the scene (e.g. to replace it with another).
Of course nobody would render a black viewport for an extended period of time, but during work it can sometimes happen that there are no lights in the scene for a few moments.
It would be very confusing for users if they disable a light for a second only to have a "default light" flash on out of nowhere, then vanish again once another light is enabled.

Post Reply