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.

TypeDescription
Ava3DViewA 3D view that works on every platform Avalonia targets, including the browser.
RenderTriggerWhen Ava3DView draws a frame.
SwapPolicyWhat 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.
ResourcePolicyHow 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.
ResourcesProcess-wide defaults for how resident resources are kept.
PrepareProgressHow far Ava3DView.PrepareAsync has got, reported through its IProgress.
ScenePreparationWhat Ava3DView.PrepareAsync did, once it has finished.

Scene and camera

A tree of nodes with transforms and a camera to look at them with.

TypeDescription
SceneThe scene: a root transform, its nodes, its lights and a background colour.
NodeA node in the scene graph: a transform, and children that inherit it.
MeshNodeA node that draws geometry.
MeshInstanceOne copy of a mesh, and what makes it different from the others.
LevelOfDetailA coarser version of a MeshNode's mesh, drawn in its place from a distance onwards.
LevelOfDetailCollectionA node's levels of detail, in any order: they are sorted by distance when the scene is drawn.
NodeCollectionThe children of a Node.
CameraAn 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.

TypeDescription
LightWhat every light has in common.
DirectionalLightA light with a direction but no position: the sun, and anything else far enough away that its rays arrive parallel.
PointLightA light at a position, falling off with distance.
SpotLightA light with a position, a direction and a cone: a torch, a stage lamp, a headlight.
LightCollectionThe lights in a scene, in the order they were added.
EnvironmentLightThe light that comes from everywhere: the sky, the ground, the room.
EnvironmentImageImmutable linear RGB radiance in an equirectangular image.
EnvironmentProbeA baked room reflection with world-space box influence and box-projected specular parallax.
ProbeCaptureOptionsSettings for EnvironmentProbe.CaptureAsync.

Sprites, lines and points

The three things in a scene that are not lit triangles: billboards, segments and clouds.

TypeDescription
SpriteNodeA textured quad that always faces the camera, centred on the node's position.
LineNodeUnlit line segments, transformed by the node's world matrix.
PointsNodeUnlit points, transformed by the node's world matrix.

Overlays and labels

Position Avalonia controls over a scene and render text on sprites.

TypeDescription
Ava3DOverlayPlaces ordinary Avalonia controls at positions in an Ava3DView's scene.
OverlayAnchorWhich point of a child sits on the world position it is anchored to.
OverlayBehindWhat to do with a child whose world position is not in front of the near plane.
OverlayOffScreenWhat to do with a child whose projected point is outside the panel.
OverlayOcclusionWhether a child is hidden when the scene is in front of the thing it is anchored to.
OcclusionPrecisionHow exact an occlusion test is, against what it costs.
LabelNodeA line of text standing in the scene: a nameplate on a hull, a sign on a bulkhead, a caption on a plinth.
TextOptionsHow 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.

TypeDescription
MeshTriangle geometry, independent of where it sits in the world.
PrimitivesReady-made geometry, so a scene can be built without a model file.
BoundingBoxAn axis-aligned box.
BatchingFolding a group's static surfaces into as few draws as they can be drawn in.
SurfaceNetsTurns a signed-distance field into a Mesh.
ScalarFieldA signed distance: how far point is from a surface, negative inside it and positive outside.
SurfaceNetsOptionsWhat SurfaceNets.Extract is given beyond the field, the box and the resolution.
SurfaceNetsBudgetExceptionThrown 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.

TypeDescription
RotationsRotations built from directions rather than from angles.
SplineA smooth curve through a row of points, and the direction it is going when it gets there.
EaseShaping a 0..1 parameter, so a move starts and stops instead of switching on and off.
ScatterRepeatable randomness, indexed rather than drawn.

Materials and textures

Metallic-roughness parameters, the maps that drive them, and how a surface is composited.

TypeDescription
MaterialThe 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.
AppearanceKindWhat kind of thing an AppearanceParameter adjusts.
AppearanceParameterOne thing about a model a caller may adjust, with enough about it to build a control without knowing what the model is.
MaterialLookupThe materials of a loaded model, addressed by the names the file gave them.
BlendModeHow the fragments a material produces combine with what is already in the frame.
CullModeWhich side of a triangle is drawn.
TextureAn image: either encoded bytes (PNG or JPEG) or raw RGBA pixels.
TextureColorSpaceHow the bytes of a Texture are encoded, when the slot they are put in should not be the one to decide.
TextureProgramA 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.
TextureMappingCoordinates for one material texture.
TextureWrapHow a texture behaves outside 0..1.
TextureFilterHow a texture is sampled between its texels.
TextureFormatA block-compressed texture format, as the hardware stores it.
UvSourceWhich side of a triangle is rasterised.
MappingSpaceWhether a projection travels with the object or stays fixed in the world.
DetailLayerThe lights in a scene.
ShadingModelHow a surface turns light into colour.
MatcapTextureModeWhere 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.
VertexAlphaModeWhat 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.

