PhotonGI cache

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

Re: PhotonGI cache

Post by B.Y.O.B. »

epilectrolytics wrote: Mon Feb 18, 2019 8:20 am In my main 3D app Cheetah3D this problem doesn't exist and whenever I port an interior scene with sunsky into Blender I have to put it into a Box for shielding, and the box has to be black or light will even leak through solid double geometry walls!
Maybe the issues come from the export/import? For example excessive scale in object space, or extremely large/small models, causing floating point precision issues? (anyway, offtopic, and I guess you already checked for these possibilities)
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: PhotonGI cache

Post by lacilaci »

I tried changing scene scale, model scale, normals, shaders, tesselating mesh, modifying mesh. Changing settings...

If the cache lookup is smaller than wall thickness only then it won't get through. In every other situation it will go through mesh near corner if it's directly exposed to light (tested only sun and sky)
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade »

lacilaci wrote: Mon Feb 18, 2019 8:39 am If the cache lookup is smaller than wall thickness only then it won't get through.
Yes but this is expected, the radius must be smaller of significative geometry features. I mean otherwise you could use a huge radius and render all the scene with just a single cache entry.

Just render a single plane with a box over, if the radius is larger than the box, light will start to leak from one side to the other. The test with cache entries is purely based on distance so, like I said, it is expected.

Given the pre-processing speed (and the insanely low memory usage) of current implementation, it hasn't a particular cost to use smaller radius.

In older implementation, you where pushed to used larger radius to reduce the rendering times (i.e. fixed by photon accumulation over cache entries) and to smooth the cache entries (i.e. fixed by cache filtering).
Support LuxCoreRender project with salts and bounties
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: PhotonGI cache

Post by lacilaci »

Dade wrote: Mon Feb 18, 2019 10:07 am
lacilaci wrote: Mon Feb 18, 2019 8:39 am If the cache lookup is smaller than wall thickness only then it won't get through.
Yes but this is expected, the radius must be smaller of significative geometry features. I mean otherwise you could use a huge radius and render all the scene with just a single cache entry.

Just render a single plane with a box over, if the radius is larger than the box, light will start to leak from one side to the other. The test with cache entries is purely based on distance so, like I said, it is expected.

Given the pre-processing speed (and the insanely low memory usage) of current implementation, it hasn't a particular cost to use smaller radius.

In older implementation, you where pushed to used larger radius to reduce the rendering times (i.e. fixed by photon accumulation over cache entries) and to smooth the cache entries (i.e. fixed by cache filtering).
But wait, I understand that a large radius will leak through geometry like in your example. But I don't understand that in the situation I posted, how do cache entries from sun even end up inside the box? They aren't leak from outside are they?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade »

lacilaci wrote: Mon Feb 18, 2019 10:22 am But wait, I understand that a large radius will leak through geometry like in your example. But I don't understand that in the situation I posted, how do cache entries from sun even end up inside the box? They aren't leak from outside are they?
Isn't the sun hitting the floor outside the box ? I assume the sphere centered on a cache entry inside the box will include photons hitting the floor outside the box (if the radius is large enough). Filtering may further aggravate the problem by averaging cache entries inside and outside the box.
Support LuxCoreRender project with salts and bounties
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: PhotonGI cache

Post by lacilaci »

Dade wrote: Mon Feb 18, 2019 10:27 am
lacilaci wrote: Mon Feb 18, 2019 10:22 am But wait, I understand that a large radius will leak through geometry like in your example. But I don't understand that in the situation I posted, how do cache entries from sun even end up inside the box? They aren't leak from outside are they?
Isn't the sun hitting the floor outside the box ? I assume the sphere centered on a cache entry inside the box will include photons hitting the floor outside the box (if the radius is large enough). Filtering may further aggravate the problem by averaging cache entries inside and outside the box.
Oh, so it's the whole radius of the sphere that creates photons even in the inside? I thought that if the cache hits a surface it is the only surface that will contains photons.

Couldn't the photon creation be limited by surface angle? So the photons could be created only up to a certain degree from surface normal that has been hit?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: PhotonGI cache

Post by Dade »

PhotonGI is now fully supported on all path tracers (PATHCPU, PATHOCL, TILEPATHCPU and TILEPATHOCL).
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: PhotonGI cache

Post by Dade »

lacilaci wrote: Mon Feb 18, 2019 10:33 am Oh, so it's the whole radius of the sphere that creates photons even in the inside? I thought that if the cache hits a surface it is the only surface that will contains photons.
It works in the opposite direction. The visibility map phase will create an (empty) cache entry inside the box. The photon tracing phase will accumulate photons hitting all the points inside the sphere around the cache entry. And the the test, if to accumulate on the cache entry, is purely based on distance and normal angle test (i.e. the 2 cache look up parameters).
lacilaci wrote: Mon Feb 18, 2019 10:33 am Couldn't the photon creation be limited by surface angle? So the photons could be created only up to a certain degree from surface normal that has been hit?
It is already like that but the normals of the box bottom and the floor are the same (they both point up).
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: PhotonGI cache

Post by Dade »

lacilaci wrote: Sun Feb 17, 2019 6:32 pm I also think that angle parameter should be hidden and materials should be cached as if no bump was applied.
I have switched from using shading normal to geometry normal in PhotonGI. So bump/normal mapping is now ignored.

It seems to work fine but it is hard to predict, give it a spin.
Support LuxCoreRender project with salts and bounties
User avatar
lacilaci
Donor
Donor
Posts: 1969
Joined: Fri May 04, 2018 5:16 am

Re: PhotonGI cache

Post by lacilaci »

Dade wrote: Mon Feb 18, 2019 11:01 am
lacilaci wrote: Sun Feb 17, 2019 6:32 pm I also think that angle parameter should be hidden and materials should be cached as if no bump was applied.
I have switched from using shading normal to geometry normal in PhotonGI. So bump/normal mapping is now ignored.

It seems to work fine but it is hard to predict, give it a spin.
will try once it's built...

For excessive bump effect it would be better in the future to use microdisplacement/displacement(once implemented) and at that point it will be geometry.
Post Reply