Ava3DControl · Documentation
API Reference
Types and members in Ava3D, grouped by topic.
Controls
The one type you add to a window, when it decides to draw, and what it keeps on the card between scenes.
| Type | Description |
|---|---|
| Ava3DView | A 3D view that works on every platform Avalonia targets, including the browser. |
| RenderTrigger | When Ava3DView draws a frame. |
| SwapPolicy | What happens on the frame after Ava3DView.Scene is assigned: draw the new scene at once, with stand-ins where its textures have not arrived, or keep showing the old one until they have. |
| ResourcePolicy | How long a view keeps textures and meshes on the card once nothing is drawing them, how much it may keep, and how much of each frame it spends copying new ones up. |
| Resources | Process-wide defaults for how resident resources are kept. |
| PrepareProgress | How far Ava3DView.PrepareAsync has got, reported through its IProgress. |
| ScenePreparation | What Ava3DView.PrepareAsync did, once it has finished. |
Scene and camera
A tree of nodes with transforms and a camera to look at them with.
| Type | Description |
|---|---|
| Scene | The scene: a root transform, its nodes, its lights and a background colour. |
| Node | A node in the scene graph: a transform, and children that inherit it. |
| MeshNode | A node that draws geometry. |
| MeshInstance | One copy of a mesh, and what makes it different from the others. |
| LevelOfDetail | A coarser version of a MeshNode's mesh, drawn in its place from a distance onwards. |
| LevelOfDetailCollection | A node's levels of detail, in any order: they are sorted by distance when the scene is drawn. |
| NodeCollection | The children of a Node. |
| Camera | An orbit camera: a point it looks at, and a direction and distance it looks from. |
Lights
As many as a scene wants, plus the ambient hemisphere that fills in everything they miss.
| Type | Description |
|---|---|
| Light | What every light has in common. |
| DirectionalLight | A light with a direction but no position: the sun, and anything else far enough away that its rays arrive parallel. |
| PointLight | A light at a position, falling off with distance. |
| SpotLight | A light with a position, a direction and a cone: a torch, a stage lamp, a headlight. |
| LightCollection | The lights in a scene, in the order they were added. |
| EnvironmentLight | The light that comes from everywhere: the sky, the ground, the room. |
| EnvironmentImage | Immutable linear RGB radiance in an equirectangular image. |
| EnvironmentProbe | A baked room reflection with world-space box influence and box-projected specular parallax. |
| ProbeCaptureOptions | Settings for EnvironmentProbe.CaptureAsync. |
Sprites, lines and points
The three things in a scene that are not lit triangles: billboards, segments and clouds.
| Type | Description |
|---|---|
| SpriteNode | A textured quad that always faces the camera, centred on the node's position. |
| LineNode | Unlit line segments, transformed by the node's world matrix. |
| PointsNode | Unlit points, transformed by the node's world matrix. |
Overlays and labels
Position Avalonia controls over a scene and render text on sprites.
| Type | Description |
|---|---|
| Ava3DOverlay | Places ordinary Avalonia controls at positions in an Ava3DView's scene. |
| OverlayAnchor | Which point of a child sits on the world position it is anchored to. |
| OverlayBehind | What to do with a child whose world position is not in front of the near plane. |
| OverlayOffScreen | What to do with a child whose projected point is outside the panel. |
| OverlayOcclusion | Whether a child is hidden when the scene is in front of the thing it is anchored to. |
| OcclusionPrecision | How exact an occlusion test is, against what it costs. |
| LabelNode | A line of text standing in the scene: a nameplate on a hull, a sign on a bulkhead, a caption on a plinth. |
| TextOptions | How a string becomes a texture. |
Geometry
Vertex data, the shapes that come free, the box every node knows about itself, folding a static assembly into fewer of them, and a mesh from a signed-distance function.
| Type | Description |
|---|---|
| Mesh | Triangle geometry, independent of where it sits in the world. |
| Primitives | Ready-made geometry, so a scene can be built without a model file. |
| BoundingBox | An axis-aligned box. |
| Batching | Folding a group's static surfaces into as few draws as they can be drawn in. |
| SurfaceNets | Turns a signed-distance field into a Mesh. |
| ScalarField | A signed distance: how far point is from a surface, negative inside it and positive outside. |
| SurfaceNetsOptions | What SurfaceNets.Extract is given beyond the field, the box and the resolution. |
| SurfaceNetsBudgetException | Thrown by SurfaceNets.Extract when the surface would have more triangles than SurfaceNetsOptions.MaxTriangles allows. |
Math utilities
Rotations from directions, curves through waypoints, easing, and randomness you can repeat.
| Type | Description |
|---|---|
| Rotations | Rotations built from directions rather than from angles. |
| Spline | A smooth curve through a row of points, and the direction it is going when it gets there. |
| Ease | Shaping a 0..1 parameter, so a move starts and stops instead of switching on and off. |
| Scatter | Repeatable randomness, indexed rather than drawn. |
Materials and textures
Metallic-roughness parameters, the maps that drive them, and how a surface is composited.
| Type | Description |
|---|---|
| Material | The surface appearance of a MeshNode: metallic-roughness PBR, the same model glTF 2.0 defines, so a loaded model looks the way its author intended rather than the way a viewer guessed. |
| AppearanceKind | What kind of thing an AppearanceParameter adjusts. |
| AppearanceParameter | One thing about a model a caller may adjust, with enough about it to build a control without knowing what the model is. |
| MaterialLookup | The materials of a loaded model, addressed by the names the file gave them. |
| BlendMode | How the fragments a material produces combine with what is already in the frame. |
| CullMode | Which side of a triangle is drawn. |
| Texture | An image: either encoded bytes (PNG or JPEG) or raw RGBA pixels. |
| TextureColorSpace | How the bytes of a Texture are encoded, when the slot they are put in should not be the one to decide. |
| TextureProgram | A texture whose pixels are computed rather than stored: a small program, evaluated over the surface, with the scene's clock as one of its inputs. |
| TextureMapping | Coordinates for one material texture. |
| TextureWrap | How a texture behaves outside 0..1. |
| TextureFilter | How a texture is sampled between its texels. |
| TextureFormat | A block-compressed texture format, as the hardware stores it. |
| UvSource | Which side of a triangle is rasterised. |
| MappingSpace | Whether a projection travels with the object or stays fixed in the world. |
| DetailLayer | The lights in a scene. |
| ShadingModel | How a surface turns light into colour. |
| MatcapTextureMode | Where a matcap's texture lives on the graphics card, which is a question only because the oldest tier this control runs on guarantees exactly eight sampler units and the mesh shader now has eight maps. |
| VertexAlphaMode | What the alpha channel of Mesh.Colors means on a material that is not transparent. |
Animation
Play, blend and layer animation clips, with tracks, masks and playback events.
| Type | Description |
|---|---|
| Animator | Plays clips over a node tree, one state at a time with a blend between the outgoing and the incoming. |
| AnimationClip | A named set of tracks — one animation as an authoring tool exported it. |
| AnimationTrack | One animated property of one node: a sorted key time array and the values at those times. |
| AnimationState | One clip as something that can be playing: its own time, speed, looping and blend weight. |
| AnimationStateCollection | The states an Animator knows, addressed by name. |
| AnimationLayer | One crossfading player: a set of states, which of them is playing, and how its pose meets the ones below it. |
| AnimationMask | Which nodes a layer is allowed to move. |
| AnimationBlend | How a layer combines with what is already posed beneath it. |
| AnimationInterpolation | How values between two keys are found. |
| AnimationPath | Which property of a node a track writes. |
| AnimationReference | What an additive layer measures its difference from. |
| AnimationEventArgs | The state a Animator.Finished event is about. |
Skinning and morph targets
Deform meshes with skeleton joints and blendable vertex shapes.
| Type | Description |
|---|---|
| Skin | A skeleton: the nodes that drive a skinned mesh, and the matrices that put the mesh into each of their spaces. |
| JointBinding | The four joints that move one vertex, and how much each of them does. |
| MorphShapes | The morph targets of a loaded model, addressed by name, with opposed pairs folded into one signed parameter each. |
| MorphWeights | Every morph target of a model by its own name, unpaired — eye_large and eye_small as two 0..1 weights rather than one signed parameter. |
Model and texture loading
Turning a .glb or .gltf model or a .ktx2 texture into the types above, once, and instantiating it as often as it is on screen.
| Type | Description |
|---|---|
| GltfLoader | Loads glTF into an Ava3D scene in one call. |
| GltfModel | Everything a .glb had in it: the nodes, and the clips, shapes and materials that drive them. |
| GltfAsset | A glTF file, read once. |
| GltfInstance | One copy of a GltfAsset in a scene: its own nodes to place and pose, its own GltfInstance.Animator and morph weights, sharing the asset's meshes and textures with every other copy. |
| GltfLoadOptions | How GltfAsset.LoadAsync reads a file. |
| InstantiateOptions | What GltfAsset.Instantiate is to make. |
| MaterialSharing | What an instance's materials are to the asset's. |
| GltfDiagnostic | One thing the reader could not carry over from a file, and why. |
| GltfDiagnosticKind | What kind of thing a GltfDiagnostic reports. |
| GltfException | A glTF file could not be read at all — it is not glTF, it is a version this reader does not know, its container is malformed — or it was read with GltfLoadOptions.Validate set and something in it had to be dropped. |
| IGltfResourceResolver | Where a .gltf's external files come from. |
| GltfFileResolver | Resolves a .gltf's URIs against a directory on disk. |
| GltfAvaloniaResolver | Resolves a .gltf's URIs against an avares:// location — the model shipped as an AvaloniaResource in the application, next to its textures. |
| GltfHttpResolver | Resolves a .gltf's URIs over HTTP, which is how a browser build gets a model at all. |
| Ktx2Loader | Reads a KTX2 file into a Texture. |
Picking
Which triangle of which node is under the pointer.
| Type | Description |
|---|---|
| PickResult | What a ray through the scene hit. |
| PickEventArgs | Raised for every click when picking is enabled, whether or not anything was hit — a click on empty space reports a null PickEventArgs.Result rather than not being reported, because "the user deselected" is a thing an application needs to know. |
Renderers
Which renderer you got, which ones the platform could offer, and why the others could not.
| Type | Description |
|---|---|
| RenderInfo | What the control is actually doing, polled off the render thread. |
| ContactOcclusionQuality | Quality of depth-based contact occlusion. |
| MaterialDebugView | Diagnostic mesh views, selected with Scene.DebugView. |
| RendererFeature | One thing the active renderer either does or does not do, and what it costs when it does not. |
| RenderBackendKind | Which renderer to use, when the choice is not left to the control. |
| BackendOption | One entry in RenderInfo.AvailableBackends: a renderer, whether it can be selected, and a plain-language reason when it cannot. |
| BackendAvailability | Whether a RenderBackendKind can be selected, and if not, how close it is. |
| MissingComponent | Something a renderer needs that this machine does not have, and how to get it. |
| Rendering.Gl.PlatformSupport | The guard rail around the GL entry points that are fatal under WebAssembly. |
Capturing a frame
One rendered frame of a view read back into memory — as shown, at another size, or with the Avalonia content over it — and drawing one with no view or window at all.
| Type | Description |
|---|---|
| CaptureRequest | What to capture from an Ava3DView. |
| CapturedFrame | One frame of an Ava3DView, read back into memory. |
| CaptureFormat | What a CapturedFrame holds its pixels as. |
| CaptureQueueFullException | Thrown by Ava3DView.CaptureAsync when as many captures are already in flight on the view as Ava3DView.CaptureQueueCapacity allows. |
| Rendering.CameraSnapshot | The camera, frozen for one frame. |
| SceneRenderer | Renders a Scene to pixels with no window and no view — on a GPU where one can be had without either, and on the CPU where it cannot. |
| RenderOptions | How SceneRenderer.RenderAsync should draw. |
| RendererPreference | Which device SceneRenderer.Create should try for. |
| RendererKind | What a SceneRenderer turned out to draw with. |
Diagnostics
A trace of what every frame cost, offline renders with their limits stated, checks of what this renderer computes, and the static frame capture kept for one release.
| Type | Description |
|---|---|
| Diagnostics.FrameTrace | A bounded record of recent frames, for the questions RenderInfo's averages cannot answer. |
| Diagnostics.FrameRecord | One frame as the trace saw it: what was built for it, what it cost on each thread, and what the caches did while it was drawn. |
| Diagnostics.PassTiming | What one render pass cost the card, where the backend can say. |
| Diagnostics.TraceFormat | The shapes FrameTrace.Export writes. |
| OfflineRenderer | Draws a scene into a Texture, with no window, no graphics context and no control. |
| OfflineRenderOptions | What an offline render is allowed to cost and how it should shade. |
| OfflineQuality | Which of the software renderer's two shading paths an offline render uses. |
| OfflineRenderResult | What an offline render produced, and what it left out. |
| SoftwareSettings | Process-wide settings for the software renderer — the CPU path a view falls back to when it can have no GPU, and the one OfflineRenderer draws with. |
| Diagnostics.PbrCalibration | A reproducible interior for comparing material channels, contact, shadows and reflections. |
| SelfTest | What this renderer computes, reduced to numbers that two machines can be compared on. |
| Diagnostics.FrameCapture | Writes one rendered frame to a PNG — the static, process-wide way, kept for one release. |