Small SchlickBRDF::SampleF question

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

Moderators: jromang, tomb, zcott, coordinators

Re: Small SchlickBRDF::SampleF question

Postby Lord Crc » Thu Sep 15, 2011 7:02 am

Ah it's not that fancy yet ;) I'm so rusty in this area that it pains me. But I figured that if we have this as a working base we could always improve on it incrementally.

The somewhat ad-hoc sampling weighting scheme seems to work fairly well, and in general the speed hit seems to be fairly modest compared to a plain glossy material.

I'll clean up the code so I can push it. One thing I struggle with is naming and such... I added SchlickGlossyBRDF to the "schlickbrdf" file and GlossyCoating to the "glossy2" file. Since they're so similar to their "cousins" I figured it was best to keep them in the same files, but I could split them up. Please let me know if I should change this, easier to do it before I commit.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4517
Joined: Sat Nov 17, 2007 2:10 pm

Re: Small SchlickBRDF::SampleF question

Postby jeanphi » Thu Sep 15, 2011 8:08 am

Hi,

I wouldn't have expected a SchlickGlossyBRDF to come up, but rather a SchlickCoatingBSDF (isn't that derived from the BSDF class instead of the BxDF class? if not then it's hard to suggest anything without seeing the code, if it's derived from BSDF then I think it would better fit in a new file, maybe in a new bsdf directory where we would put all BSDF derived classes).
I agree with your choice for the material.

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

Re: Small SchlickBRDF::SampleF question

Postby Lord Crc » Thu Sep 15, 2011 8:55 am

As I said the LayeredBSDF takes an "arbitrary" (ok not quite) BxDF as well as a Fresnel. To match the glossy material I created a variant of the SchlickBRDF which doesn't have the diffuse component. Technically this would be the "single" model from Schlick's paper while the SchlickBRDF is the "double".

Alternatively we'll move everything from SchlickBRDF into the LayeredBSDF and name it as you said. Then we'll duplicate the SchlickA and friends.

Another alternative would be to add some special code to SchlickBRDF which ignores the diffuse layer for sampling if it's black. That way we could use it instead of my hacked version. Ie a switch between the single model and the full double model.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4517
Joined: Sat Nov 17, 2007 2:10 pm

Re: Small SchlickBRDF::SampleF question

Postby jeanphi » Thu Sep 15, 2011 11:31 am

Hi,

Ah, ok, without seeing the code it's hard to comment. What I thought you did was a Schlick coating BSDF that would take a microfacet distribution and a fresnel properties to compute a glossy coating over an arbitrary base layer using Schlick simplification. Having a generic LayeredBSDF taking a BxDF might not be appropriate to handle some not so physical cases like replacing the Kr/Kt parameters of glass with a special coating or adding thin film interference as a coating. I thought it would be best handled by custom BSDF, but if you can prove me wrong I'll be more than happy.

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

Re: Small SchlickBRDF::SampleF question

Postby Lord Crc » Thu Sep 15, 2011 4:25 pm

The thing I wanted to avoid was code duplication of the SampleF() and F()... Perhaps it's better to just duplicate it, I'm torn.

In any case, since I'm not introducing any new files (yet), I'll clean up what I have and push it, you can have a look and cry... I mean comment :lol:

Later we can move things into their own files if we want to.
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4517
Joined: Sat Nov 17, 2007 2:10 pm

Re: Small SchlickBRDF::SampleF question

Postby jeanphi » Mon Sep 26, 2011 3:56 am

Hi,

Any news on this? I hope it's not delayed because your flue has worsen.

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

Re: Small SchlickBRDF::SampleF question

Postby Lord Crc » Sun Oct 16, 2011 8:50 am

I've made a new thread on the LayeredBSDF here: viewtopic.php?f=10&t=7246
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4517
Joined: Sat Nov 17, 2007 2:10 pm

Re: Small SchlickBRDF::SampleF question

Postby jeanphi » Tue Oct 25, 2011 2:44 am

Hi,

I looked back at the implementation the other day, and I'm not really happy with the use of a BxDF for the coating. This is rather inappropriate because you need to handle both reflection and transmission which is not the idea behind a BxDF (single type of scattering event).
I think we should specialize the current code for Schlick coating (ie provide a IOR and a microfacet distribution as parameters but handle the coating reaction in this new BSDF). The current code won't work that well with transmitting bases eventhough the results might be interesting because it will use directions on opposite sides with a BxDF expecting directions on the same side.
I also dislike the rename to FresnelBlend because that's a completely different algorithm than the FresnelBlendBxDF.

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

Re: Small SchlickBRDF::SampleF question

Postby Lord Crc » Tue Oct 25, 2011 8:16 am

Gotcha. So I basically move everything from SchlickGlossyBRDF into the bsdf itself, and remove the SchlickGlossyBRDF entirely.

Regarding transmission... If you look closely I don't use the BxDF when coming in from the other side, only the base. At least that was my intention, as I was unsure on how to handle this correctly. I'm still not entirely sure.

As for the name, it was the best I could come up with at short notice, since my original name clashed with paco's, and wasn't that good either. Since we're hardcoding the coating, perhaps SchlickBSDF?
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4517
Joined: Sat Nov 17, 2007 2:10 pm

Re: Small SchlickBRDF::SampleF question

Postby jeanphi » Tue Oct 25, 2011 9:39 am

Hi,

Yes, that'd be a nice name and a nice restructure.
Regarding BxDF usage, look at SampleF, when you sample the base, you apply the coating without a check.

Also why do you prevent coating weight to go below .5? If the coating doesn't interact much, it shouldn't be sampled much.

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

PreviousNext

Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 1 guest