Calculating the power received by a pixel from a set of rays

I've written a path tracer and am now working on implementing a physically accurate way of simulating the actual sensor response for a given wavelength$$^*$$, given an exposure time, aperture size, pixel size, and quantum efficiency.

The current way I've thought about framing this is as follows (this algorithm is done for each pixel):

1. Path-trace many rays and evaluate the Bidirectional Reflectance Distribution Function (BRDF) (or BTDF/BSDF) to obtain the radiance along each ray received by the pixel. This part is done.
2. Take all of the rays received by a pixel, and average their radiance values to obtain a "received" radiance (units of $$[W\cdot sr^{-1} \cdot m^{-2}]$$) for the pixel.
3. Look up the solid angle field-of-view of a pixel (this is precalculated beforehand) and multiply that solid angle by the radiance to obtain the irradiance (units of $$[W\cdot m^{-2}]$$)
4. Multiply the irradiance by the area of the aperture to obtain the received power (units of $$[W]$$)
5. Multiply the power by the exposure time to obtain the energy (units of $$[J]$$)
6. Divide the energy by the photon energy (given by $$E = h f$$) for a given wavelength to obtain the photon count.
7. Multiply the photon count by the quantum efficiency and generate the signal.

Is this the correct way of calculating this? My primary concern is in steps 2 and 3 as I am not terribly comfortable with solid angles. My rationale is that the solid angle of the pixel's field-of-view determines how much of the scene is actually contributing light to the pixel, and we're approximating that part of the scene by casting discrete rays which we can then average. And this should naturally capture the effect that increasing the pixel size correspondingly increases the pixel's solid angle thus an increase in the irradiance at the aperture that contributes to the pixel, and thus increased response. But like I said, the nature of solid angles has me tripped up, particularly because it is often said that the radiance along a ray is reversible, and so I'm not sure "which" solid angle to actually be using.

$$^*$$ Currently I'm able to assume a single wavelength at a time, however in the future if I were to extend this to handle a broad-spectrum, I would modify steps 1 and 2 to calculate the spectral radiance with units of $$[W\cdot sr^{-1} \cdot m^{-2} \cdot Hz^{-1}]$$. Then when we continue on to step 3 we would calculate a spectral irradiance with units of $$[W\cdot m^{-2} \cdot Hz^{-1}]$$, and then step 4 would produce a spectral flux with units of $$[W\cdot Hz^{-1}]$$. Then we calculate the energy of photons for each frequency in our spectrum to obtain the photon counts for each frequency and then convolve the resulting energy spectrum with the quantum efficiency spectrum.

1 Answer

Step 1 is good. Wikipedia shows examples of diffuse, glossy, and mirror surfaces. Many non-mirror surfaces have a specular component. That is, they produce a combination of diffuse and mirror reflection.

You might combine steps 2 and 3. You would integrate the radiance over the solid angle of a pixel's field of view to get power density at the pixel.

For step 4, different pixels might receive different power. Integrate power density over the sensor to get total power.

• For your last point: Different pixels surely would receive different power, but we're producing an image so we wouldn't want to integrate all pixels together. What we want is to produce an image, while properly simulating the response of each individual pixel. I apologize if that wasn't clear, or if I'm misunderstanding your response. For your second point: I'm a bit confused what you mean by combining the two steps. Commented Feb 2, 2023 at 16:42
• Given your clarification for the last point, it sounds like you are right. For 2 and 3, don't average the radiance. The pixel looks at a field of view where many rays arrive from many directions. Add up the contribution to the radiance from each direction. Commented Feb 2, 2023 at 16:51
• But simply adding the ray's radiance contribution would mean that casting more rays leads to more radiance. An infinite number of rays would result in an infinitely bright pixel which is clearly not the case. More rays should just converge to be a better and better approximation of reality. Unless I'm misunderstanding what you mean or how that process should work Commented Feb 2, 2023 at 16:56
• You would integrate over a solid angle. $I = \int S d\omega$. Each ray is the contribution of a small patch in the field of view. Each ray contributes $Sd\omega$. If you use two rays with approximately the same S over some $d\omega$, each is applied to half the $d\omega$. Commented Feb 2, 2023 at 17:08
• Is that not the same as a simple averaging? Say I had a pixel with a solid angle fov of $\omega$, and say i uniformly cast 60 rays from the pixel. Each ray represents 1/60th of $\omega$ so summing them up multiplied by that factor is simply averaging, no? As average is just $r_t = \frac{1}{n} \Sigma_i^n (r_i)$, which would feel like the same as doing $r_t = \int_{\Omega} r \frac{d\omega}{n}$ Commented Feb 2, 2023 at 17:15