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

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

Lord Crc

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

Re: Environment camera broken when using path integrator

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

Lord Crc

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

Re: Environment camera broken when using path integrator

Hi,

I'll have a look at it.

Jeanphi
jeanphi

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

Re: Environment camera broken when using path integrator

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

SATtva

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

Re: Environment camera broken when using path integrator

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.

Lord Crc

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

Re: Environment camera broken when using path integrator

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

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

Re: Environment camera broken when using path integrator

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
Linux builds packager

SATtva

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

Re: Environment camera broken when using path integrator

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

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

Re: Environment camera broken when using path integrator

Hi,

Environment camera is once again operational with all integrators.

Jeanphi
jeanphi

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

Re: Environment camera broken when using path integrator

Confirmed. Great work, thanks for the fix!
Linux builds packager

SATtva

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