Technical questions on modeling and scattering in media

Discussion related to the implementation of new features & algorithms to the Core Engine.

Moderators: jromang, tomb, zcott, coordinators

Technical questions on modeling and scattering in media

Postby ingenious » Fri Mar 16, 2012 3:17 pm

Hey Lux devs,

I have a couple of questions regarding the participating media system in Lux.

1) When tracing a path throughout the scene and sampling vertices, only scattering is importance sampled in media, e.g. in the HomogeneousVolume::Scatter() function, whereas traditionally the full transmittance (absorption + scattering) is importance sampled. My question is, why such a decision has been made? I agree it actually makes sense this way, but want to ask the devs. I assume this has the benefit of leaving the path termination decisions to the surface integrator. If you pick a scattering event that's too deep in the medium, so that the low transmittance results in very small contribution of that point, you can still account for this by terminating the path in the integrator using Russian roulette. But on the other hand, next event estimation (i.e. direct lighting) could be hurt, because you normally compute it before making the path termination decision. So in such a case you'll compute direct lighting on a point with little contribution (due to the low transmittance), before eventually terminating the path.

2) What BSDFs are assigned at the interface surface between to media? For example [air : milk], [air : glass], [water : translucent plastic] ? I'm asking because the VolumeIntegrator::Connect() function only evaluates specular transmission with parallel opposite directions, which AFAIK should only work for NullTransmission BxDF. Now consider I have a polygon with a very transparent double-sided material with diffuse transmission. The Connect() function would not let any light through and return zero transmission. Is that a correct behavior? And what material do I assign to an object with a skin material?

Thanks a lot in advance!

P.S. One more thing: why does HomogeneousVolume::Scatter() multiply L (the transmittance) by SigmaT upon successful scattering even sampling? And then, weirdly, this returned L value is overwritten by a Transmittance call in the volume integrator...
ingenious
 
Posts: 53
Joined: Tue Mar 16, 2010 3:43 pm

Re: Technical questions on modeling and scattering in media

Postby jeanphi » Sat Mar 17, 2012 3:16 am

ingenious wrote:1) When tracing a path throughout the scene and sampling vertices, only scattering is importance sampled in media, e.g. in the HomogeneousVolume::Scatter() function, whereas traditionally the full transmittance (absorption + scattering) is importance sampled. My question is, why such a decision has been made? I agree it actually makes sense this way, but want to ask the devs. I assume this has the benefit of leaving the path termination decisions to the surface integrator. If you pick a scattering event that's too deep in the medium, so that the low transmittance results in very small contribution of that point, you can still account for this by terminating the path in the integrator using Russian roulette. But on the other hand, next event estimation (i.e. direct lighting) could be hurt, because you normally compute it before making the path termination decision. So in such a case you'll compute direct lighting on a point with little contribution (due to the low transmittance), before eventually terminating the path.

That's because with strong absorption you would have a lot of scattering points that would be basically useless. It's a balance and in my tests this way created less variance and could even be faster than the traditional method.

ingenious wrote:2) What BSDFs are assigned at the interface surface between to media? For example [air : milk], [air : glass], [water : translucent plastic] ? I'm asking because the VolumeIntegrator::Connect() function only evaluates specular transmission with parallel opposite directions, which AFAIK should only work for NullTransmission BxDF. Now consider I have a polygon with a very transparent double-sided material with diffuse transmission. The Connect() function would not let any light through and return zero transmission. Is that a correct behavior? And what material do I assign to an object with a skin material?

The BSDF assigned to a surface is the one defined by the material, it's completely up to the user. The Connect method only connect through surfaces that are specular and return a non null pdf. This is actually just a convention for passthrough materials (like null material or architectural glass). All other materials, diffuse materials included will block in Connect, the path will be handled by standard scattering when the ray will hit the surface. This is a design choice to keep the computation of path probabilities manageable.

ingenious wrote:P.S. One more thing: why does HomogeneousVolume::Scatter() multiply L (the transmittance) by SigmaT upon successful scattering even sampling? And then, weirdly, this returned L value is overwritten by a Transmittance call in the volume integrator...

That's a trick because the pseudo BSDF used at scattering events is divided by SigmaT to keep the albedo between 0 and 1 and be usable by russian roulette. The Transmittance call doesn't overwrite L, it updates it to account for the old volume system.

Jeanphi
jeanphi
Developer
 
Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

Re: Technical questions on modeling and scattering in media

Postby ingenious » Sat Mar 17, 2012 4:18 am

Thanks, Jeanphi, again for the great reply, I really appreciate! I think I get everything, but can you elaborate a bit more on how only letting specular transmission through helps keep path probabilities manageable? What would get more complicated if diffuse/glossy transmission would be allowed in Connect() too?

One more thing, do you have to somehow account for the different indices of refraction between two media if you have diffuse or glossy transmission from one to the other?
ingenious
 
Posts: 53
Joined: Tue Mar 16, 2010 3:43 pm

Re: Technical questions on modeling and scattering in media

Postby jeanphi » Mon Mar 19, 2012 3:24 am

ingenious wrote:Thanks, Jeanphi, again for the great reply, I really appreciate! I think I get everything, but can you elaborate a bit more on how only letting specular transmission through helps keep path probabilities manageable? What would get more complicated if diffuse/glossy transmission would be allowed in Connect() too?

That's because if you are connecting 2 diffuse vertices and it happens that the incoming and outgoing rays are aligned, you then need to account for the fact that you could also get that connection with the previous vertex (and then maybe the previous one, ...) while with specular vertices it is simply impossible to connect due to the specularity so you avoid the issue. I first thought it was negligible, but tests showed that the rendering was flawed.

ingenious wrote:One more thing, do you have to somehow account for the different indices of refraction between two media if you have diffuse or glossy transmission from one to the other?

No for diffuse and yes for glossy.

Jeanphi
jeanphi
Developer
 
Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

Re: Technical questions on modeling and scattering in media

Postby ingenious » Mon Mar 19, 2012 6:33 pm

Thanks a lot!! ;)
ingenious
 
Posts: 53
Joined: Tue Mar 16, 2010 3:43 pm


Return to Architecture & Design

Who is online

Users browsing this forum: Exabot [Bot] and 1 guest

cron