▼V Reference
52 Find a task or a name
53 Modules to require
54 Scenes and sampling
55 Scene states
56 Animation requests
57 Native model details
58 Visuals
59 Geometry
60 Number Lines and Coordinate Decorations
61 Point Markers, Scatter Plots, and Filled Areas
62 Probability and Statistical Diagrams
63 Calculus lessons
64 Colors
65 Slides
66 Slide command-line tools
67 Source Programs and Authored Timelines
68 Interactive Preview and Inspection
69 Preview controls and diagnostics
70 Projects and Final Rendering
71 Project execution and cache details
72 Pict Renderer Protocol
73 3D reference map
74 3D:   Objects, groups, and paths
75 3D:   Cameras and projection
76 3D:   Views inside a Scene
77 3D:   Animating 3D objects
78 3D:   Animating the 3D camera
79 3D:   Cuts, caps, and section measurements
80 3D:   Supplementary surface, section, and annotation bindings
81 3D:   Cuts, sections, and numerical volume
82 3D:   Vectors
83 3D:   Linear maps and rotations
84 3D:   Affine transforms
85 3D:   Bounds, rays, and planes
86 3D:   Spatial maps and homotopies
87 3D:   Materials and lights
88 3D:   Lighting inspection
89 3D:   Shadow descriptors and stable bounds
90 3D:   Finite-light animation
91 3D:   Software finite-light evaluation
92 3D:   Colour space and final output
93 3D:   Relations and geometric annotations
94 3D:   Projected labels
95 3D:   Textured billboards
96 3D:   Spatial curves and vector diagrams
97 3D:   Spatial anchors and label layout
98 3D:   Anchors and projected labels
99 3D:   Parametric surfaces and calculus
100 3D:   Adaptive, trimmed, and implicit surfaces
101 3D:   Constructive solids
102 3D:   Surface constructors and queries
103 3D:   Meshes
104 3D:   Triangle topology
105 3D:   Polygonal faces
106 3D:   Deterministic convex hulls
107 3D:   Polyhedral duals
108 3D:   Schlegel diagrams and polyhedral nets
109 3D:   Conservative mesh correspondence
110 3D:   Topology-safe mesh matching
111 3D:   Checking and repairing mesh orientation
112 3D:   Clipping, sections, and transparency
113 3D:   Prepared spatial ODE trajectories and vector fields
114 3D:   Seeds and streamline sets
115 3D:   Poincare sections and return maps
116 3D:   Equilibria and local linearization
117 3D:   Flow maps and volume change
118 3D:   Drawing and inspecting trajectories
119 3D:   Reading prepared trajectories
120 3D:   Drawing vector fields and particles
121 3D:   Trajectory display
122 3D:   Spatial inspection and exact picking
123 3D:   Retained renderer backends
124 3D:   Compiled geometry and instances
125 3D:   Frame requests and results
126 3D:   Software rendering and statistics
127 3D:   Optional Racket/  Open  GL backend
128 Experimental Derived Visuals
129 Source Package Hygiene
On this page:
linear-rgba3d
srgb-channel->linear
linear-channel->srgb
rgba-srgb->linear
rgba-linear->srgb
linear-rgba3d-over
tone-map3d
default-tone-map3d
tone-map3d-apply
9.3

92 3D: Colour space and final output🔗ℹ

3D reference map · First 3D picture

Semantic rgba-color values are sRGB: RGB channels use the ordinary 0 through 255 display encoding and alpha is linear coverage. Before interpolation, lighting, or source-over composition, an opaque 3D renderer converts RGB into linear light. It keeps a separate linear-rgba3d value internally because material emission or specular terms may exceed one without being clipped. At the final output boundary RGB is tone-mapped, converted back to sRGB, and stored; alpha is preserved unchanged.

struct

(struct linear-rgba3d (red green blue alpha)
    #:transparent)
  red : nonnegative-real?
  green : nonnegative-real?
  blue : nonnegative-real?
  alpha : (and/c real? (between/c 0 1))
An internal-style straight-alpha linear-light colour. RGB is nonnegative and may exceed 1 before tone mapping.

procedure

(srgb-channel->linear channel) → real?

  channel : (and/c real? (between/c 0 1))
Applies the IEC 61966-2-1 sRGB transfer curve to one normalized channel.

procedure

(linear-channel->srgb channel) → real?

  channel : (and/c real? (between/c 0 1))
Applies the inverse IEC 61966-2-1 transfer curve to one normalized channel.

procedure

(rgba-srgb->linear color) → linear-rgba3d?

  color : rgba-color?
Converts a semantic sRGB colour to straight linear light; alpha is unchanged.

procedure

(rgba-linear->srgb color) → rgba-color?

  color : linear-rgba3d?
Converts a unit-range linear-light value to semantic sRGB. Values above one must first be passed through tone-map3d-apply.

procedure

(linear-rgba3d-over source destination) → linear-rgba3d?

  source : linear-rgba3d?
  destination : linear-rgba3d?
Performs straight-alpha source-over in linear light.

struct

(struct tone-map3d (mode exposure white-point)
    #:transparent)
  mode : (or/c 'clamp 'reinhard)
  exposure : nonnegative-real?
  white-point : positive-real?
The immutable final RGB output policy. Exposure multiplies linear RGB before the selected operator. 'clamp clamps the exposed value to one; 'reinhard maps an exposed channel x to x/(x + white-point). The white point is retained for 'clamp too, so a later mode switch preserves the authored policy.
The default (tone-map3d 'clamp 1 1).

procedure

(tone-map3d-apply policy color) → linear-rgba3d?

  policy : tone-map3d?
  color : linear-rgba3d?
Applies policy to RGB only and preserves alpha exactly.

Limitations. The colour contract covers opaque 3D rendering and its 3D strokes, markers, and billboards. It does not provide ICC profiles, wide-gamut or display-HDR export, texture colour-space metadata, or guaranteed linear composition between a rendered view3d and arbitrary outer two-dimensional Picts. Transparency remains order-sorted rather than order-independent.

The runnable comparison is "examples/3d/tone-map-emission.rkt"; it uses strong emission to show the visible difference between the default clamp policy and Reinhard output.