Confusion about light PDF I have a doubt regarding shape lights pdfs, specifically various sources point at the fact that the pdf is a constant:

$$
lightpdf = 1/A
$$

Where $A$ is the area of the light surface. Expressed in solid angle terms, this becomes:
$$
lightpdf(\omega) = \frac{r^2}{cos\theta A}
$$

or $= 0$ for directions on the hemisphere which do not hit the light.

Where $r^2$ is the squared distance from the hit point o the light surface and the point we are sampling from, and $\theta$ the angle from the light surface normal and our ray direction (source).

What isn't clear to me is knowing that the pdf should satisfy this condition:

$$\int_0^{2\pi} lightpdf(\omega)d\omega = 1$$

Assuming for example a sphere light source (but a cylinder would also do), if in the second formula above we use the entire sphere area as $A$, aren't we using a solid angle for the sphere which is double of what it actually should be? (by including the half surface we cannot see from $p$:
Most of the answer is in the text you linked:


  Shapes almost always sample uniformly by area on their surface.
  Therefore, we will provide a default implementation of the
  Shape::Pdf() method corresponding to this sampling approach that
  returns the corresponding PDF: 1 over the surface area.


So it is not always 1. This is just the most basic way to sample a light. It is simple, fast and provides a good baseline to check other algorithms for correctness. As for:


  Assuming for example a sphere light source (but a cylinder would also
  do), if in the second formula above we use the entire sphere area as
  $A$, aren't we using a solid angle for the sphere which is double of
  what it actually should be? (by including the half surface we cannot
  see from $p$:


The half you cannot see will simply be excluded by the visibiliy test. Or because it is back facing, if you choose to emit light only on one side of the object. A better sampling algorithm will take that into consideration and adjust the PDF accordingly. Indeed, if you read a little further on that page, you will find:


  The second shape sampling method takes the point from which the
  surface of the shape is being integrated over as a parameter. This
  method is particularly useful for lighting, since the caller can pass
  in the point to be lit and allow shape implementations to ensure that
  they only sample the portion of the shape that is potentially visible
  from that point.


Which is exactly what you are asking about. But doing this is not about having correct sampling, it's about having efficient sampling. Any sampling method is correct as long as:


It can generate samples everywhere they are potentially needed.
Its PDF correctly represents the probability of generating each sample.