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 » Tue Mar 08, 2011 12:11 pm

guibou wrote:There is something I don't understand :

http://src.luxrender.net/lux/file/1e957 ... el.cpp#l36

BSDF_ALL | BSDF_DIFFUSE is the same as BSDF_ALL, so what is the need for BSDF_DIFFUSE ?

Does BSDF_REFLECTION | BSDF_TRANSMISSON | BSDF_DIFFUSE is more correct ?

Did i miss something ?:


BSDF_ALL = BSDF_REFLECTION | BSDF_TRANSMISSON
(just check the source)

BSDF_ALL | BSDF_DIFFUSE means all transmitted and reflected rays of type diffuse.

BSDF_ALL alone means nothing. You have to combine with on or more of the followings: BSDF_DIFFUSE, BSDF_GLOSSY, BSDF_SPECULAR.

guibou wrote:This come from that changset dcaca6612b.

It appears (because of this explicit changset) that we want to ignore glossy component when a photon falls on a hitpoint radius, but I'm wondering when this component is taken into account ?


BSDF_GLOSSY is handled by the eye pass.

guibou wrote:so :

a) Am I right thinking that BSDF_ALL and BSDF_ALL | BSDF_DIFFUSE is the same ?


Nope.

guibou wrote:b) Is the correct behavior BSDF_ALL or BSDF_REFLECTION | BSDF_TRANSMISSON | BSDF_DIFFUSE ?


The correct behaviour is BSDF_ALL | BSDF_DIFFUSE.

P.S. wait to patch LuxBlend25 (or apply the patch only on a branch) because we need to release 0.8 first.
User avatar
Dade
Developer
 
Posts: 4795
Joined: Sat Apr 19, 2008 6:04 pm
Location: Italy

Re: SPPM renderer (CPU-only)

Postby J the Ninja » Tue Mar 08, 2011 12:16 pm

Dade wrote:
P.S. wait to patch LuxBlend25 (or apply the patch only on a branch) because we need to release 0.8 first.


I know, I did this mainly for my own screwing around with it, figured some other people might want it too. (also, I want to find out what I did wrong on the surface integrator panel)
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: SPPM renderer (CPU-only)

Postby jeanphi » Tue Mar 08, 2011 2:24 pm

Dade wrote:BSDF_ALL = BSDF_REFLECTION | BSDF_TRANSMISSON
(just check the source)

Guibou is right, BSDF_ALL = BSDF_ALL_REFLECTION | BSDF_ALL_TRANSMISSION, which does include BSDF_DIFFUSE, BSDF_GLOSSY and BSDF_SPECULAR.

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

Re: SPPM renderer (CPU-only)

Postby J the Ninja » Tue Mar 08, 2011 11:04 pm

Remember this?

SPPM has the same problem:

Car paint (Polaris Silber preset):
Image

Glossy:
Image

Both of those were with startradius=2.0, alpha=0.7, 50k photons per pass. Both rendered for about 5 mins. The car paint one wasn't clearing up at all though, it was just stuck like that the entire time.
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: SPPM renderer (CPU-only)

Postby guibou » Wed Mar 09, 2011 4:00 am

J the Ninja wrote:Remember this?

SPPM has the same problem:

Car paint (Polaris Silber preset):
Image

Glossy:
Image

Both of those were with startradius=2.0, alpha=0.7, 50k photons per pass. Both rendered for about 5 mins. The car paint one wasn't clearing up at all though, it was just stuck like that the entire time.


It may come from the fact that carpaint have a glossy and a diffuse component, so there is hitpoint on glossy surface. (In fact I have exacly the same pattern when I force storing hitpoints on glossy surfaces)

Let me take the metro and check that @work.
guibou
Developer
 
Posts: 269
Joined: Fri Dec 04, 2009 10:14 am

Re: SPPM renderer (CPU-only)

Postby guibou » Fri Mar 11, 2011 12:01 pm

Ok, I have found something, thank to jeanphi who suggest that carpaint may generate lot of NaN values.

Some photons, after interactions with the carpaint surface, have Not A Number flux value. Currently I set a little fix inside hitpoints

the diff for thoses who can't wait for carpaint. Please note that this fix may (does) introduce bias.

Code: Select all
# HG changeset patch
# User Guillaume Bouchard <guillaume.bouchard@liris.cnrs.fr>
# Parent 1e957ff77c761ca502e998f870fd029fe91876a1
Temporary fix for carpaint (and other ?) material.

This fix is a ugly hack, but it removes NaN values which may comes from
interaction between carpaint and photons in SPPM.

