## Volumetric scattering

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

Moderators: jromang, tomb, zcott, coordinators

### Re: Volumetric scattering

About that orange juice, my scattering was way too low ~120

Here is scattering much higher page 8 https://www.msu.edu/~qinjianw/Documents/2007_AS_Qin.pdf

Now it looks more like on photo samples.

Code: Select all
nm   1/m380   1731.34328358400   1634.32835821450   1358.20895522500   1134.32835821550   917.91044776600   761.19402985650   641.79104478700   552.23880597720   537.31343284

I lowered for speed
Code: Select all
nm   1/m380   917.91044776400   866.47581060450   720.08492022500   601.38960371550   486.65079773600   403.56407617650   340.25990736700   292.78178075720   284.86875965

Meelis

Posts: 872
Joined: Sat Oct 17, 2009 2:16 am

### Re: Volumetric scattering

Hi!
1. What parts are missing to support heterogeneous scattering? Has there any work been done recently or is it postponed? Which method is planned to use to support heterogenous media?

2. Another topic is the step size of the volume integrators. I thought that is isn't used anymore with the new volume system but as I looked into the source code I found a few places where it is used. Are this methods used for support of the old system, e.g. volume grid, or is it still used with the new volume system?
i7 860, 16 GB RAM, NVIDIA Geforce GTX 560 + GTX 460, Windows 7 64bit, Blender 2.66
neo2068

Posts: 485
Joined: Sun May 03, 2009 2:11 am
Location: Germany

### Re: Volumetric scattering

neo2068 wrote:1. What parts are missing to support heterogeneous scattering? Has there any work been done recently or is it postponed? Which method is planned to use to support heterogenous media?

The code to handle heterogeneous medium by selecting a correct step size is missing. I plan to partition volumes according to the density and let the ray go through each subvolume with appropriate scattering probabilities in each one.

neo2068 wrote:2. Another topic is the step size of the volume integrators. I thought that is isn't used anymore with the new volume system but as I looked into the source code I found a few places where it is used. Are this methods used for support of the old system, e.g. volume grid, or is it still used with the new volume system?

Currently it is only used by the old system, however it might be used by the new heterogeneous scattering system when it is coded to limit the size of the subvolumes.

Jeanphi
jeanphi

Posts: 6569
Joined: Mon Jan 14, 2008 7:21 am

### Re: Volumetric scattering

Meelis wrote:[...]Now it looks more like on photo samples.[...]

Okay so how one could use these values in Lux? I'm curious how the results for milk compare, for example.

b.
Last edited by b-tag on Tue Feb 14, 2012 10:37 am, edited 2 times in total.

b-tag

Posts: 61
Joined: Tue Nov 02, 2010 10:53 am

### Re: Volumetric scattering

b-tag wrote:Okay so how one could use these values in Lux? I'm curious how the results for milk compare, for example.

b.

In luxblend you add tabulatedata texture and braus link for the txt file,

and then set the texture as scattering

Or input just in LXM file.

You are just fine with RGB values, i didn't want to spend time converting to RGB.

Meelis

Posts: 872
Joined: Sat Oct 17, 2009 2:16 am

### Re: Volumetric scattering

jeanphi wrote:
neo2068 wrote:1. What parts are missing to support heterogeneous scattering? Has there any work been done recently or is it postponed? Which method is planned to use to support heterogenous media?

The code to handle heterogeneous medium by selecting a correct step size is missing. I plan to partition volumes according to the density and let the ray go through each subvolume with appropriate scattering probabilities in each one.

neo2068 wrote:2. Another topic is the step size of the volume integrators. I thought that is isn't used anymore with the new volume system but as I looked into the source code I found a few places where it is used. Are this methods used for support of the old system, e.g. volume grid, or is it still used with the new volume system?

Currently it is only used by the old system, however it might be used by the new heterogeneous scattering system when it is coded to limit the size of the subvolumes.

Jeanphi

i7 860, 16 GB RAM, NVIDIA Geforce GTX 560 + GTX 460, Windows 7 64bit, Blender 2.66
neo2068

Posts: 485
Joined: Sun May 03, 2009 2:11 am
Location: Germany

### Re: Volumetric scattering

Okay, Applied Optics isn't my forte, but in order to use the empirical data from the paper above, one should compensate for the reduced scattering coefficient. So, for the scattering coefficient as a function of the wavelength (and keeping the Lux notation used so far):

sigma_s(lambda) = m_s'(lambda)/(1-g)

where m_s'(lambda) is the reduced scattering coefficient provided empirically, and g is the asymmetry.

So if we use g(RGB) from the volumetric scattering presets estimated previously, should be g converted to a function of the wavelength, or there could be an easier solution?

b.

b-tag

Posts: 61
Joined: Tue Nov 02, 2010 10:53 am

### Re: Volumetric scattering

b-tag wrote:Okay, Applied Optics isn't my forte, but in order to use the empirical data from the paper above, one should compensate for the reduced scattering coefficient. So, for the scattering coefficient as a function of the wavelength (and keeping the Lux notation used so far):

sigma_s(lambda) = m_s'(lambda)/(1-g)

where m_s'(lambda) is the reduced scattering coefficient provided empirically, and g is the asymmetry.

So if we use g(RGB) from the volumetric scattering presets estimated previously, should be g converted to a function of the wavelength, or there could be an easier solution?

b.

Hi

This math is over my head.
What i did i'm not sure if that's correct but i just multiplied reduced scattering coefficient for 1cm to 100cm (by 100)

But this would be so creat if we had in Wiki some formulas with examples in OpenOffice Calc format how to convert data to insert in LuxBlend interface.

Meelis

Posts: 872
Joined: Sat Oct 17, 2009 2:16 am

### Re: Volumetric scattering

Hello,

This "homogeneous" volumetric material is great.
I've been looking around in the code, and I noticed that it seems to use "SchlickScatter" as the phase function.

Am I correct?

If I'd like to replace it with another phase function, such as Henyey-Greenstein or Mie, is there anything I should know, or is it just a drop-in replacement of schlickscatter.[cpp,h]?

(I'm asking because I'll need to compare with pictures generated with other renderers, and I'll have to make sure I have the same phase function).
Nicolas

Posts: 1
Joined: Wed Sep 19, 2012 6:17 am

### Re: Volumetric scattering

Hi,

Yes, LuxRender is using the Schlick phase function. Mie, Rayleigh and Henyey-Greenstein functions are defined in core/volume.h but are currently unused. You can either create your own scattering BxDF with the other models and use them in the volumes or update the existing Schlick BxDF to use another model.

Jeanphi
jeanphi

Posts: 6569
Joined: Mon Jan 14, 2008 7:21 am

Previous