Ollin

Environments

This group covers image-based lighting, with HDRIs that are bundled, downloaded, loaded from a URL, or synthesized.

SketchWhat it shows
ImageBasedLightingenvironment(_:) lights the scene from an HDRI, so physically-based metals fill in with real reflections instead of reading near-black. The same environment also serves as the skybox backdrop.
EnvironmentGalleryThe eight bundled CC0 HDRI environments (studio, courtyard, forest, interior, city, sunrise, sunset, night) stepped through over one PBR still life. They advance on their own, or you can step with the arrow keys.
RemoteEnvironmentEnvironments fetched from the web: a sharper 2K/4K/8K backdrop for a bundled environment (highResolution(_:)), or any equirectangular HDRI URL (Environment.hdri(downloadURL:)). Each is downloaded once and cached. Any key switches.
ProceduralSkyA daylight dome with no asset. environment(.sky(...)) synthesizes a physically-based sky at runtime and sweeps its sun through a full day.
CloudscapeA raymarched cloudscape over the procedural sky.
LiveEnvironmentA live camera environment: the room the sketch is in lights the scene.

Run one with swift run Example-3D-Environments-<Name>, for example swift run Example-3D-Environments-ImageBasedLighting.

↑↓ move ↩ open