PhysicalCamera¶
-
class PhysicalCamera¶
Bases:
TypedReferenceCountThe exposure of a physical camera: aperture (f-number N), shutter time t in seconds and sensitivity S (ISO), after Lagarde and de Rousiers, “Moving Frostbite to PBR” (SIGGRAPH 2014), section 5.1:
EV100 = log2(N^2 / t * 100 / S) - exposure_compensation exposure = 1 / (1.2 * 2^EV100)
1.2 is the saturation-based sensor calibration (78 / (100 * 0.65)). The PBR shader multiplies all the light it computes (lights, image-based light, emission) by the exposure before it writes the colour (“pre-exposure”), so a frame lit by 100 000 lux of sun lands near 1 and stays well inside half-float range.
apply()puts the exposure on a node as the shader input pbr_exposure.A positive exposure_compensation brightens the image by that many stops.
Inheritance diagram
digraph inheritance10faa04caa { bgcolor=transparent; rankdir=BT; size="8.0, 12.0"; "DTOOL_SUPER_BASE" [fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style=""]; "PhysicalCamera" [URL="acron.shading.PhysicalCamera.html#acron.shading.PhysicalCamera",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedReferenceCount" -> "PhysicalCamera" [arrowsize=0.75,style=""]; "ReferenceCount" [URL="acron.core.ReferenceCount.html#acron.core.ReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "ReferenceCount" [arrowsize=0.75,style=""]; "TypedObject" [URL="acron.core.TypedObject.html#acron.core.TypedObject",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "DTOOL_SUPER_BASE" -> "TypedObject" [arrowsize=0.75,style=""]; "TypedReferenceCount" [URL="acron.core.TypedReferenceCount.html#acron.core.TypedReferenceCount",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=11,height=0.25,shape=box,style="",target="_top",tooltip="/**"]; "TypedObject" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; "ReferenceCount" -> "TypedReferenceCount" [arrowsize=0.75,style=""]; }- PhysicalCamera.__init__()¶
The default is the “sunny 16” rule: f/16, 1/125 s, ISO 100 (EV100 about 15), right for a sunlit outdoor scene.
- PhysicalCamera.apply()¶
Sets pbr_exposure on the node (normally render). Call it again after changing the camera.
- static PhysicalCamera.ev100_from_luminance()¶
The EV100 that a reflected-light meter (calibration constant K = 12.5) reads for an average scene luminance in nits: log2(L * 100 / 12.5).
- static PhysicalCamera.ev100_from_settings()¶
EV100 = log2(N^2 / t * 100 / S).
- static PhysicalCamera.exposure_from_ev100()¶
exposure = 1 / (1.2 * 2^EV100): the scale that maps a luminance at the sensor’s saturation to 1.
- PhysicalCamera.get_aperture()¶
- static PhysicalCamera.get_class_type()¶
- PhysicalCamera.get_ev100()¶
The exposure value at ISO 100 the settings give, less the compensation.
- PhysicalCamera.get_exposure()¶
The factor the shader multiplies scene radiance (nits) by: 1 / (1.2 * 2^EV100).
- PhysicalCamera.get_exposure_compensation()¶
- PhysicalCamera.get_sensitivity()¶
- PhysicalCamera.get_shader_input()¶
The shader input “pbr_exposure” (x: exposure, y: EV100).
- PhysicalCamera.get_shutter_speed()¶
- static PhysicalCamera.luminance_from_ev100()¶
The inverse of ev100_from_luminance: 2^EV100 * 12.5 / 100 nits.
- PhysicalCamera.set_aperture()¶
The f-number N.
- PhysicalCamera.set_ev100()¶
Sets the shutter time so that
get_ev100()returns the given value (the aperture, sensitivity and compensation stay).
- PhysicalCamera.set_exposure_compensation()¶
Stops added to the exposure (positive: brighter).
- PhysicalCamera.set_sensitivity()¶
The sensitivity, in ISO.
- PhysicalCamera.set_shutter_speed()¶
The shutter (exposure) time in seconds.