TypeDescription
AnimatorPlays clips over a node tree, one state at a time with a blend between the outgoing and the incoming.
AnimationClipA named set of tracks — one animation as an authoring tool exported it.
AnimationTrackOne animated property of one node: a sorted key time array and the values at those times.
AnimationStateOne clip as something that can be playing: its own time, speed, looping and blend weight.
AnimationStateCollectionThe states an Animator knows, addressed by name.
AnimationLayerOne crossfading player: a set of states, which of them is playing, and how its pose meets the ones below it.
AnimationMaskWhich nodes a layer is allowed to move.
AnimationBlendHow a layer combines with what is already posed beneath it.
AnimationInterpolationHow values between two keys are found.
AnimationPathWhich property of a node a track writes.
AnimationReferenceWhat an additive layer measures its difference from.
AnimationEventArgsThe state a Animator.Finished event is about.

Skinning and morph targets

Deform meshes with skeleton joints and blendable vertex shapes.

TypeDescription
SkinA skeleton: the nodes that drive a skinned mesh, and the matrices that put the mesh into each of their spaces.
JointBindingThe four joints that move one vertex, and how much each of them does.
MorphShapesThe morph targets of a loaded model, addressed by name, with opposed pairs folded into one signed parameter each.
MorphWeightsEvery 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.

TypeDescription
GltfLoaderLoads glTF into an Ava3D scene in one call.
GltfModelEverything a .glb had in it: the nodes, and the clips, shapes and materials that drive them.
GltfAssetA glTF file, read once.
GltfInstanceOne 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.
GltfLoadOptionsHow GltfAsset.LoadAsync reads a file.
InstantiateOptionsWhat GltfAsset.Instantiate is to make.
MaterialSharingWhat an instance's materials are to the asset's.
GltfDiagnosticOne thing the reader could not carry over from a file, and why.
GltfDiagnosticKindWhat kind of thing a GltfDiagnostic reports.
GltfExceptionA 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.
IGltfResourceResolverWhere a .gltf's external files come from.
GltfFileResolverResolves a .gltf's URIs against a directory on disk.
GltfAvaloniaResolverResolves a .gltf's URIs against an avares:// location — the model shipped as an AvaloniaResource in the application, next to its textures.
GltfHttpResolverResolves a .gltf's URIs over HTTP, which is how a browser build gets a model at all.
Ktx2LoaderReads a KTX2 file into a Texture.

Picking

Which triangle of which node is under the pointer.

TypeDescription
PickResultWhat a ray through the scene hit.
PickEventArgsRaised 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.

TypeDescription
RenderInfoWhat the control is actually doing, polled off the render thread.
ContactOcclusionQualityQuality of depth-based contact occlusion.
MaterialDebugViewDiagnostic mesh views, selected with Scene.DebugView.
RendererFeatureOne thing the active renderer either does or does not do, and what it costs when it does not.
RenderBackendKindWhich renderer to use, when the choice is not left to the control.
BackendOptionOne entry in RenderInfo.AvailableBackends: a renderer, whether it can be selected, and a plain-language reason when it cannot.
BackendAvailabilityWhether a RenderBackendKind can be selected, and if not, how close it is.
MissingComponentSomething a renderer needs that this machine does not have, and how to get it.
Rendering.Gl.PlatformSupportThe 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.

TypeDescription
CaptureRequestWhat to capture from an Ava3DView.
CapturedFrameOne frame of an Ava3DView, read back into memory.
CaptureFormatWhat a CapturedFrame holds its pixels as.
CaptureQueueFullExceptionThrown by Ava3DView.CaptureAsync when as many captures are already in flight on the view as Ava3DView.CaptureQueueCapacity allows.
Rendering.CameraSnapshotThe camera, frozen for one frame.
SceneRendererRenders 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.
RenderOptionsHow SceneRenderer.RenderAsync should draw.
RendererPreferenceWhich device SceneRenderer.Create should try for.
RendererKindWhat 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.

TypeDescription
Diagnostics.FrameTraceA bounded record of recent frames, for the questions RenderInfo's averages cannot answer.
Diagnostics.FrameRecordOne 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.PassTimingWhat one render pass cost the card, where the backend can say.
Diagnostics.TraceFormatThe shapes FrameTrace.Export writes.
OfflineRendererDraws a scene into a Texture, with no window, no graphics context and no control.
OfflineRenderOptionsWhat an offline render is allowed to cost and how it should shade.
OfflineQualityWhich of the software renderer's two shading paths an offline render uses.
OfflineRenderResultWhat an offline render produced, and what it left out.
SoftwareSettingsProcess-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.PbrCalibrationA reproducible interior for comparing material channels, contact, shadows and reflections.
SelfTestWhat this renderer computes, reduced to numbers that two machines can be compared on.
Diagnostics.FrameCaptureWrites one rendered frame to a PNG — the static, process-wide way, kept for one release.