SDK · crate
kinogaki-viewport-api
Kinogaki's viewport packet contract: what a data type hands Studio's viewport to draw, with no GPU or UI API.
- Repository
- SDK (kinogaki/studio-sdk)
- Folder
sdk/crates/viewport-api- Source
- 10 files, 1,928 lines
- Tests
- 0 files, 0 lines
What it is
Kinogaki's viewport packet contract: what a data type hands Studio's viewport to draw, with no GPU or UI API.
SurfaceSource: the packet a kernel (meshes, CAD, SDF…) provides for drawing — shared point positions, vertex shading records, triangles, line classes (LineClass: edges, hulls, curves… each with its own look and ids) and point markers, with sparseDrawUpdateranges; aShadingPlanlets the renderer derive vertex shading from positions;FaceRuns draw some faces see-through (FaceLook). A kernel reads its own packets back withpacket_as; what a host makes from a packet (its picking structure) is kept with it (SurfaceSource::derived, anIdentity's caches).pack_linear: a linear color as the RGB9E5 word surface colors are carried in (ColorLayout).SurfaceTextures: the images (SurfaceImage) a surface's polygons show over their colors, read through aTextureCornera polygon vertex.ElementSet: the selected points, edges, faces, vertices or objects;ElementSelection: one set per drawn family (faces, lines, markers) for surfaces whose levels combine.OverlayDraw/GuideDrawlayers for diagnostics and tool guides,FaceNormals, andSceneLinesfor glyphs placed in the world (cameras, lights).
Points and directions are the SDK's Vec3, placements its Xform and quaternions [x, y, z, w]; the GPU's f32 records are made where they are uploaded.
The bytemuck feature derives bytemuck::Pod on the records a renderer uploads as bytes (Vertex, OverlayVertex, OverlayLine). Besides it, the crate depends on the SDK's geometry vocabulary alone.
Depends on
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-geometry | SDK | normal | Kinogaki Studio's standard geometry values. |
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-image-pipeline, kinogaki-math, kinogaki-pixel, kinogaki-ui, kinogaki-ui-wgpu and 2 more |
Used by
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-shared | Core and the app | normal | The crates Studio and its plugins share, built once as a Rust dylib. |
kinogaki-studio-api | SDK | normal | Kinogaki Studio's headless plugin API. |
kinogaki-studio-api-testing | SDK | normal | The SDK's test support (a dev-dependency only): assert_refused for admission tests, read_hostile for a format's tests of hostile files, format for its scratch folders and round trips, workers as a host installs them, with wgpu an ... |
kinogaki-studio-ui-api | SDK | normal | Kinogaki Studio's UI layer for plugins. |
kinogaki-studio-ui-api-testing | SDK | normal | The UI layer's test support (a dev-dependency only): headless fakes of the host's UI for plugin unit tests: RecordingUi and RecordingPainter record what a plugin asks to show and draw, and play back scripted user actions, with no window and no GPU ... |
kinogaki-testkit | Core and the app | normal | Kinogaki Studio's core testkit: toy packages written against the SDK alone, so core is tested with no real plugin. |
kinogaki-viewport-core | lib-viewport | normal | Kinogaki viewport core: what a 3D viewport shows, independent of any GPU API or UI toolkit. |
Modules
color(private)Surface colors as the viewport carries them: linear, in the host's working space, packed as RGB9E5 (pure arithmetic, no GPU).76 lineslines(private)Line classes: a packet's line segments in named groups (edges, hulls, curves, isoparm grids, sketch strokes…), each with its own look and its own id space.263 lineslooks(private)How a surface's faces are drawn: shaded clay, or see-through in a tint (a finished sketch's profiles beside the bodies of one CAD object).99 linesoverlay(private)Retained, depth-tested overlay layers drawn over a surface: diagnostic findings that name a value's points and polygons (bound to its topology, never to a packet), and tool guides with their own world-space positions.140 linespacket(private)What a renderer draws: one immutable surface packet behind theSurfaceSourcetrait, plus the element selection shown on it.493 linesselection(private)What a surface shows selected: at most oneElementSetfor each family of drawn elements, so levels that combine (a sketch's curves and points, CVs beside hull lines) show their elements selected together.141 linesshading(private)Vertex shading a renderer derives from point positions.135 linestextures(private)SurfaceTextures: the images a surface's polygons show in Shaded, each aSurfaceImagea polygon's color multiplies by, read through aTextureCornerper polygon vertex.249 linesupdates(private)Sparse upload ranges for packets derived from an earlier packet.284 lines
Public types and traits
At the crate root
Traits SurfaceSource
Structs AuthoredNormalsBufferRangesDrawUpdateElementSelectionElementSetFaceNormalsFaceRunFaceVerticesGuideDrawIdentityLineClassLineClassIdLineHighlightLineLayerLineLookLineStyleOverlayDrawOverlayLayerOverlayLineOverlayVertexPointFansSceneLinesShadingPlanSurfaceImageSurfaceTexturesTextureCornerUpdateRangesVertex
Enums ColorLayoutColumnElementKindFaceLookLinkNormalClassSmoothing
Re-exported from other crates
From kinogaki_geometry Derived
By module: 36 public types and traits in 8 modules
lines LineClassLineClassIdLineHighlightLineLookLineStyle
looks FaceLookFaceRun
overlay FaceNormalsGuideDrawLineLayerOverlayDrawOverlayLayerOverlayLineSceneLines
packet ColorLayoutColumnElementKindElementSetIdentityOverlayVertexSurfaceSourceVertex
selection ElementSelection
shading AuthoredNormalsFaceVerticesLinkNormalClassPointFansShadingPlanSmoothing
textures SurfaceImageSurfaceTexturesTextureCorner
updates BufferRangesDrawUpdateUpdateRanges
