## 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)

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.

Posts: 4798
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

### Re: SPPM renderer (CPU-only)

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

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

### Re: SPPM renderer (CPU-only)

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.

Posts: 4798
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

### Re: SPPM renderer (CPU-only)

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
May contain traces of nuts.

Lord Crc

Posts: 4455
Joined: Sat Nov 17, 2007 2:10 pm

### Re: SPPM renderer (CPU-only)

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

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

### Re: SPPM renderer (CPU-only)

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.

Posts: 4798
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

### Re: SPPM renderer (CPU-only)

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

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

### Re: SPPM renderer (CPU-only)

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]

SSSD

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

Member of the first official jeanphi-fan club

binarycortex

Posts: 1502
Joined: Fri Feb 22, 2008 10:44 pm

### Re: SPPM renderer (CPU-only)

Just 4 hours! Incredible.
Linux builds packager

SATtva

Posts: 5498
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

### Re: SPPM renderer (CPU-only)

SATtva wrote:Just 4 hours! Incredible.

My opinion
This seems to be a huge improvement! And I can't imagine how fast it is with GPU supported

B.Y.O.B.

Posts: 1882
Joined: Wed Nov 10, 2010 4:10 pm
Location: Germany

PreviousNext