New isotropic scatterer material

Discussion related to the LuxRender Material system, programming API and Scene file format.

Moderators: jromang, tomb, zcott, coordinators

Re: New isotropic scatterer material

Postby tomb » Fri Dec 10, 2010 3:52 am

Looking forward to playing with this material - seems like a useful addition!:)
User avatar
tomb
Developer
 
Posts: 1941
Joined: Thu Oct 11, 2007 4:23 pm
Location: Oslo, Norway

Re: New isotropic scatterer material

Postby paco » Fri Dec 10, 2010 4:51 am

F(wo, wi)=g(Dot(wo, wi))=g(Dot(wi, wo))=F(wi,wo)

Ah yes, i'd glossed over the fact that g acts on (wi.wo), not (wi). Thanks!

f(wo, wi)=g(Dot(wo, wi))/cos(wo) which is not reciprocal


But I through that reciprocity was defined for f (not F) ? Even though the 1/cos term is irrelevant - it still appears in f.

I can't remember the details (too tired now!), but I think that I considered that you're dealing with small spheres, rather than a flat surface element dA as a reflector, then you get a 1/(wi.n) term appearing in F which then transfers to f - so it became:

F = g(wo.wi)/(n.wi)
f= g(wo.wi)/(n.wi)/ (n.wo) which is reciprocal and everyone's happy.

In advance I concede that I am likely wrong. Was very tired when I came up with that - but it does look nice and neat :)
paco
Developer
 
Posts: 456
Joined: Sun Feb 07, 2010 1:37 am

Re: New isotropic scatterer material

Postby paco » Fri Dec 10, 2010 5:55 am

Actually, here's my working:

If you consider a small sphere that absorbs the incident energy and re-transmits it isotropically, the outgoing radiance should be independent of the incoming direction of the source light - so Lo is proportional to Li

Now if you use the definition of a BRDF for a surface (as opposed to the volume we're trying to mimic) then:

f = Lo/ ( Li Cos(wi.n) dw ) = k Li / (Li Cos (wi.n) dw)

in which case you end up with f dw =1/cos(wi.n) or BDRF = k/cos (wi.n)

Which gives you the reciprocity in the post above. I guess the question is what should we do about the possible 1/0? I tried to keep the z(w.n) functions symmetric for both wi and wo to preserve reciprocity. Is reciprocity something that should be preserved at all costs, or is it ok to stretch it a bit?
paco
Developer
 
Posts: 456
Joined: Sun Feb 07, 2010 1:37 am

Re: New isotropic scatterer material

Postby jeanphi » Fri Dec 10, 2010 6:16 am

Hi,

In this case, the reciprocity doesn't matter because actually you're not really dealing with a surface but with a scatterer. I specifically changed the formalism so that this is completely transparent. If you have a scatterer, F maps to the phase function (which is used without a cosine term in the rendering equation), if you have a surface, F maps to f*cos (the cosine term is always present in the rendering equation) and this hides the difference.
I could have made it the other way around by dividing the phase function by the cosine so that it cancels out when using it as a BxDF. This is actually what was previousy done in the point light functions which present a very similar situation. However the numerical stability is terrible.

You should not look at this new material like a standard surface material, but rather like a forced scattering event at this precise point and apply the volumetric rendering equations to get the math right.

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

Re: New isotropic scatterer material

Postby paco » Fri Dec 10, 2010 6:36 am

hmm... ok, I guess i'm a bit confused. So you're saying that if the BxDF is used as part of a scatterer, then the phase function is just taken from F, but if the BxDF is attached to a surface, it gets used as F=f.cos ?

So in that case you can't use the same F to get a realistic (albeit fake) isotropic scatterer from a surface? I must admit my plan was simply to create a BxDF to use as fake scattering on a surface.

Are you suggesting that I create another (or series) of BxDFs specifically for use in a volumetric scatterer?
Last edited by paco on Mon Dec 20, 2010 11:35 pm, edited 1 time in total.
paco
Developer
 
Posts: 456
Joined: Sun Feb 07, 2010 1:37 am

Re: New isotropic scatterer material

Postby jeanphi » Fri Dec 10, 2010 7:33 am

Hi,

Sorry, I wasn't clear and muddied the issue.
Actually the rendering equation for a surface is dLo/dw=f*|cos|*Li while for a scatterer it is dLo/dw=g*Li, quite similar actually. So if you now define F to be f*|cos| when you're considering a BxDF, and to be g when considering a volume scattering event, you end up with dLo/dw=F*Li in both cases.
This way you can use the same formulation for any scattering event, be it at a surface or in a volume.

Now if you consider your new material to be a volume scattering event (the underlying mesh then only provides the scattering location), it should make sense.

If it now makes sense, continue reading, hopefully it won't confuse you. You could refine the material even more by providing a parameter to define the depth of the scattering layer so that you could mix it with a NullBxDF (to account for the probability that light is not scattered at all) and compute proper absorption properties within the scattering layer.

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

Re: New isotropic scatterer material

Postby Carbonflux » Fri Dec 10, 2010 8:26 am

heh, this is my favorite thread right now, its like a interesting tennis match where we learn things. Tho it takes me 3 times as long to read each post as it would a normal thread. Thanks for contributing paco, you are doing great work, jeanphi thanks for being there :) - I admit if I had a choice to learn about this from jeanphi or attend MIT I would want to learn from Jean. anyway, please excuse my interruption, but this thread makes me happy. :ugeek:
www.carbonflux.org - photographing the imagination.
User avatar
Carbonflux
Developer
 
Posts: 1403
Joined: Thu Aug 07, 2008 7:22 pm
Location: Seattle, WA, USA.

Re: New isotropic scatterer material

Postby paco » Fri Dec 10, 2010 4:45 pm

Carbon: your input is always welcome!

Jeanphi: I'll remove the 1/(wi.n) term and see how it goes. The rendering equations seem correct as defined for a surface/ volume, however I think simulating a volume event by a surface will still require the extra terms - and they do make some sense. For instance at grazing angles the incoming flux is very small for a surface, but should be unchanged for a volume (sphere). The 1/cos term adjusts for that.

Let me try it with/without that term and i'll post the result.
paco
Developer
 
Posts: 456
Joined: Sun Feb 07, 2010 1:37 am

Re: New isotropic scatterer material

Postby jeanphi » Fri Dec 10, 2010 4:58 pm

Hi,

Yes paco, that's what you'll end up with if you introduce the depth parameter.

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

Re: New isotropic scatterer material

Postby paco » Fri Dec 10, 2010 5:06 pm

Ok, here's the gas cloud with just : *f_ += R*(1.0+param_a)/(param_a+coso)*coso;

blend001.Scene.00164.png
paco
Developer
 
Posts: 456
Joined: Sun Feb 07, 2010 1:37 am

PreviousNext

Return to Materials, API & Scene file format

Who is online

Users browsing this forum: No registered users and 1 guest