Page 1 of 1

Emissive surfaces and visibility term

Posted: Sun Jul 22, 2018 9:48 pm
by szellmann
I'm wondering, in a naive path tracer w/o NEE or MIS, do I have to scale the contribution of an emissive surface by a dot(n, -ray.dir) term? Intuition says yes because light intensity depends on solid angle - lights viewed from a grazing angle appear darker than lights viewed from normal direction. I'm not sure, I've seen both in actual implementations. Any suggestions?

Re: Emissive surfaces and visibility term

Posted: Mon Jul 23, 2018 11:01 am
by josh247
Intuitively speaking the importance of the path from the camera is spread out when projected onto the emitting surface, but this is cancelled out by a larger surface area emitting light. So my understanding is that you can include the term, but this will just be defining a non uniform directional distribution from the surface. Please do correct me if I'm wrong.

Re: Emissive surfaces and visibility term

Posted: Mon Jul 23, 2018 1:44 pm
by friedlinguini
I'd say no. Without explicit light source sampling, all geometric factors relating to the light source--surface area, distance, and cosine term--are accounted for in the probability of a ray hitting the light source "by accident." For example, if the geometric normal of a triangular light source is perpendicular to ray.dir, then a camera at the ray origin is looking at the triangle edge-on and won't see any of the surface.

If it's a Lambertian light source, all you need to know about the light is the whether or not the ray hit it, and the constant intensity emitted.

Re: Emissive surfaces and visibility term

Posted: Tue Jul 24, 2018 8:39 am
by szellmann
all geometric factors relating to the light source--surface area, distance, and cosine term--are accounted for in the probability of a ray hitting the light source "by accident."


This explanation makes sense. What confuses me however is that both surface area and distance (squared) are part of the pdf (for hitting the light source directly), while the cosine term isn't. (The cosine term goes into the same equation, however.)

Consider a path where the camera ray (accidentally) directly hits a light source with constant intensity (no Lambertian light source or so). In this case the angle of direction goes nowhere into the equation. The throughput is just set to the absolute intensity of the light source, no matter at what angle the camera ray hit it. This is what confuses me.

It's probably just me not getting the intuition right.. I'm digging through the PBR book, maybe I'll have a better intuition soon.

Re: Emissive surfaces and visibility term

Posted: Tue Jul 24, 2018 4:36 pm
by ingenious
TL;DR: If a ray randomly hits a light source, you should not be multiplying by the cosine as it's importance sampled and cancels out.

In Veach's integral formulation of light transport it's all crystal clear. The radiance emission at every point on a diffuse light source is uniform (i.e. the same in every direction). The pixel measurement contribution of every path includes the inverse squared distance, the visibility and the cosines at both the light source and the illuminated surface. But then there's the path sampling density (pdf), which for a unidirectionally sampled path includes the inverse distance, the visibility, the cosine at the light source, and potentially the cosine at the illuminated surface (depending on the direction sampling technique on that surface). So when you divide the path measurement contribution by the path pdf, these terms cancel out and what''s left is the (uniform) radiance emission at the light source.

Re: Emissive surfaces and visibility term

Posted: Wed Jul 25, 2018 7:59 pm
by szellmann
@ingenious Thanks, that was helpful! I read Veach's thesis Chapter 8 which explains a lot.

The intensity of the emissive objects themselves is uniform (i.e. same intensity in every direction), as you sad.

When I just naively evaluate the LTE, cosine terms etc. come into play inside the integral. When I hit the light directly, it's just L_e.

When I explicitly sample a light source, I calculate the pdf and have to mind cosine terms, visibility, area, distance^2 etc.

But the latter is not in particular the case because I sample a light source, but because I construct a custom path (so to say) with a vertex I have deliberately chosen (the vertex happens to be on a light source). It's Veach's equations (8.2) and (8.3) that explain that in general the above factors go into the pdf of a certain path that I construct, no matter if the vertices are on a light source or not.

Re: Emissive surfaces and visibility term

Posted: Thu Jul 26, 2018 11:12 am
by ingenious
In Veach's framework the measurement contribution of a path is always the same and it includes all cosines and inverse squared distances along the entire path. But a given path can be sampled in many different ways, i.e. via different techniques. The pdfs of some techniques will include some cosines and inverse squared distances, so when the contribution is divided by the pdf, then these cancel out and don't need to be computed.

That's basically it. The pure unidirectional sampling technique importance samples the inverse squared distance to the light source and the cosine at the light source, so these cancel out. But next event estimation (i.e. sampling a point directly on the surface of the light source) importance samples neither of these terms, so they do not appear in the pdf and consequently don't cancel out. The key to ensuring everything works out correctly (even on paper) in Veach's framework is to make sure the pdf of every vertex in the path is expressed w.r.t. the area measure. It's in the pdf conversion from solid angle measure from area measure where these inverse squared distances and cosines appear (and then cancel out).