Env. Light Visibility Cache

Discussion related to the LuxCore functionality, implementations and API.
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Env. Light Visibility Cache

Post by lacilaci »

Dade wrote: Sun Jul 21, 2019 12:50 pm I added the OpenCL support for Env. Light Visibility Cache, it now works with GPUs too.

P.S. 3 days to find a damn bug (who ended to be not related to Env. Light Visibility Cache at all) :roll:
will give it some proper testrun tomorrow...
fingers crossed
zuljin3d
Posts: 76
Joined: Sun Apr 08, 2018 12:13 pm
Location: Moscow

Re: Env. Light Visibility Cache

Post by zuljin3d »

Tried the last build.

Does the cache work by default? No need to choose options here?
Image

Feels like noise disappears quickly. 8-)


But if you add normal map to the material,luxcore produces an error: "PathOCLBase kernel compilation error".

last nvidia driver gtx960 BlendLuxCore 2_79_maintenance (light tracing)
Attachments
1 Min render
1 Min render
Actualy sorry for my google translate english :)
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. »

zuljin3d wrote: Sun Jul 21, 2019 6:37 pm Does the cache work by default? No need to choose options here?
No, you have to go into the world settings, performance panel, and switch the map type from "single" to "cache".
zuljin3d wrote: Sun Jul 21, 2019 6:37 pm But if you add normal map to the material,luxcore produces an error: "PathOCLBase kernel compilation error".
Can you post the full log with the traceback?
zuljin3d
Posts: 76
Joined: Sun Apr 08, 2018 12:13 pm
Location: Moscow

Re: Env. Light Visibility Cache

Post by zuljin3d »

B.Y.O.B
o, you have to go into the world settings, performance panel, and switch the map type from "single" to "cache".
Just according to my feelings, the cache is enabled by default,if use opencl.
Can you post the full log with the traceback?
I do not know how to do this?

Code: Select all

Traceback (most recent call last):
  File "C:\Users\start\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\BlendLuxCore-2_79_maintenance\engine\__init__.py", line 85, in render_final
    final.render(self, scene)
  File "C:\Users\start\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\BlendLuxCore-2_79_maintenance\engine\final.py", line 40, in render
    _render_layer(engine, scene, render_slot_stats)
  File "C:\Users\start\AppData\Roaming\Blender Foundation\Blender\2.79\scripts\addons\BlendLuxCore-2_79_maintenance\engine\final.py", line 63, in _render_layer
    engine.session.Start()
RuntimeError: PathOCLBase kernel compilation error
ERROR: PathOCLBase kernel compilation error
Error: PathOCLBase kernel compilation error
Attachments
none
none
cache
cache
Actualy sorry for my google translate english :)
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. »

zuljin3d wrote: Sun Jul 21, 2019 8:05 pm Just according to my feelings, the cache is enabled by default,if use opencl.
Trust me, I wrote the code. By default, only the old single visibility map is used.
https://github.com/LuxCoreRender/BlendL ... ght.py#L86
But maybe I misunderstand what you mean?
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 »

zuljin3d wrote: Sun Jul 21, 2019 8:05 pm
Can you post the full log with the traceback?
I do not know how to do this?
Can you post a test scene triggering the error ?
Support LuxCoreRender project with salts and bounties
zuljin3d
Posts: 76
Joined: Sun Apr 08, 2018 12:13 pm
Location: Moscow

Re: Env. Light Visibility Cache

Post by zuljin3d »

Dade wrote: Sun Jul 21, 2019 9:03 pm
zuljin3d wrote: Sun Jul 21, 2019 8:05 pm
Can you post the full log with the traceback?
I do not know how to do this?
Can you post a test scene triggering the error ?
I tried my old scenes, the problem always appears when there is material with a normal map in the scene.
Attachments
Error.zip
(3.42 MiB) Downloaded 138 times
Actualy sorry for my google translate english :)
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Env. Light Visibility Cache

