#### <sup>[Ollin](../../index.md) → [Examples](../index.md) → Rendering</sup>

---

## Rendering

| [![Accumulation](https://media.ollin.art/examples/Rendering/Accumulation/still-640.jpg?v=da9d2e69)](accumulation.md) | [![ColorOutput](https://media.ollin.art/examples/Rendering/ColorOutput/still-640.jpg?v=77208b6b)](coloroutput.md) | [![DepthOfField](https://media.ollin.art/examples/Rendering/DepthOfField/still-640.jpg?v=43c520e8)](depthoffield.md) | [![Grassland](https://media.ollin.art/examples/Rendering/Grassland/still-640.jpg?v=1f28408d)](grassland.md) |
|---|---|---|---|
| [Accumulation](accumulation.md) | [ColorOutput](coloroutput.md) | [DepthOfField](depthoffield.md) | [Grassland](grassland.md) |
| [![InstancedMesh](https://media.ollin.art/examples/Rendering/InstancedMesh/still-640.jpg?v=45979eb3)](instancedmesh.md) | [![LineSpray](https://media.ollin.art/examples/Rendering/LineSpray/still-640.jpg?v=9a01e745)](linespray.md) | [![MeshField](https://media.ollin.art/examples/Rendering/MeshField/still-640.jpg?v=1a6f4607)](meshfield.md) | [![RetainedBatch](https://media.ollin.art/examples/Rendering/RetainedBatch/still-640.jpg?v=ed95b587)](retainedbatch.md) |
| [InstancedMesh](instancedmesh.md) | [LineSpray](linespray.md) | [MeshField](meshfield.md) | [RetainedBatch](retainedbatch.md) |
| [![ToneMapping](https://media.ollin.art/examples/Rendering/ToneMapping/still-640.jpg?v=96c4a92f)](tonemapping.md) | [![ViewBoxes](https://media.ollin.art/examples/Rendering/ViewBoxes/still-640.jpg?v=4cef24c5)](viewboxes.md) |  |  |
| [ToneMapping](tonemapping.md) | [ViewBoxes](viewboxes.md) |  |  |

These examples show how the frame composites. Every frame is built in a linear floating-point canvas, and a final pass tone-maps that canvas to the screen. Because the canvas is linear and floating-point, light can sum past white and blend modes add as light. Marks can also accumulate across frames instead of clearing, which is the "sandpainting" track. See the [Drawing](../../docs/drawing/drawing.md), [HDR & tone mapping](../../docs/drawing/hdr.md), [Accumulation](../../docs/drawing/accumulation.md), and [Retained batches](../../docs/drawing/batches.md) references.

| Example | What it shows |
|---|---|
| [Accumulation](accumulation.md) | a persistent canvas that builds up over frames: slow pens and a soft mouse spray add faint light to a surface that is never cleared (`noClear()`) |
| [ToneMapping](tonemapping.md) | lamps that sum as HDR light in float and are tone-mapped onto the screen instead of clipping, with a flat `.normal` control for comparison (`toneMap(_:)`, `blendMode(.add)`) |
| [ColorOutput](coloroutput.md) | colors outside sRGB and highlights brighter than white (`colorOutput`, `Color(displayP3:)`) |
| [DepthOfField](depthoffield.md) | depth of field that comes from scattered light: each pass sends a million samples through a bokeh ball and deposits them as light (`drawParticles(style: .light)`) into a running mean (`Accumulator`), which converges instead of getting brighter, and the result is printed with `developed` (drag to change the focus distance) |
| [LineSpray](linespray.md) | a sphere of a hundred and fifty rings of light seen through a real lens: `LineSpray` scatters points along every line through a `Bokeh` ball into a running mean until bokeh appears, the camera, the lens, and the print are parameters, and `Drift` re-bends the forty thousand lines every frame across every core through `noiseFields` |
| [RetainedBatch](retainedbatch.md) | 150k stars recorded once into a `Batch` and replayed at no cost, plus a rosette stamped at many placements (`makeBatch`/`drawBatch`; flip the parameter to see the per-frame cost) |
| [InstancedMesh](instancedmesh.md) | 12,400 pillars that move with a wave, drawn from one mesh and one draw call (`drawMesh(_:instances:)`; flip the parameter to see the per-copy cost) |
| [MeshField](meshfield.md) | 240,000 solids across a foggy plain, culled on the GPU per copy (`MeshField`/`drawMeshField`; flip the parameter to see what culling saves) |
| [Grassland](grassland.md) | 500,000 blades of grass built inside the draw call, which sway and receive shadows (`StrandField`/`drawStrands`; flip the parameter to see distance grading) |
| [ViewBoxes](viewboxes.md) | one piece under six seeds on one canvas: each `withViewBox` clips and remaps a cell, so the block inside is written as if it owned the window, with its own `background` and its own mouse |

Run one with `swift run Example-Rendering-<Name>`, for example `swift run Example-Rendering-ToneMapping`.
