Veach thesis  formula question
Re: Veach thesis  formula question
That's right...
I don't remember the reason/solution, and you ? I remember I have see this in a physics course...
Anyway, maybe I'm wrong, but I have never see anybody taking account this rule... in a renderer !
I don't remember the reason/solution, and you ? I remember I have see this in a physics course...
Anyway, maybe I'm wrong, but I have never see anybody taking account this rule... in a renderer !
Spectral
OMPF 2 global moderator
OMPF 2 global moderator
Re: Veach thesis  formula question
For solid angle defined by 4 normalized vectors (p0, p1, p2, p4 incoming from shading point) I've used
light_dir = (Func(p1, p0) + Func(p2, p1) + Func(p3, p2) + Func(p0, p3)) / 2;
where Func returns cross(vec0, vec1) * acos(vec0, vec1);
It's important to have direction (not scalar only), otherwise specular highlights are very juggy. It was several years ago and now I don't remember where I've found it
light_dir = (Func(p1, p0) + Func(p2, p1) + Func(p3, p2) + Func(p0, p3)) / 2;
where Func returns cross(vec0, vec1) * acos(vec0, vec1);
It's important to have direction (not scalar only), otherwise specular highlights are very juggy. It was several years ago and now I don't remember where I've found it
Re: Veach thesis  formula question
What are you guys talking about? The formula is perfectly correct, as it applies to infinitesimally small (i.e. differential) solid angles. If you estimate your lighting integral with a finite number of samples, it'll always be an approximation, and not because of the G term. The G term does indeed introduce a singularity, but it is not an approximation  it is a result of converting the integration measure from solid angle to surface area.
Click here. You'll thank me later.

 Posts: 166
 Joined: Mon Nov 28, 2011 7:28 pm
Re: Veach thesis  formula question
Wow, I was starting to wonder if physics had changed. I don't even understand what the light_dir direction is supposed to represent?
Re: Veach thesis  formula question
I don't understand too
I don't remember where I have see this... but I have already see a document (about physics and not about rendering) that explain that G is an approximation when using very small distance... but I'm not sure it is applicable and related to mathematic. Maybe it is related to some specific light effects in some specific conditions. Will try to find where I have see this in the past.
I don't remember where I have see this... but I have already see a document (about physics and not about rendering) that explain that G is an approximation when using very small distance... but I'm not sure it is applicable and related to mathematic. Maybe it is related to some specific light effects in some specific conditions. Will try to find where I have see this in the past.
Spectral
OMPF 2 global moderator
OMPF 2 global moderator
Re: Veach thesis  formula question
But count of rays is very finite. For example an area light is a simple rectangle that should be sampled with 100 rays only. In this case the simplified formula would produce dark artifacts nearby the light.ingenious wrote:What are you guys talking about? The formula is perfectly correct, as it applies to infinitesimally small (i.e. differential) solid angles.
Re: Veach thesis  formula question
Maybe because you divide by 0 !?
Spectral
OMPF 2 global moderator
OMPF 2 global moderator
Re: Veach thesis  formula question
If you estimate direct illumination from an area light source via area sampling, what you will get nearby the light is high variance. This will be due to the singularity in the G term, and not because G is some sort of approximation! And this high variance will result in bright speckles, not darkening. Indeed, area integration is not a good strategy for close distances, hence combining it with solid angle integration with multiple importance sampling can result in a much better estimate. See Veach's MIS paper or dissertation. There is nothing more to this in the context of MC integration.
Now, if you want to actually estimate the solid angle that an object spans for fitering or other purposes, a onesample approximation becomes arbitrarily wrong the closer the object is to the point of interest. And again, you can (Monte Carlo) integrate over the hemisphere to compute a better approximation of this solid angle. Enough with the handwaving please
Now, if you want to actually estimate the solid angle that an object spans for fitering or other purposes, a onesample approximation becomes arbitrarily wrong the closer the object is to the point of interest. And again, you can (Monte Carlo) integrate over the hemisphere to compute a better approximation of this solid angle. Enough with the handwaving please
Click here. You'll thank me later.
Re: Veach thesis  formula question
Hi,
I'm still working on my "light tracing" kernel but since a week I got the following strange effect (see first image). I can't get rid of this problem !
I use the same code for my path tracer and my light tracer... path tracing seems good (using the same theory). The main difference is :
Path tracer
1) sample one vertex on the light
2) sample a cameraray and trace => gives a cameravertex
3) connect the cameravertex with the lightvertex
4) continue the cameravertex
5) Resample one vertex on the light
6) Go to step (3) (connection)
...
Light tracer
1) sample one vertex on the light
2) sample a cameraray and trace => gives a cameravertex
3) connect the cameravertex with the lightvertex
4) continue the lightvertex
5) Resample a cameraray and trace => gives a cameravertex
6) Go to step (3) (connection)
Notice that:
1) I have (in theses images) path of length = 3 (4 vertices max)
2) I have no cameravertex on the image plane
3) I have try with uniform sampling (for the diffuse shader), this way I don't introduce any "cos"... just constants. I have the same effect. So, it seems to me that I have a problem with my PDF or solid angle somewhere !!
So, if someone has an idea to debug this problem ?
I'm still working on my "light tracing" kernel but since a week I got the following strange effect (see first image). I can't get rid of this problem !
I use the same code for my path tracer and my light tracer... path tracing seems good (using the same theory). The main difference is :
Path tracer
1) sample one vertex on the light
2) sample a cameraray and trace => gives a cameravertex
3) connect the cameravertex with the lightvertex
4) continue the cameravertex
5) Resample one vertex on the light
6) Go to step (3) (connection)
...
Light tracer
1) sample one vertex on the light
2) sample a cameraray and trace => gives a cameravertex
3) connect the cameravertex with the lightvertex
4) continue the lightvertex
5) Resample a cameraray and trace => gives a cameravertex
6) Go to step (3) (connection)
Notice that:
1) I have (in theses images) path of length = 3 (4 vertices max)
2) I have no cameravertex on the image plane
3) I have try with uniform sampling (for the diffuse shader), this way I don't introduce any "cos"... just constants. I have the same effect. So, it seems to me that I have a problem with my PDF or solid angle somewhere !!
So, if someone has an idea to debug this problem ?
Spectral
OMPF 2 global moderator
OMPF 2 global moderator
Re: Veach thesis  formula question
Your light tracing algorithm looks a bit odd, I'd expect the dual of your path tracing algorithm. Making some minor changes to connect the eye and light vertices before the light subpath is extended (to make light sources directly visible), I'd expect something like this:
Light tracer:
1) sample one vertex on the camera (for pinhole camera this will always be the pinhole itself)
2) sample one vertex on the light
3) connect the cameravertex with the lightvertex
4) continue the lightvertex (sample emission function if on light source, sample BSDF otherwise)
5) Go to step (3) (connection)
Light tracer:
1) sample one vertex on the camera (for pinhole camera this will always be the pinhole itself)
2) sample one vertex on the light
3) connect the cameravertex with the lightvertex
4) continue the lightvertex (sample emission function if on light source, sample BSDF otherwise)
5) Go to step (3) (connection)