Post by lacilaci »

First of all, this error:
PathOCL_kernel_compilation_error.jpg
aaand on cpu this one:
cpu_access_violation.jpg
kintuX
Posts: 809
Joined: Wed Jan 10, 2018 2:37 am

Re: Env. Light Visibility Cache

Post by kintuX »

Single Map used, forgot to set Env. Cache... :oops:
But is rendering now. Without errors. :)
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: Env. Light Visibility Cache

Post by lacilaci »

Ok,

Here are some of my findings in a testscene where it works on both cpu and opencl (previous errors and crashes I posted happen on a big scene)

First test is luxcore with different settings for visibility map against cycles with and without portals
I set halt conditions for luxcore to 1 minute which results in ~500 samples and cycles is set to 1024 samples which is ~ 57 seconds
Both running in cpu+gpu mode on ryzen2700+rtx2070

scene is identical with small exception that I didn't match exactly the tile size on checker and exposure might be a little off too, but it still illustrates my points so it is close enough.

So, this is cycles without portals:
cycles_portals_OFF.jpg
and luxcore with visibility map set to NONE:
luxcore_envmap_NONE.jpg
and luxcore with default visibility map setting, SINGLE MAP
luxcore_envmap_SINGLEMAP.jpg
It already looks pretty bad for luxcore when it comes to direct light performance

Also note that default single map is near useless in this testscene. I build the scene this way intentionally cause I've experienced this in few production scenes already (many obstruction objects between camera and openings in interior - map won't cover complex scene). It only works in very basic setup(single opening in scene and direct exposure from that opening on objects)

This is luxcore's new cache:
luxcore_envmap_CACHE.jpg
and cycles with portals:
cycles_portals_ON.jpg
Again, not only portals are without performance penalty (luxcore's visibility cache can easily take around 1 minute to build! in semi-complex scene)
Portals also don't give artifacts (those won't go away in luxcore even after 2000 samples and they throw off intel's denoiser so the resulting render will either have noisy patches or smudgy patches in it)
And it also seems that (at least in cycles's case) portals still give cleaner results than cache even in areas where cache works!

Also, on the topic of visibility map as a whole.

this is default setting (visibility map set to SINGLE MAP)
luxcore_OpenEnv_envmap_SINGLEMAP.jpg
and this is visibility map set to NONE:
luxcore_OpenEnv_envmap_NONE.jpg
Again, intentional setup of the scene, I've seen this happen again and again in product viz scenes (just hdri+object).
Visibility map cannot handle these open scenes just as it cannot handle interiors with many openings and obstructions.

What's worse it is ON by default and in blender it is away in scene environment setting (nobody would think it damages performance, I found out by accident)


So I don't know how work in progress this cache is and what can be done about it's performance and those artifacts.
But I'm gonna assume it won't get much faster and those artifacts will always show up somewhere, so in that case:

[warning: just my personal opinion, no need for pitchforks]

I would say, this visibility map while in many cases can help a bit. It needs user to do some testing to figure if it works in his case! So not so automatic in the end(in fact it's less automatic than portals at this moment).

What's worse, If I figure that in my productviz scene it is worse having it on I can turn it off. But in my complex scene I will not have a solution for bad direct light illumination at all! Half working cache is not a solution cause it's unreliable with those "patches"

So while I would prefer a fully automatic setting without caring about portals, there is no such thing in luxcore.
I would rather spend a while setting up portals in openings knowing what result to expect, than having to test in every single scene:
If the vis.map works better on or off, what mode works better, if those patches appear and do they all go away, if they go away how long it takes and is it not better to just use single map...

I'm sorry if I speak too soon and you have some solutions in the works! I'll happily re-test anything any time there's an update to this, since luxcore really needs some boost for direct lighting. (it's the last piece of the "puzzle" to make luxcore fucking fast!)
Attachments
279_luxcore.blend
(2.52 MiB) Downloaded 134 times
Post Reply