Veach thesis - formula question

Practical and theoretical implementation discussion.
spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Veach thesis - formula question

Post by spectral » Tue Jul 17, 2012 1:28 pm

Thanks,

Sure, I know I don't use the x(0) sample on the camera... why ?

Because it run on the GPU and I would like a 'light path' for each pixel and not for a random pixel (connection between random light path and camera give a random pixel) ! It is why I first generate a ray per pixel and connect this vertex.

It should be the same ! (I just have to account for direct hit).

The main difference is that I sample the light direction (uniform for now) and the first camera-segment is not random (Like path tracing).
Spectral
OMPF 2 global moderator

apaffy
Posts: 46
Joined: Thu Dec 01, 2011 11:00 pm
Location: UK
Contact:

Re: Veach thesis - formula question

Post by apaffy » Tue Jul 17, 2012 2:22 pm

spectral wrote:Sure, I know I don't use the x(0) sample on the camera... why ?

Because it run on the GPU and I would like a 'light path' for each pixel and not for a random pixel (connection between random light path and camera give a random pixel) ! It is why I first generate a ray per pixel and connect this vertex.
Well as long you take this into account in the full path pdf then you're fine. Essentially you are only light tracing indirect light as a result, but I assume that's intentional.

Looking at your images, it seems that the second vertex of your light subpath only seems to hit part of the scene (seems to cut off part-way down). I'd check the way you generate rays for your light source emission is oriented correctly in the world (I'd expect them to start on the surface of the sphere and generate a cosine-weighted distribution in the local positive hemisphere of the sample point).

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Veach thesis - formula question

Post by spectral » Tue Jul 17, 2012 2:55 pm

Yes,

It seems to me too :-P

1) Yes, I use cosine sampling on the light (hemisphere), I have even try uniform sampling.

2) Yes, it is generated in the right direction, it is easy to check because light-normal = (0,-1,0) in the test scene :-P

It seems to me that the light hit the top of the box, and diffusely send the light. You see we have 2 bands and exactly where the box start !
Like a missing cos-weighting ! But all the 'cos' are there !
Spectral
OMPF 2 global moderator

Igors
Posts: 17
Joined: Sat Jan 07, 2012 11:56 am

Re: Veach thesis - formula question

Post by Igors » Tue Jul 17, 2012 4:52 pm

spectral wrote: So, if someone has an idea to debug this problem ?
I would store paths' segments (maybe colored) in a text file (for 2 or some shaded points). Then load and view stored paths in 3D app

graphicsMan
Posts: 164
Joined: Mon Nov 28, 2011 7:28 pm

Re: Veach thesis - formula question

Post by graphicsMan » Tue Jul 17, 2012 5:27 pm

graphics to debug graphics... I'll +1 my vote for that approach.

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Veach thesis - formula question

Post by spectral » Wed Jul 18, 2012 9:04 am

BTW, I have change my code in order to connect to the camera vertex x(0) (camera origin), by intersecting the image plane.
But I got the same effect :-P-
Spectral
OMPF 2 global moderator

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Veach thesis - formula question

Post by spectral » Wed Jul 18, 2012 11:08 am

For sure, I miss something... please take a look at the following picture that represent my simple scene in 2D.
I use a simple lambert surface, it mean that the same light intensity is emitted (in all direction) from the top of the cube.

On the other side, there is the solid-angles (depth = 2) that will attenuate this band effect, I should have a gradient on the walls.

Finally if I use only theses rules... it is normal to have a band effect ?

So, what do I miss ? is there something else that I forget to introduce ? which rule can remove this band effect ?
lambert.png
lambert.png (13.5 KiB) Viewed 4244 times
Spectral
OMPF 2 global moderator

apaffy
Posts: 46
Joined: Thu Dec 01, 2011 11:00 pm
Location: UK
Contact:

Re: Veach thesis - formula question

Post by apaffy » Wed Jul 18, 2012 12:38 pm

spectral wrote:the same light intensity is emitted (in all direction) from the top of the cube.
I'd be careful with your definitions, Lambertian reflectance produces uniform radiance, which means the same energy for each differential projected solid angle.

Are you perhaps missing some conversion from solid angle to projected solid angle in your implementation? Perhaps this produces the visible banding.

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Veach thesis - formula question

Post by spectral » Wed Jul 18, 2012 1:04 pm

Thanks a lot,

To give more details, here is what I do...

x0 : point on light

I compute the radiance for the whole surface => Le

x1 : point on top of the box

I convert the radiance this way : L = Le * |Nl.-Wi1| |N1.Wi1| / r*r

Where:
Nl : is the light normal
N1: the normal at x1
Wi1 : is the normalized vector from the light to x1
r : the distance between the light point and x1

x2 : point on the left wall

L = f(x1) * |N2.Wi2|

BTW: I don't divide f(x1) by p(x1) because I use the light pdf (previous step)

where:
f = 1/pi (lambert brdf)
p = 1/pi (lambert pdf)
N2: normal at x2
Wi2 : is the normalized vector from the x1 to x2
Spectral
OMPF 2 global moderator

spectral
Posts: 382
Joined: Wed Nov 30, 2011 2:27 pm
Contact:

Re: Veach thesis - formula question

Post by spectral » Wed Jul 18, 2012 1:22 pm

apaffy wrote: I'd be careful with your definitions, Lambertian reflectance produces uniform radiance, which means the same energy for each differential projected solid angle.

Are you perhaps missing some conversion from solid angle to projected solid angle in your implementation? Perhaps this produces the visible banding.
You're right, but the projected solid angle is only for irradiance (incoming light...). I have also think to a missing solid angle... but in this example there is only 2 solid angles : sa(0) and sa(1), both are approximatively = 1.

I can remove the effect by doing f = f * |N1.-Wi2|... but it is incorrect !

Thanks
Spectral
OMPF 2 global moderator

Post Reply