diff -r 1e957ff77c76 renderers/sppm/lookupaccel.cpp
--- a/renderers/sppm/lookupaccel.cpp   Tue Mar 08 03:41:39 2011 +0100
+++ b/renderers/sppm/lookupaccel.cpp   Fri Mar 11 18:12:05 2011 +0100
@@ -40,6 +40,12 @@
      XYZColor flux = XYZColor(sw, photonFlux * f * hp->eyeThroughput);
      // TODO: it should be more something like:
      //XYZColor flux = XYZColor(sw, photonFlux * f) * XYZColor(hp->sample->swl, hp->eyeThroughput);
-      osAtomicInc(&hp->lightGroupData[light_group].accumPhotonCount);
-      XYZColorAtomicAdd(hp->lightGroupData[light_group].accumReflectedFlux, flux);
+
+      // check for nan, especially from carpaint, TODO: this is an ugly fix,
+      // and the issue must be handled elsewhere
+      if(!flux.IsNaN())
+      {
+         osAtomicInc(&hp->lightGroupData[light_group].accumPhotonCount);
+         XYZColorAtomicAdd(hp->lightGroupData[light_group].accumReflectedFlux, flux);
+      }
}


You can see from the attached image that there is still lot of noise in the ball and that the color is a bit weird.
Attachments
luxball_bidir_carpaint.png
Bidir after one minute.
luxball_sppm_carpaint_fix.png
SPPM after 6 minutes, still lot of noise and colors are a bit weird
Last edited by guibou on Fri Mar 11, 2011 12:14 pm, edited 1 time in total.
guibou
Developer
 
Posts: 269
Joined: Fri Dec 04, 2009 10:14 am

Re: SPPM renderer (CPU-only)

Postby guibou » Fri Mar 11, 2011 12:12 pm

See the attached image with the fix I proposed on top of the page

Color are much better (sorry, I totally forgot to set tonemapping the same for the three images)

patch :

Code: Select all
# HG changeset patch
# User Guillaume Bouchard <guillaume.bouchard@liris.cnrs.fr>
# Parent e9bbd187259575997eb95efb167c97484521ab01
Does not account for glossy reflection on hitpoints when measuring BSDF.

diff -r e9bbd1872595 renderers/sppm/lookupaccel.cpp
--- a/renderers/sppm/lookupaccel.cpp   Fri Mar 11 18:02:54 2011 +0100
+++ b/renderers/sppm/lookupaccel.cpp   Fri Mar 11 18:11:51 2011 +0100
@@ -33,7 +33,7 @@
      if ((dist2 >  hp->accumPhotonRadius2))
         return;

-      SWCSpectrum f = hp->bsdf->F(sw, hp->wo, wi, false, BxDFType(BSDF_ALL | BSDF_DIFFUSE));
+      SWCSpectrum f = hp->bsdf->F(sw, hp->wo, wi, false, BxDFType(BSDF_TRANSMISSION | BSDF_REFLECTION | BSDF_DIFFUSE));
      if (f.Black())
         return;
Attachments
luxball_sppm_cairpaint_glossy_fix.png
SPPM after one minute, with the two patches applied
guibou
Developer
 
Posts: 269
Joined: Fri Dec 04, 2009 10:14 am

Re: SPPM renderer (CPU-only)

Postby binarycortex » Fri Mar 11, 2011 2:13 pm

guibou wrote:See the attached image with the fix I proposed on top of the page

Color are much better (sorry, I totally forgot to set tonemapping the same for the three images)

That looks great guibou, but I see a weird black shadow (ring) around the gray luxball base (stand).
Competition Coordinator.
Current Competition: Math is Beautiful / Abstract Wallpaper

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

Re: SPPM renderer (CPU-only)

Postby J the Ninja » Fri Mar 11, 2011 2:16 pm

binarycortex wrote:
guibou wrote:See the attached image with the fix I proposed on top of the page

Color are much better (sorry, I totally forgot to set tonemapping the same for the three images)

That looks great guibou, but I see a weird black shadow (ring) around the gray luxball base (stand).


It's visible in the first patch image too.
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: SPPM renderer (CPU-only)

Postby binarycortex » Fri Mar 11, 2011 2:19 pm

J the Ninja wrote:
binarycortex wrote:
guibou wrote:See the attached image with the fix I proposed on top of the page

Color are much better (sorry, I totally forgot to set tonemapping the same for the three images)

That looks great guibou, but I see a weird black shadow (ring) around the gray luxball base (stand).


It's visible in the first patch image too.

Yes it is.

Guibou, I don't suppose you would like to take a look at EXPM now, since it exhibits the same behavior and is already biased. ;)
Competition Coordinator.
Current Competition: Math is Beautiful / Abstract Wallpaper

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

PreviousNext

Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 0 guests