Core and the app · crate
kinogaki-image-pipeline
ImagePipeline: what renders become on screen and in files.
- Repository
- Core and the app (kinogaki/studio-core)
- Folder
studio/core/image-pipeline- Source
- 24 files, 7,212 lines
- Tests
- 0 files, 0 lines
Also 1 shader or C file, 75 lines.
What it is
ImagePipeline: what renders become on screen and in files. It owns the render engines the packages bring, the document's render geometry and render scenes (core/scene's), and what renders live (live).
- One active scene. Every Render view shows the active render scene, the first Render Output at the root with its Render flag on (owner: only one render node is active at a time, and that's what the viewport shows). Its engine renders, or the project's Default Engine (Settings ▸ Project; none chosen: the first installed) when there is none or it names one not installed.
- O(1) when nothing changed. After a frame's cook is adopted,
syncreads what changed: the scene's objects (by shared allocation, only when the document's scene revision moved: a move, a flag or a body counts, not only a network edit) and the board's shown values (only when an answer arrived or the time moved: what animates reaches the geometry as the values cooked at the new time), and the keyed objects and what they hold when the time moved them or their bodies' values (Document::placements: a move sends their TRANSFORM, a light's values its prim, a Render Output's values the settings); the liveTargetthen sends the engine those objects' prims alone. An orbit changes neither: it sends the view's camera throughRenderEngine::viewand no scene update. - Nothing while nothing renders. With no Render view on, the geometry is left as it was and only the scenes (which Create reads) follow the document; the first Render view on brings it up to date once.
- Never waits. Engines render on their own threads and wake the UI once per pass through the editor's
Wake; a new camera or edit is queued, restarting the engine's refinement, and the view keeps showing what it showed. - On screen (
display): once a frame each Render view pins its engine's newest pass and draws it through the color service (core/color's: ACEScg through the viewer's display and view, lib-color's); a Render view with no pass yet shows the shaded view. - Image files are read once each, for what is asked of them, by the document's one store (
ImageFiles: relative to the project's folder, colors through the color service), each waking the window once when read: the targets' textures, the plans' images, the views' images. - Swatches (
previews): the pictures node tiles show, a node that compiles to a material at the open level rendered by its engine's preview engine in core's preview scene, one slot a node; an Image node's thumbnail (thumbnails), made on a worker from its picture read reduced from the document's image files. The Image node the inspector shows reaches the canvas the same way (picked). - Through a compiled network (
plan): what the active Render Output's Processing names, or the compiled network open, is planned by core and run on each film by its context's runner, a package's. - Live (
live): what the panes ask for, as demand: runs of plans on films of engines ([docs/LIVE-PIPELINE.md]); a plan reading no render asks no engine for anything.
Engines are made on the window's GPU device; without a device (or an engine) nothing renders. The pipeline knows no UI: what it draws on the window it hands over as draws (ImageDraw, CanvasDraw) the editor paints, and swatches as pixels (SwatchPicture).
Depends on
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-color | lib-color | normal | Color science and color management for Kinogaki. |
kinogaki-color-service | Core and the app | normal | Studio's color service: the OpenColorIO config (lib-color's built-in ACES 2.0 CG config, or a file), the working space, and the viewer's display, view, look, exposure and gamma. |
kinogaki-color-wgpu | lib-color | normal | kinogaki-color's processors on a wgpu device. |
kinogaki-cook | Core and the app | normal | Studio's core cooking engine, the same for every network kind (the owner's rule: the cooking DAG for nodes is core's). |
kinogaki-core-package | Core and the app | normal | Core's own SDK package (kinogaki.core): what Studio holds whatever plugins are installed. |
kinogaki-document | Core and the app | normal | Studio's document: the scene, a tree of objects under one root, and the core network each object of a kind naming a context holds. |
kinogaki-math | lib-math | normal | Kinogaki's vectors, points, matrices, quaternions and deterministic elementary functions. |
kinogaki-network | Core and the app | normal | Studio's core networks (design: core-owned networks; "Cooking DAG for nodes is studio core"). |
kinogaki-render-api | SDK | normal | Kinogaki's render interface: what a host (Studio) sends a render engine and what comes back, with no GPU or OS API. |
kinogaki-scene | Core and the app | normal | Studio's scene: the document cooked object by object. |
kinogaki-studio-api | SDK | normal | Kinogaki Studio's headless plugin API. |
kinogaki-viewport-core | lib-viewport | normal | Kinogaki viewport core: what a 3D viewport shows, independent of any GPU API or UI toolkit. |
For its tests alone
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-anim | Core and the app | tests | Studio's animation channels. |
kinogaki-testkit | Core and the app | tests | Kinogaki Studio's core testkit: toy packages written against the SDK alone, so core is tested with no real plugin. |
Third-party
| Crate | Version | Licence | Frozen in | As | Also used by |
|---|---|---|---|---|---|
bytemuck | 1.25.2 | Zlib OR Apache-2.0 OR MIT | lib-ui/vendor | normal | kinogaki-composit-wgpu, kinogaki-geometry, kinogaki-geometry-view, kinogaki-math, kinogaki-pixel, kinogaki-ui, kinogaki-ui-wgpu, kinogaki-viewport-api and 2 more |
log | 0.4.34 | MIT OR Apache-2.0 | lib-ui/vendor | normal | kinogaki-editor, kinogaki-scene, kinogaki-shared, kinogaki-ui, kinogaki-ui-shell, kinogaki-ui-wgpu |
Used by
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-editor | Core and the app | normal | Kinogaki Studio's editor: the document and everything the window shows of it, as parts one frame borrows one by one. |
Modules
canvasThe 2D canvas on the GPU: a picture's pieces composited (compose) into a target the size of the pane, of the code values of the display it is for, each piece entering as it says: a render through its own color management, a scene-referred file through the ...473 linescanvas::composeThe one compositor, of the Canvas and of every picture written: quads of pixels drawn back to front into a target of one display's code values, premultiplied, blended in that display's encoding.468 linescanvas::outA picture written to a file: the pieces composited as the canvas composites them, one pixel a canvas unit, on the window's device on a thread of its own (it waits for its tiles, the files it reads and its read-back, and the window never does), and read back ...107 linescanvas::tiles(private)An image on the canvas's device: a texture a level, made when a zoom first shows that level, holding the tiles the views have asked for.678 linescanvas::tiles::quads(private)An image's quads on the canvas: a tile's, coarsest level first, or the whole of a live result's image over the piece's plane.180 linesdisplay(private)The Render views' images on screen: each view's newest pass, pinned where its engine wrote it (Display::acquire: the engine renders on the window's device and its images are textures there; nothing is copied), drawn through the color service's display and ...525 linesfiles(private)Images written through the installed formats: the writer a file's extension names among those writing Images (writer_for), given what its files hold (write): a display's code values for a writer that is display-referred (picture: a PNG's, a ...80 linesfinal_image(private)A final frame's Image as its writers and plans take it: its beauty (the main layer) as floats or half floats, replaced by what a plan made, and its colors in the working space, tagged with it, for an EXR.126 linesfinal_plan(private)A final render's plan run once on the finished outputs, on the writer's thread, on the window's device: each output the plan reads uploaded, the result read back in the beauty's place when it is what the render outputs, and what each File Out writes read back ...195 linesfinalsFinal renders (Render ▸ Render Image, Frame Range, Render Selected, Render All): a list of (render scene, frame) jobs (Finals::jobs) run one after another.705 lineslive(private)The live pipeline (docs/LIVE-PIPELINE.md): a graph of demand, walked once a frame from what the visible panes ask for.350 lineslive::films(private)The films a frame's runs read: each with its engine, made and let go by demand, its camera and size sent when they change, its settings by what its Render Output holds, and the films' memory bounded by their pixels.357 lineslive::freezing(private)Freezing nodes of a compiled network: they have no cooked outputs to keep, so what each shows now is run as a result, read back off the UI's thread (on the pipeline's one reader,FreezeReads) and kept as the node's image, as a frozen node keeps a cooked ...153 lineson_canvas(private)The image pipeline for the 2D canvas: pixels of what it shows, pictures written, the shape a pane's frame draws.86 linesoutputs(private)How pictures reach displays: the project's output, which a page composes for, and each Render Output's color management over it, which its result develops through on the Canvas, in its final files, and where a page places it.130 linespicked(private)The Image node the inspector shows, on the canvas: where the open level shows nothing of its own there (a library, a material's Shading network, a network of geometry), the canvas shows it as it shows a value.74 linesplan(private)What Render views and the canvas show through a compiled network, held by a Render Output: inside such a network, the open level's displayed node; elsewhere, what the active render scene'sProcessingnames (its own network or another Render Output's, its ...358 linespreviews(private)Swatches: the pictures nodes show on their tiles, each rendered by the engine its material belongs to; a MaterialX material, which belongs to none, by the project's Default Engine (as it adopts it).590 linesprobe(private)What the harness reads of the pipeline (theharnessfeature): every probe is here, reading the parts' own state, so nothing in them is kept or counted for it alone.149 linesreadbackReading an image's pixels back from the GPU, waiting for it: what a final render's worker and the canvas's probe worker do, never the window's thread.89 linesthumbnails(private)Image nodes' tile pictures: each Image node of the open level reading a file or an embedded file shows its picture on its tile, as swatches show materials (SwatchPicture).445 linesview(private)One film: the camera and size it last sent its engine, and the smaller film it renders while the camera moves.251 lines
Public types and traits
At the crate root
Structs FilmImageDrawImagePipelineMachineSwatchPicture
Enums FollowedSurface
Re-exported from other crates
From kinogaki_color_service ColorManagement
By module: 8 public types and traits in 6 modules
canvas CanvasDrawFrameShows
display ImageDraw
finals Step
live Surface
picked Followed
previews SwatchPicture
