简体   繁体   中英

What units should I use for lighting in a 3D rendering engine?

In reading academic papers on rendering, graphics processing, lighting, etc..., I am finding a wide variety of units mentioned and used.

For example, Bruneton's Atmospheric Scattering paper seems to use candellas per square meter (cd/m^2), representing luminance. However, Jensen's Night Model uses watts per square meter (W/m^2), implying irradiance. Other papers mention irradiance, luminance, illuminance, etc., with seemingly no common representation of the lighting calculations used. How then, can one even be sure that in implementing all of these papers, that the calculations will "play well" together?

To add to the confusion, most papers on adaptive tonemapping seem to forego units at all, merely recommending that pixels (referred to as luminance) be rendered in a log format (decibels). A decibel is useless without a reference intensity/power.

Which begs the question, what unit does a single pixel represent? When I calculate the "average luminance" of a scene by averaging the log-brightness of the pixels, what exactly am I calculating? The term "luminance" itself implies an area being illuminated and a solid angle for the source. This leads to two more questions: "What is the solid angle of the point source?" "What is the area of a pixel?"

My question is thus, What units should lighting in a 3d graphics engine be represented in to allow for proper, calibrated brightness control across a wide variety of light sources, from faint starlight to bright sunlight, and how does this unit relate to the brightness of individual pixels?

Briefly: radiance, measured in candela per square meter ( cd/m^2 ) is the appropriate unit.


Less briefly: computer graphics is usually concerned with what things should look like to people. The units that describe this are:

  • "luminous flux" is measured in lumens , or lm , which are defined proportional to the total radiated power (in watts ) of light at a particular wavelength.
  • "luminous intensity" is measured in candela , or cd , which can be defined as lumens per steradian ( lm/sr ).

Intuitively, when you spread the same amount of energy over a larger area, it becomes proportionately less bright. This yields two more quantities:

  • "irradiance" is the luminous flux per unit area. It is measured in lm/m^2 , and is proportional to W/m^2 .
  • "radiance" is the luminous intensity per unit area. It is measured in cd/m^2 , or lm/(sr.m^2) .

Now, to answer your questions:

Each pixel represents a finite amount of solid angle from the camera, which is measured in steradian . In the context of your question, the relevant area is the area of the object being rendered .

The radiance (measured in cd/m^2 ) represents surface brightness, and has the unique property that it is invariant along any unobstructed path of observation (which makes it the most appropriate quantity for a rendering engine). The color of each pixel represents the average radiance over the solid angle occupied by that pixel.

Note that, by definition, a point source doesn't occupy any solid angle; its radiance is technically infinite. Its irradiance is finite, though, and technically it should only contribute a finite (if potentially large) effect to a given pixel value. In any case, if you want to directly render point sources, you will need to treat them differently from area sources, and deal with the problem that quantities other than radiance are not invariant over a given ray...

When Jensen et al's paper "A Physically-Based Night Sky Model" uses an irradiance-related W/m^2 in a table of various sources of illumination, I would guess that their intention was to describe their relative contribution as averaged over the entire night sky, as abstracted from any visual details.

Finally, note that truly physically based models need to integrate over the observable spectrum in order to evaluate brightness and color. Thus, such models must start out with a distribution of watts over visible wavelengths, and use the standard human colorimetric model to evaluate lumens .

The SI unit for brightness is the Candela per square metre so if your wanting to represent actual physical quantities it would be hard to argue against using that. As for how this unit relates to the brightness of an individual pixel that would be a function of the brightness at that part of the illumination source represented in the pixels viewing area combined with contributions from elsewhere in the scene as calculated by the engine - presumably this would very completely depending on the renderer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM