Ductane v1.6.0
Contents

Docs

Documentation

45 guides to every part of Ductane 1.6.0, in reading order: start with the sample, then the frame loop, then whatever your game needs. Search them with ⌘K.

Start

The frame loop

Rendering

Loading meshesLoad USD, glTF and other formats with MeshLoader, laid out to match your pipeline, with bounds, materials, node transforms and generated tangents.Materials and texturesRead a file's metallic-roughness materials with Material and TextureSlot, load their maps once with TextureStore, and keep color and data textures apart.ShadowsCascaded sun shadows with ShadowMap and ShadowCascades, spot-light shadows in a ShadowAtlas, and point-light shadows in ShadowCubes.Clustered lightsPoint and spot lights with PunctualLight, checking a level's light budget with LightSet, and per-fragment selection with ClusterGrid and ClusteredLights.Sky and environmentA ProceduralSky as radiance by direction, prefiltered into an EnvironmentMap for image-based lighting, and how the sample draws and lights with both.The sky by the hourDaySky sets a sky by the time of day — sun, sky colors, moon and exposure from one number — SkyPass draws it with the stars, the moon's phase, aurora and a rainbow, and CloudPass lays volumetric clouds over it.Tone mappingThe HDR scene target, ToneMapping's exposure in stops and its three curves, and why the interface is drawn after the tone map.ParticlesParticleRecipe, ParticleSystem and ParticleEmitter simulate on the fixed step; ParticleRenderer draws sparks and dust into the HDR scene.DecalsDecalSet keeps marks left on surfaces, aged and faded on the fixed step; DecalRenderer draws them as quads cut from a DecalAtlas, after the opaque scene.Many copiesDraw many copies of the same meshes with one draw per submesh per kind, using InstanceBatches and InstanceBuffer, with shadows through a self-drawing ShadowMap batch.Level of detailMeshDetail makes simpler tiers of a mesh when it loads and picks the coarsest one a distant copy can use without a visible change.CullingSkip what a view cannot see with Frustum and BoundingBox — five planes under an infinite far plane — for the camera and for each shadow pass.Graphics settingsGraphicsSettings is a player's trade of looks for speed, with Low, Medium and High presets, saved with Codable; SceneScaling draws the scene smaller than the window and scales it up.The HUDHUDRenderer draws text, rectangles, lines, rings and polygons in screen space, after tone mapping, so interface colors land exactly as authored.Loading screensLoadingScreen stands in front of a world while it loads, with a title, a subtitle and a bar that only climbs, then holds, fades and says when to hand the player control.

Characters

World

Levels and the editorLevel, the engine's versioned JSON level format, and LevelEditor, an editor a game embeds to change its own levels while it runs.Worlds from a fileWorldFile is the description a world editor writes beside a scene's props — placements, ground, sky and clock, weather, sounds, markers — and WorldPackage opens the .usdz that carries it, so a game draws and walks the world as its author saw it.Drawing a worldWorldRenderer draws a world exported by a world editor — ground, props and scattered copies, sky and clouds, shadows, lights, water, effects, weather, fog and the seasons — the way the editor's own viewport draws it.The edge of the worldWorldBoundary is a dome or walls round a whole map that nothing leaves, and a net under the ground that puts anyone who falls through back where they last stood — drawn by BoundaryRenderer as a lattice, a grid, an energy field or a haze.Showing the wayWaymark draws the way to a place — a line over the ground along the way a player can walk, and a beam at the place — and WaymarkScan sends a ring out from the player that outlines what is worth finding through walls, with an icon and its distance.WeatherWeather as a few numbers — a kind, a severity, wind, snow lying, wet ground, ground fog — changed by a seeded schedule on a shared clock, drawn by WeatherRenderer, CloudPass and VolumetricFog, heard through Soundscape, and laid on a game's own surfaces by DuctaneWeather.h.The world's clockWorldClock runs the day, the season and the moon from one shared time, so every player sees the same hour; FallColors and Foliage turn a wood through the year, and Sway moves foliage and cloth in the weather's wind.AudioAudioEngine plays positional one-shots and looping sounds tied to a place, and the character controller and level supply what a footstep needs to sound right.MusicMusicPlayer plays a game's score, one track looped or a playlist in turn, faded in and out, under the player's music and main volume settings and quiet while the game is in the background.Input and settingsRead keyboard, mouse and controller through InputState, add your game's own actions, let players rebind keys and pad buttons, and keep sensitivity, invert, dead zones and head bob in PlayerSettings.Controller calibrationMeasure each thumbstick at rest with PadMeasurement, keep the result in PlayerSettings so a drifting or worn controller stays playable, and tell a pad that stopped sending from a stick being held.SavingSaveStore keeps any Codable value between runs, atomically, in a place that works sandboxed or not; PlayerSettings is the settings every first-person game needs.

Your game's name

Checking your game

Look it up