Env. Light Visibility Cache

Discussion related to the LuxCore functionality, implementations and API.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Env. Light Visibility Cache

Post by Dade »

lacilaci wrote: Thu Jul 25, 2019 11:54 am I tried to replicate the crashes with a basic scene and I cannot get it to completely stuck, but this one does crash:
279_luxcore2.blend

This happens when I add glass in the scene (note that when I added object with glass to new - fully open scene just with hdri, it didn't crash)

EDIT: this one actually does aswell lock up system when I disable cpu in OCL devices. Otherwise just crashes with exception. Both happen at "starting # native threads"
It was a specific constant infinite light problem (i.e. not affecting infinite light and sky2). I should have fixed the problem.
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Env. Light Visibility Cache

Post by Dade »

lacilaci wrote: Thu Jul 25, 2019 10:31 am Not happy about the broken rendering region, hopefuly it can be fixed in the future.
As simple work around:

- run a full image rendering and check the log for the suggested radius:

Code: Select all

[LuxCore][0.466] EnvLightVisibilityCache evaluating best radius
[LuxCore][0.621] EnvLightVisibilityCache best cache radius: 2.01994
- explicit use the suggested values (instead of the default 0.0) to disable automatic radius evaluation (i.e. the source of the problem with border rendering).

- border rendering will than work fine.
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Env. Light Visibility Cache

Post by Dade »

@B.Y.O.B: what is the default "visibilitymapcache.map.samplecount" in Blender ? The default in LuxCore has changed over time. I noticed, in the scenes posted here, this kind of setup:

Code: Select all

scene.lights.__WORLD_BACKGROUND_LIGHT__.visibilitymapcache.map.width = 256
scene.lights.__WORLD_BACKGROUND_LIGHT__.visibilitymapcache.map.height = 128
scene.lights.__WORLD_BACKGROUND_LIGHT__.visibilitymapcache.map.samplecount = 4
This one is better while requiring exactly the same pre-processing time (but using 4x memory):

Code: Select all

scene.lights.__WORLD_BACKGROUND_LIGHT__.visibilitymapcache.map.width = 512
scene.lights.__WORLD_BACKGROUND_LIGHT__.visibilitymapcache.map.height = 256
scene.lights.__WORLD_BACKGROUND_LIGHT__.visibilitymapcache.map.samplecount = 1
It is probably better to set the "visibilitymapcache.map.samplecount" to 1 because, if you have the free memory, it is always better to use an higher map resolution than more samples per pixel.

The later is also the current LuxCore default values.
Support LuxCoreRender project with salts and bounties
User avatar
B.Y.O.B.
Developer
Developer
Posts: 4146
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: Env. Light Visibility Cache

Post by B.Y.O.B. »

I have updated the defaults to be the same as in LuxCore.
I started to look into the screenwindow -> subregion issue, but I'm not done with it yet.
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Env. Light Visibility Cache

Post by lacilaci »

So I did a quicktest on few scenes this morning. It works, no more crashing and freezing.

I might post some pictures later(away from pc now).
But overall this kinda works.

Several big openings in scene will bring the env.cache map performance down, almost the same as if none vis.map is used, but still better on some areas though.

There are no artifacts that I noticed, however the objects that before had artifacting on them are still sampled way worse than other objects in the scene.

This introduces quite big differences on noise levels in the image, where some objects are clean and some are noisy.

It is far better than the old single map it seems, but still not as good and problem free as portals.
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Env. Light Visibility Cache

Post by Dade »

I have added the support for persistent cache file, it works exactly like PhotonGI persistent file. The property to set the file is:

Code: Select all

scene.lights.__WORLD_BACKGROUND_LIGHT__.visibilitymapcache.persistent.file = cache.elv
The file is created if doesn't exist and loaded if it does.
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Env. Light Visibility Cache

Post by Dade »

Going to remove single map env. light visibility cache, if anyone has a reason to keep it, speak now or forever hold your peace.
Support LuxCoreRender project with salts and bounties
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Env. Light Visibility Cache

Post by lacilaci »

Hm, if the single map option will be removed and defaults for env.cache don't need changing (I haven't seen much reason to change the settings)...

Maybe in blender it would make sense to turn it into a simple checkbox in render settings, maybe even give it appropriate name like "autoportals" and tooltip about what it actually is and when to use?

Reason why I'm suggesting name change is that new users will be looking for portal I assume.

Hm, now that I think about it, an appropriate name and the fact that it would be checkbox would make this setting suitable even for world settings, if on visible spot. So that people don't turn it on when not using any hdri/env light.

EDIT:

In one of my scenes I do run out of memory though with the new default map size of 256 for env cache.
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Env. Light Visibility Cache

Post by lacilaci »

Is there some threshold for glossy objects with this? very glossy objects render incredibly noisy, pretty much as if no visibility map is used.

single map:
singlemap.jpg
cache:
cache.jpg
none map:
nomap.jpg
the sink is just a plain glossy material no texture nothing special and object has correct normals and clean topology...
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: Env. Light Visibility Cache

Post by Dade »

lacilaci wrote: Mon Jul 29, 2019 9:23 am Is there some threshold for glossy objects with this? very glossy objects render incredibly noisy, pretty much as if no visibility map is used.
Yes, like PhotonGI, there is a ".visibilitymapcache.visibility.glossinessusagethreshold" to set the glossy threshold.
Support LuxCoreRender project with salts and bounties
Post Reply