SPPM renderer (CPU-only)

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

Moderators: jromang, tomb, zcott, coordinators

Re: SPPM renderer (CPU-only)

Postby Dade » Fri Mar 18, 2011 3:29 am

jeanphi wrote:It could also be stopped by russian roulette


I don't use RR in the eye pass for the same reason. SPPM has a kind of "natural" habit to terminate eye paths by stopping as soon as they hit a diffuse surface (i.e. the average eye path is very short). Terminating an eye path not on a diffuse surface will totality waste the successive photon pass for that particular hit point: this is the reason why RR is no used at all for the eye pass.

@guibou: it is a good a clever solution however it is not trivial to apply in the current Lux/PBRT BSDF interfaces.
User avatar
Dade
Developer
 
Posts: 4798
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: SPPM renderer (CPU-only)

Postby jeanphi » Fri Mar 18, 2011 3:50 am

Dade wrote:@guibou: it is a good a clever solution however it is not trivial to apply in the current Lux/PBRT BSDF interfaces.

Looking back at the stuff, it's actually wrong to do that, a better way would be to spread back the reject blue area over the green area, but that would be equally difficult and might not bring in better results.

From Dade's comment, if you don't bounce off diffuse surfaces, then you're not using SampleF on them, only F and then you don't have this issue at all since paths in the red area are accepted by F. Did I miss something?

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

Re: SPPM renderer (CPU-only)

Postby Dade » Fri Mar 18, 2011 8:22 am

jeanphi wrote:From Dade's comment, if you don't bounce off diffuse surfaces, then you're not using SampleF on them, only F and then you don't have this issue at all since paths in the red area are accepted by F. Did I miss something?


I'm calling SampleF() exactly to know if to classify an hit point as a diffuse one. I check the returned flags and if it is BSDF_REFLECTION|BSDF_DIFFUSE I store an hit point there and stop the path. I'm effectively ignoring the returned wi vector. This why SampleF() returning false had a such bad impact on SPPM.

The current BSDF interface only allow me to count the number of components, I need to call SampleF() to know if a particular hit point must be handled as a BSDF_DIFFUSE, BSDF_GLOSSY or BSDF_SPECULAR.
User avatar
Dade
Developer
 
Posts: 4798
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: SPPM renderer (CPU-only)

Postby Lord Crc » Fri Mar 18, 2011 10:44 am

I haven't really looked into this at all, so ignore me, but couldn't we essentially do
Code: Select all
   if (sampledType)
      *sampledType = bxdf->type;
   if (!bxdf->SampleF(sw, WorldToLocal(woW), wiW, u1, u2, f_,
      pdf, pdfBack, reverse)) {
      if (sampledType)
         *sampledType &= BSDF_ALL_TYPES;
      return false;
   }


Or does some other code than SPPM rely on the sampledType even if SampleF returns false?

Again, ignore me :D
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4455
Joined: Sat Nov 17, 2007 2:10 pm

Re: SPPM renderer (CPU-only)

Postby jeanphi » Fri Mar 18, 2011 10:49 am

Hi,

Why don't you use NumComponents instead of SampleF? If there's no diffuse component, you continue to trace the path, if there's a diffuse component, you check for other components, if none you stop the path, otherwise you use a random selection to know if you stop the path or continue it.

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

Re: SPPM renderer (CPU-only)

Postby Dade » Sun Mar 20, 2011 3:42 am

jeanphi wrote:Why don't you use NumComponents instead of SampleF? If there's no diffuse component, you continue to trace the path, if there's a diffuse component, you check for other components, if none you stop the path, otherwise you use a random selection to know if you stop the path or continue it.


But how do you do the random selection ? For instance, if you have a Mix material with a 25% probability of being diffuse, how do you extract the "25%" number with the current BSDF interface ? SampleF() seems to only viable solution to me that can work with any kind of BSDF supported by Lux.
User avatar
Dade
Developer
 
Posts: 4798
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: SPPM renderer (CPU-only)

Postby jeanphi » Sun Mar 20, 2011 12:53 pm

Hi,

Maybe you could change SampleF so that the sampledFlags is initialized to the sampled BxDF flags whatever the return value or 0 if no BxDF could be selected.

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

Re: SPPM renderer (CPU-only)

Postby binarycortex » Fri Mar 25, 2011 12:22 am

More difficult light path tests, but this time in higher res. Both ran for 4 hours.

Settings for both:
SurfaceIntegrator "sppm"
"integer photonperpass" [1000000]
"integer maxeyedepth" [32]
"integer maxphotondepth" [32]
"float alpha" [0.700000]
"float startradius" [1.000000]

pool_scene_sppm_underwater.png
SSSD

pool_scene_sppm_underwater_2.png
SSSDS
Competition Coordinator.
Current Competition: Math is Beautiful / Abstract Wallpaper

Member of the first official jeanphi-fan club
User avatar
binarycortex
Developer
 
Posts: 1502
Joined: Fri Feb 22, 2008 10:44 pm

Re: SPPM renderer (CPU-only)

Postby SATtva » Fri Mar 25, 2011 3:52 am

Just 4 hours! :shock: Incredible.
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 5498
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Re: SPPM renderer (CPU-only)

Postby B.Y.O.B. » Fri Mar 25, 2011 8:06 am

SATtva wrote:Just 4 hours! :shock: Incredible.

My opinion :)
This seems to be a huge improvement! And I can't imagine how fast it is with GPU supported ;)
User avatar
B.Y.O.B.
 
Posts: 1882
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

PreviousNext

Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 1 guest