You are right, there was a bug there--nice find! The fix that made the most sense ended up being that after ShapeSet::Sample() lets one of the shapes choose a sample point to then find the closest intersection along that ray from the point being lit with all of the shapes; if there is a closer one, then to use that one instead as the emission point.
The rough logic being that during sampling, the shapes are collectively defining a sampling distribution on the (hemi)sphere; although they sample points on their surfaces, in the end, this is just a route to choosing directions. As such, it's wrong to just assume that the originally sampled point is the one to check and see if it's illuminating the point being shaded, but that instead the sampled direction should be converted back again to a point on the light source to get the illumination point.
FWIW I used the scene file below to test it: it has a small stack of triangle light sources almost on top of each other. In the old implementation, as one added more such triangles in a single Shape call, the scene would get darker (it should have basically stayed the same brightness).
Thanks,
-matt
LookAt 0 8 -8 0 0 .5 0 1 0
Film "image" "integer xresolution" 300 "integer yresolution" 300
Sampler "lowdiscrepancy" "integer pixelsamples" [4]
Camera "perspective"
WorldBegin
AttributeBegin
AreaLightSource "diffuse" "color L" [10 10 10] "integer nsamples" [8]
Translate 2 5 0
#Shape "trianglemesh" "integer indices" [ 0 1 2 ]
# "point P" [ 0 0 0 4 0 0 0 0 10 ]
#Shape "trianglemesh" "integer indices" [ 0 1 2 ]
# "point P" [ 0 .1 0 4 .1 0 0 .1 10]
#Shape "trianglemesh" "integer indices" [ 0 1 2 ]
# "point P" [ 0 .2 0 4 .2 0 0 .2 10]
Shape "trianglemesh" "integer indices" [ 0 1 2 3 4 5 6 7 8 ]
"point P" [ 0 0 0 4 0 0 0 0 10 0 .1 0 4 .1 0 0 .1 10
0 .2 0 4 .2 0 0 .2 10]
AttributeEnd
Material "matte"
Shape "trianglemesh" "integer indices" [ 0 1 2 ]
"point P" [ 0 2 0 4 -1 0 0 -1 10]
Material "matte"
Shape "trianglemesh" "integer indices" [ 0 1 2 ]
"point P" [ -100 -1 -100 100 -1 -100 0 -1 100]
WorldEnd
> --~--~---------~--~----~------------~-------~--~----~
> You received this message because you are subscribed to the Google Groups "pbrt" group.
> To post to this group, send email to
pb...@googlegroups.com
> To unsubscribe from this group, send email to
pbrt+uns...@googlegroups.com
> For more options, visit this group at
http://groups.google.com/group/pbrt?hl=en
> -~----------~----~----~----~------~----~------~--~---
>