PhysicalCamera

from acron.shading import PhysicalCamera
class PhysicalCamera

Bases:

Bases: TypedReferenceCount

The 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=""]; }
__init__()

The default is the “sunny 16” rule: f/16, 1/125 s, ISO 100 (EV100 about 15), right for a sunlit outdoor scene.

property aperture → float

Getter Setter

The f-number N.

apply()

Sets pbr_exposure on the node (normally render). Call it again after changing the camera.

property ev100 → float
Getter

The exposure value at ISO 100 the settings give, less the compensation.

Setter

Sets the shutter time so that get_ev100() returns the given value (the aperture, sensitivity and compensation stay).

static 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 ev100_from_settings()

EV100 = log2(N^2 / t * 100 / S).

property exposure → float

The factor the shader multiplies scene radiance (nits) by: 1 / (1.2 * 2^EV100).

property exposure_compensation → float

Getter Setter

Stops added to the exposure (positive: brighter).

static exposure_from_ev100()

exposure = 1 / (1.2 * 2^EV100): the scale that maps a luminance at the sensor’s saturation to 1.

get_aperture()
static get_class_type()
get_ev100()

The exposure value at ISO 100 the settings give, less the compensation.

get_exposure()

The factor the shader multiplies scene radiance (nits) by: 1 / (1.2 * 2^EV100).

get_exposure_compensation()
get_sensitivity()
get_shader_input()

The shader input “pbr_exposure” (x: exposure, y: EV100).

get_shutter_speed()
static luminance_from_ev100()

The inverse of ev100_from_luminance: 2^EV100 * 12.5 / 100 nits.

property sensitivity → float

Getter Setter

The sensitivity, in ISO.

set_aperture()

The f-number N.

set_ev100()

Sets the shutter time so that get_ev100() returns the given value (the aperture, sensitivity and compensation stay).

set_exposure_compensation()

Stops added to the exposure (positive: brighter).

set_sensitivity()

The sensitivity, in ISO.

set_shutter_speed()

The shutter (exposure) time in seconds.

property shutter_speed → float

Getter Setter

The shutter (exposure) time in seconds.