SDK · crate

kinogaki-viewport-api

SDK

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
depends onused by tests alonedependencies for tests alone are listed below, not drawn

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 sparse DrawUpdate ranges; a ShadingPlan lets the renderer derive vertex shading from positions; FaceRuns draw some faces see-through (FaceLook). A kernel reads its own packets back with packet_as; what a host makes from a packet (its picking structure) is kept with it (SurfaceSource::derived, an Identity'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 a TextureCorner a 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 / GuideDraw layers for diagnostics and tool guides, FaceNormals, and SceneLines for 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

CrateRepositoryAsWhat it is
kinogaki-geometrySDKnormalKinogaki Studio's standard geometry values.

Third-party

CrateVersionLicenceFrozen inAsAlso used by
bytemuck1.25.2Zlib OR Apache-2.0 OR MITlib-ui/vendornormalkinogaki-composit-wgpu, kinogaki-geometry, kinogaki-geometry-view, kinogaki-image-pipeline, kinogaki-math, kinogaki-pixel, kinogaki-ui, kinogaki-ui-wgpu and 2 more

Used by

CrateRepositoryAsWhat it is
kinogaki-sharedCore and the appnormalThe crates Studio and its plugins share, built once as a Rust dylib.
kinogaki-studio-apiSDKnormalKinogaki Studio's headless plugin API.
kinogaki-studio-api-testingSDKnormalThe 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-apiSDKnormalKinogaki Studio's UI layer for plugins.
kinogaki-studio-ui-api-testingSDKnormalThe 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-testkitCore and the appnormalKinogaki Studio's core testkit: toy packages written against the SDK alone, so core is tested with no real plugin.
kinogaki-viewport-corelib-viewportnormalKinogaki viewport core: what a 3D viewport shows, independent of any GPU API or UI toolkit.

Modules

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