Environment camera broken when using path integrator

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

Moderators: jromang, tomb, zcott, coordinators

Environment camera broken when using path integrator

Postby Lord Crc » Mon Mar 19, 2012 7:35 am

Hi,

seems the environment camera is broken when using the path integrator. Bidir works fine. Attached is a sample image, it looks like it's completely out of focus.

I'm don't entirely understand how this all works, but my analysis so far is that it works in bidir because bidir uses the direction sampled by EnvironmentBxDF::SampleF to recompute the image plane location for the sample, instead of using the sample's original image plane values. Path does not do this, and just uses the original image plane values.

I guess the problem is that EnvironmentBxDF doesn't implement SampleF itself, and instead uses the default implementation from BxDF, which doesn't consider the image plane position at all.

Anyway, fixing it is currently beyond me.
Attachments
env_bidir.jpg
Bidir integrator
env_path.jpg
Path integrator
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4459
Joined: Sat Nov 17, 2007 2:10 pm

Re: Environment camera broken when using path integrator

Postby Lord Crc » Mon Mar 19, 2012 7:38 am

Also, is the following test in EnvironmentCamera::GetSamplePosition correct?
Code: Select all
   if (w.x >= 0.f)
      *x = (2.f * M_PI - phi) * film->xResolution * INV_TWOPI;
   else
      *x = phi * film->xResolution * INV_TWOPI;

It seems that it should test for (x < 0.f) and not (x >= 0.f). Otherwise it's not an "inverse" of EnvironmentCamera::SampleW, but perhaps that's not the point?

Here's a quick version of the bidir render with (x < 0.f), you can see the magenta and yellow patches now have the same locations as in the path image above, relative to the red center patch.
Attachments
env_bidir2.jpg
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4459
Joined: Sat Nov 17, 2007 2:10 pm

Re: Environment camera broken when using path integrator

Postby jeanphi » Mon Mar 19, 2012 8:29 am

Hi,

I'll have a look at it.

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

Re: Environment camera broken when using path integrator

Postby SATtva » Mon Mar 19, 2012 9:05 am

Lord Crc wrote:seems the environment camera is broken when using the path integrator. Bidir works fine. Attached is a sample image, it looks like it's completely out of focus.

Was reported here: http://www.luxrender.net/mantis/view.php?id=1184

Lord Crc wrote:It seems that it should test for (x < 0.f) and not (x >= 0.f). Otherwise it's not an "inverse" of EnvironmentCamera::SampleW, but perhaps that's not the point? ... Here's a quick version of the bidir render with (x < 0.f), you can see the magenta and yellow patches now have the same locations as in the path image above, relative to the red center patch.

Currently bidir code has it correct. If you reverse it, then you'll get panorama with mirrored longitude direction.
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 5500
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Re: Environment camera broken when using path integrator

Postby Lord Crc » Mon Mar 19, 2012 9:37 am

SATtva wrote:Currently bidir code has it correct. If you reverse it, then you'll get panorama with mirrored longitude direction.


Well, if GetSamplePosition is supposed to act as the reverse of SampleW, then it's currently incorrect. If you modify the code as I suggest, it acts as the reverse of SampleW (ie it recovers the image position used as input for SampleW).
May contain traces of nuts.
User avatar
Lord Crc
Developer
 
Posts: 4459
Joined: Sat Nov 17, 2007 2:10 pm

Re: Environment camera broken when using path integrator

Postby jeanphi » Mon Mar 19, 2012 10:25 am

Hi,

It's actually SampleW that is wrong. The phi computation should have a +M_PI added. That doesn't explain why it's blurry though.

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

Re: Environment camera broken when using path integrator

Postby SATtva » Mon Mar 19, 2012 1:44 pm

Speaking of environment camera and bidir, that project has uncovered yet another problem: there are still some darkening -- a visible vertical seams in the middle of the image (see below) and on left and right edges (this one is only visible with pano viewers which interpolate both sides, e.g. freepv). They doesn't disappear regardless of rendering time.
Attachments
scene.bathroom.00001.jpg
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 5500
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Re: Environment camera broken when using path integrator

Postby jeanphi » Tue Mar 20, 2012 4:53 am

Hi,

I think that we will need to create brand new buffer types to fix this issue. Usually we slightly extend the image buffer to account for the filter width. However with the environment camera the buffer is circular so this isn't possible (when you connect a point to the camera, you can't get the 2 coordinates sets that would be required by the wraparound).

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

Re: Environment camera broken when using path integrator

Postby jeanphi » Tue May 08, 2012 5:30 pm

Hi,

Environment camera is once again operational with all integrators.

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

Re: Environment camera broken when using path integrator

Postby SATtva » Wed May 09, 2012 12:58 am

Confirmed. Great work, thanks for the fix!
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 5500
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Next

Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 1 guest