I have a path tracer geared towards scientific/engineering applications. It is radiometrically accurate, which is important, however I want to incorporate physically realistic (though, not necessarily exact) artifacts for 2 scenarios:
- Rendering star-fields (point lights, that do not illuminate anything in the scene and are rendered directly to the image)
- Rendering over-exposed objects (both extended objects, as well as point-sources like stars)
For 3d objects I currently perform the following:
- Using some camera model, I cast (spectral) primary rays into the scene$^1$. A path is computed, and the spectral radiance for each pixel is computed via multiple samples.
For stars (and unresolved point-sources) I currently perform the following:
- Project the points into the image space
- Apply some spreading function to spread the source across several adjacent pixels (currently I just use a gaussian for this, though I don't believe this is correct in general), and compute the spectral radiance for each pixel.
Then once I have a spectral radiance for each pixel, I perform the following:
- The spectral radiance is then multiplied by the solid angle visible to the pixel, as well as the aperture area and exposure time, to obtain the spectral energy received by the pixel.
- For each wavelength, the number of photons is computed, and then the quantum efficiency curve is used to determine the electron count.
From here my understanding is that I would look at the well-depth. If too many electrons have been accumulated (more or close to the well depth?) I'd need to simulate them overflowing into adjacent pixels. Then I'd apply the apply dark/bias noise signals, apply the gain (e-/ADU
) to obtain the count, and discretize that based on the bit-depth to get the final pixel value.
The leads me to a few questions:
I'm unsure how to actually simulate oversaturation of pixels. I'm assuming this is quite complicated and sensor dependent (and probably very expensive to compute). This is fine, I'm just not entirely sure where to get started on this.$^2$
I believe a gaussian PSF is reasonable for in-focus stars.$^3$ But is my ordering here correct? To first apply this PSF to spread the star across several pixels, and then compute all of the additional "blooming" from the sensor itself? In my head this makes sense, since the PSF is to do with the optics, while the actual response from the sensor becoming over-saturated would be different.
$^1$ I am not particularly concerned with depth-of-field, however if I was I would sample rays across the aperture and cast them towards a point on the primary ray f
away from the camera's origin as shown in figure 5.14 from PBRT
$^2$ From my own experience with camera's, it usually seems as though this type of artifact usually occurs along rows/columns of pixels, rather than radially outwards from a source, so perhaps that would make it easier, but again I'm just not sure what is actually happening here.
$^3$ I'd assume I'd need a different PSF if the images were not in focus, as out-of-focus point sources tend to look much more uniformly distributed rather than gaussian, and take on the shape of the aperture. In theory, I believe the PSF should be applied to even renderings of extended objects, but I don't think that is relevant to my purposes here. I could also see for optical systems such a telescope with a secondary mirror assembly, using a PSF that includes diffraction spikes, but again I do not believe this is relevant to my use-case and should be easy to swap one PSF for another if it ever became relevant.