Project: /_project.yaml Book: /_book.yaml
Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/pose_buffer_provider.fidl
A minimal fidl interface to allow sourcing the contents of a PoseBuffer from another service.
Sets the PoseBuffer and the parameters PoseBufferProvider will use to fill that PoseBuffer. Setting this when it is already set will replace the previously set parameters with the new parameters, which will release the provider's reference to the buffer.
Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/pose_buffer_provider.fidl
A minimal fidl interface to allow sourcing the contents of a PoseBuffer from another service.
Sets the PoseBuffer and the parameters PoseBufferProvider will use to fill that PoseBuffer. Setting this when it is already set will replace the previously set parameters with the new parameters, which will release the provider's reference to the buffer.
Defined in fuchsia.ui.gfx/commands.fidl
Instructs the compositor to create the specified Resource
, and to register it in a table so that it can be referenced by subsequent commands.
Defined in fuchsia.ui.gfx/commands.fidl
Releases the client's reference to the resource; it is then illegal to use the ID in subsequent Commands. Other references to the resource may exist, so releasing the resource does not result in its immediate destruction; it is only destroyed once the last reference is released. For example, the resource may be required to render an in-progress frame, or it may be referred to by another resource). However, the ID will be immediately unregistered, and may be reused to create a new resource.
Defined in fuchsia.ui.gfx/commands.fidl
Create an external reference to the specified resource, which can then be imported into another Session by passing a handle to token
's peer to ImportResourceCmd; see that comment for more details.
The importing client is typically in a different process than the exporter. No specific mechanism is provided for transferring a token from an exporter to an importer; collaborators may choose any out-of-band API they wish to do so.
Defined in fuchsia.ui.gfx/commands.fidl
Import a resource that was exported via ExportResourceCmd(). token
is a handle to the eventpair peer that was used to export the resource, and spec
describes the type of the imported resource, and the commands which can legally be applied to it. Afterward, id
can be used to refer to the resource in an Command, similarly (but not identically: see below) to a resource that was created in the session. For example, you can add children to an imported EntityNode via AddChildCmd.
However, note that the importer does not gain full access to the imported resource, but rather to an attenuated subset of its capabilities. For example, you cannot use a DetachCmd to detach an imported EntityNode from its parent.
Unlike ExportResourceCmd, there is no configurable timeout. There is an expectation that the exported resource will become available in a short amount of time. TODO: this needs elaboration... e.g. we might notify via the SessionListener when we know that the link will never be made (e.g. if the peer of the import token is destroyed).
Defined in fuchsia.ui.gfx/commands.fidl
Sets/clears a node's tag value.
A session can apply a tag value to any node to which it has access, including imported nodes. These tags are private to the session and cannot be read or modified by other sessions. When multiple sessions import the same node, each session will only observe its own tag values.
Hit test results for a session only include nodes which the session has tagged with a non-zero value. Therefore a session can use tag values to associate nodes with their functional purpose when picked.
Constraints:
node_id
refs a Node
.tag_value
is the tag value to assign, or 0 to remove the tag.Defined in fuchsia.ui.gfx/commands.fidl
Detaches a parentable object from its parent (e.g. a node from a parent node, or a layer from a layer stack). It is illegal to apply this command to a non-parentable object. No-op if the target object currently has no parent.
Constraints:
id
refs a parentable objectDiscussion: For nodes, this command will detach a node from its parent, regardless of whether it is a part or a child of its parent.
Defined in fuchsia.ui.gfx/commands.fidl
Sets a Resource‘s (typically a Node’s) translation.
Constraints:
id
refs a Resource with the has_transform characteristic.Defined in fuchsia.ui.gfx/commands.fidl
Sets a Resource‘s (typically a Node’s) scale.
Constraints:
id
refs a Resource with the has_transform characteristic.Defined in fuchsia.ui.gfx/commands.fidl
Sets a Resource‘s (typically a Node’s) rotation.
Constraints:
id
refs a Resource with the has_transform characteristic.Defined in fuchsia.ui.gfx/commands.fidl
Sets a Resource‘s (typically a Node’s) anchor point.
Constraints:
id
refs a Resource with the has_transform characteristic.Defined in fuchsia.ui.gfx/commands.fidl
Sets an object's size.
Constraints:
id
refs a resizeable object.depth
must be zero).Defined in fuchsia.ui.gfx/commands.fidl
Sets a node's opacity.
Constraints:
node_id
refs a Node
with the has_opacity characteristic.opacity
is in the range [0, 1].Defined in fuchsia.ui.gfx/commands.fidl
Sends a hint about a pending size change to the given node and all nodes below. This is generally sent before an animation.
width_change_factor
and height_change_factor
is how much bigger or smaller the item is expected to be in the near future. This one number encapsulate both changes in scale, as well as changes to layout width and height.
Defined in fuchsia.ui.gfx/commands.fidl
Add a node as a child to another node.
Constraints:
id
refs a Node with the has_children characteristic.child_id
refs any Node.Discussion: The child node is first removed from its existing parent, as if DetachCmd was applied first.
Defined in fuchsia.ui.gfx/commands.fidl
Add a node as a part of another node. The implications of being a part rather than a child differ based on the type of the part. However, one implication is constant: removing all of a node's children (e.g. via DetachChildrenCmd) does not affect its parts. This is similar to the “shadow DOM” in a web browser: the controls of a element are implemented as using the shadow DOM, and do no show up amongst the children of that element.
Constraints:
id
refs a Node with the has_parts characteristic.part_id
refs any Node.Discussion: The part node is first removed from its existing parent, as if DetachCmd was applied first.
Defined in fuchsia.ui.gfx/commands.fidl
Detaches all of a node's children (but not its parts).
Defined in fuchsia.ui.gfx/commands.fidl
Sets/clears a node's shape.
Constraints:
node_id
refs a Node
with the has_shape characteristic.shape_id
refs a Shape
, or nothing.Shape
and a Material
, then these must be compatible with each other (see README.md regarding “Shape/Material Compatibility”).Discussion: In order to be painted, a node requires both a Shape
and a Material
. Without a material, a node can still participate in hit-testing and clipping. Without a shape, a node cannot do any of the above.
Defined in fuchsia.ui.gfx/commands.fidl
Sets/clears a node's material.
Constraints:
node_id
refs a Node
with the has_material characteristic.material_id
refs a Material
, or nothing.Shape
and a Material
, then these must be compatible with each other (see README.md regarding “Shape/Material Compatibility”).Discussion: In order to be painted, a node requires both a Shape
and a Material
. Without a material, a node can still participate in hit-testing and clipping. Without a shape, a node cannot do any of the above.
Defined in fuchsia.ui.gfx/commands.fidl
Sets/clears a node's clip. DEPRECATED: use SetClipPlanesCmd.
Constraints:
node_id
refs a Node
with the has_clip characteristic.clip_id
a Node
with the is_clip characteristic, or nothing. If the referenced node is not rooted, then it will have no effect (since its full world-transform cannot be determined).clip_to_self
If false, children are only clipped to the region specified by clip_id
. If true, children are additionally clipped to the node's shape (as determined by its ShapeNode parts).Discussion: If a node has a clip, it will be applied to both the parts and the children of the node. Under some circumstances (TBD), a clip will not be applicable to a node; in such cases it will be as though no clip has been specified for the node.
Defined in fuchsia.ui.gfx/commands.fidl
Sets a node's hit test behavior.
Discussion: By default, hit testing is performed on the node's content, its parts, and its children.
Defined in fuchsia.ui.gfx/commands.fidl
Sets the properties for a ViewHolder's attached View.
Constraints:
view_holder_id
refs a ViewHolder
.Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/commands.fidl
Sets a renderer's camera.
Constraints:
renderer_id
refs a Renderer
.camera_id
refs a Camera
, or stops rendering by passing zero.matrix
is a value or variable of type kMatrix4x4.Defined in fuchsia.ui.gfx/commands.fidl
Sets a camera's view matrix. This operation can be applied to both Cameras and StereoCameras.
Constraints:
camera_id
refs a Camera
.eye_position
is the position of the eye.eye_look_at
is the point is the scene the that eye is pointed at.eye_up
defines the camera's “up” vector.Defined in fuchsia.ui.gfx/commands.fidl
Sets a camera's projection matrix. This operation cannot be applied to a StereoCamera.
Constraints:
camera_id
refs a Camera
that is not a StereoCamera
.fovy
is the Y-axis field of view, in radians.NOTE: A default orthographic projection is specified by setting fovy
to zero. In this case, the camera transform is ignored.
Defined in fuchsia.ui.gfx/commands.fidl
Sets a StereoCamera's projection matrices. This operation can only be applied to a StereoCamera.
Constraints:
camera_id
refs a StereoCamera
.left_projection
is the projection matrix for the left eye.right_projection
is the projection matrix for the right eye.These projection matrices may also contain a transform in camera space for their eye if needed.
Defined in fuchsia.ui.gfx/commands.fidl
Sets a camera's clip-space transform.
Constraints:
camera_id
refs a Camera
.translation
is the desired translation, in Vulkan NDC.scale
is the scale factor to apply before translation.Defined in fuchsia.ui.gfx/commands.fidl
Sets the “pose buffer” for the camera identified by camera_id
. This operation can be applied to both Cameras and StereoCameras.
This will override any position and rotation set for the camera and will make it take its position and rotation from the pose buffer each frame based on the presentation time for that frame.
A pose buffer represents a ring buffer of poses for a fixed number of time points in the future. Each entry in the buffer identified by buffer_id
is a quaternion and a position layed out as follows:
struct Pose { // Quaternion float32 a; float32 b; float32 c; float32 d;
// Position float32 x; float32 y; float32 z;
// Reserved/Padding byte[4] reserved; }
The buffer can be thought of as a packed array of num_entries
Pose structs and is required to be at least num_entries * sizeof(Pose) bytes.
The quaternions and positions are specified in the space of the camera's parent node.
base_time
is a base time point expressed in nanoseconds in the CLOCK_MONOTONIC
timebase and time_interval
is the time in nanoseconds between entries in the buffer. base_time
must be in the past.
For a given point in time t
expressed in nanoseconds in the CLOCK_MONOTONIC
timebase the index of the corresponding pose in the pose buffer can be computed as follows:
index(t) = ((t - base_time) / time_interval) % num_entries
poses[index(t)] is valid for t over the time interval (t - time_interval, t] and should be expected to updated continuously without synchronization for the duration of that interval. If a single pose value is needed for multiple non-atomic operations a value should be latched and stored outside the pose buffer.
Because the poses are not protected by any synchronization primitives it is possible that when a pose is latched it will be only partially updated, and the pose being read will contain some components from the pose before it is updated and some components from the updated pose. The safety of using these “torn” poses relies on two things:
Sequential poses written to poses[index(t)] are very similar to each other numerically, so that if some components are taken from the first and some are taken from another the result is numerically similar to both
The space of positions and quaternions is locally flat at the scale of changes between sequential updates, which guarantees that two poses which are numerically similar also represent semantically similar poses (i.e. there are no discontinuities which will cause a small numerical change in the position or quaterninon to cause a large change in the encoded pose) For positions this is guaranteed because Scenic uses a Euclidean 3-space which is globally flat and for quaternions this is guaranteed because quaternions encode rotation as points on a unit 4-sphere, and spheres are locally flat. For more details on the encoding of rotations in quaterions see https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation
This commanderation is intended for late latching camera pose to support low-latency motion-tracked rendering.
Defined in fuchsia.ui.gfx/commands.fidl
Sets the color of the Light identified by light_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Sets the direction of the DirectionalLight identified by light_id
.
Defined in fuchsia.ui.gfx/commands.fidl
DEPRECATED Adds the light specified by light_id
specified by light_id
to the scene identified by scene_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Detach the light specified by light_id
from the scene that it is attached to, if any.
Defined in fuchsia.ui.gfx/commands.fidl
Detach all lights from the scene specified by scene_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Sets/clears a material's texture.
Constraints:
material_id
refs a Material
.texture_id
refs a Image
, ImagePipe
, or nothing.If no texture is provided (i.e. texture_id
is zero), a solid color is used. If a texture is provided, then the value sampled from the texture is multiplied by the color.
Defined in fuchsia.ui.gfx/commands.fidl
Sets a material's color.
Constraints:
material_id
refs a Material
.If a texture is set on the material, then the value sampled from the texture is multiplied by the color.
Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/commands.fidl
Add a layer to a layer stack. Constraints:
layer_stack_id
refs a LayerStack
.layer_id
refs a Layer
.Defined in fuchsia.ui.gfx/commands.fidl
Remove a layer from a layer stack. Constraints:
layer_stack_id
refs a LayerStack
.layer_id
refs a Layer
.Defined in fuchsia.ui.gfx/commands.fidl
Remove all layers from a layer stack. Constraints
layer_stack_id
refs a LayerStack
.Defined in fuchsia.ui.gfx/commands.fidl
Set a compositor's layer stack, replacing the current stack (if any). Constraints:
compositor_id
refs a DisplayCompositor
or ImagePipeCompositor
.layer_stack_id
refs a LayerStack
.Defined in fuchsia.ui.gfx/commands.fidl
Set a layer's renderer, replacing the current renderer (if any). Constraints:
layer_id
refs a Layer
.renderer_id
refs a Renderer
.Defined in fuchsia.ui.gfx/commands.fidl
Sets a parameter that affects how a renderer renders a scene.
renderer_id
refs the Renderer that is being modified. param
describes the parameter that should be set, and to what.
Defined in fuchsia.ui.gfx/commands.fidl
Sets which events a resource should deliver to the session listener. This command replaces any prior event mask for the resource.
The initial event mask for a resource is zero, meaning no events are reported.
Constraints:
resource_id
is a valid resource idevent_mask
is zero or a combination of k*EventMask
bits OR'ed together.Defined in fuchsia.ui.gfx/commands.fidl
Sets/clears a label to help developers identify the purpose of the resource when using diagnostic tools.
The label serves no functional purpose in the scene graph. It exists only to help developers understand its structure. The scene manager may truncate or discard labels at will.
Constraints:
kLabelMaxLength
characters.Defined in fuchsia.ui.gfx/commands.fidl
Set whether clipping should be disabled for the specified renderer. For a newly-created renderer, clipping will NOT be disabled (i.e. it will be enabled).
NOTE: this disables visual clipping only; objects are still clipped for the purposes of hit-testing.
renderer_id
refs the target renderer. disable_clipping
specifies whether the clipping should be disabled.
Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/commands.fidl
Sets the list of clip planes that apply to a Node and all of its children. Replaces the list set by any previous SetClipPlanesCmd.
node_id
refs a Node
with the has_clip characteristic.clip_planes
is the new list of oriented clip planes.Defined in fuchsia.ui.gfx/commands.fidl
Sets the position of the PointLight identified by light_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Sets the falloff factor of the PointLight identified by light_id
. A value of 1.0 corresponds to the physically-based “inverse-square law” (see Wikipedia). Other values can be used for artistic effect, e.g. a value of 0.0 means that the radiance of a surface is not dependant on its distance from the light.
Defined in fuchsia.ui.gfx/commands.fidl
Adds the light specified by light_id
specified by light_id
to the scene identified by scene_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Adds the light specified by light_id
specified by light_id
to the scene identified by scene_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Adds the light specified by light_id
specified by light_id
to the scene identified by scene_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Set the color conversion applied to the compositor's display. The conversion is applied to to each pixel according to the formula:
(matrix * (pixel + preoffsets)) + postoffsets
where pixel is a column vector consisting of the pixel's 3 components.
matrix
is passed in row-major order. Clients will be responsible for passing default values, when needed. Default values are not currently supported in fidl. Default Values: preoffsets = [0 0 0] matrix = [1 0 0 0 1 0 0 0 1] postoffsets = [0 0 0]
Defined in fuchsia.ui.gfx/commands.fidl
Depending on the device, the display might be rotated with respect to what the lower level device controller considers the physical orientation of pixels. The compositors and layers must be in alignment with the underlying physical orientation which means that for certain operations like screenshotting, they cannot provide results with the accurate orientation unless they have information about how the higher-level display is orienting the screen. The only legal values for the rotation are 0, 90, 180, and 270, which are each applied counterclockwise.
Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/display_info.fidl
Provides information about a display.
Defined in fuchsia.ui.gfx/events.fidl
Provides rendering target metrics information about the specified node.
This event is delivered when the following conditions are true:
Scene
.kMetricsEventMask
set to an enabled state.kMetricsEventMask
transitioned from a disabled state to an enabled state.Subscribe to this event to receive information about the scale factors you should apply when generating textures for your nodes.
Defined in fuchsia.ui.gfx/events.fidl
Delivered in response to a size change hint from a parent node (SendSizeChangeHintCmd).
This event is delivered when the following conditions are true:
kSizeChangeEventMask
set to an enabled state.Subscribe to this event to receive information about how large textures you will need in the near future for your nodes. The canonical use case is to pre-allocate memory to avoid repeated re-allocations.
Defined in fuchsia.ui.gfx/events.fidl
Delivered when the imported resource with the given ID is no longer bound to its host resource, or if the imported resource can not be bound because the host resource is not available.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a ViewHolder's Session when its peer View is connected.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a ViewHolder's Session when its peer View is disconnected or destroyed.
If the View is destroyed before the connection is established, then this event will be delivered immediately when the ViewHolder attempts to connect.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a View's Session when its peer ViewHolder is disconnected or destroyed.
If the ViewHolder is destroyed before the connection is established, then this event will be delivered immediately when the View attempts to connect.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a View's Session when its peer ViewHolder is connected.
If the ViewHolder is destroyed before the connection is established, then this event will not be delivered.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a View's Session when the parent ViewHolder for the given View becomes a part of a Scene.
A ViewHolder is considered to be part of a Scene if there is an unbroken chain of parent-child relationships between the Scene node and the ViewHolder node.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a View's Session when the parent ViewHolder for the given View is no longer part of a scene.
This can happen if the ViewHolder is detached directly from the scene, or if one of its parent nodes is.
A ViewHolder is considered to be part of a Scene if there is an unbroken chain of parent-child relationships between the Scene node and the ViewHolder node.
Defined in fuchsia.ui.gfx/events.fidl
Delivered when the parent ViewHolder for the given View makes a change to the View's properties.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a ViewHolder‘s Session when its peer View’s state has changed.
Defined in fuchsia.ui.gfx/hit.fidl
Describes where a hit occurred within the content of a node tagged by this session.
To compute the point of intersection within the node's local coordinate system, perform the following calculation using the ray which was originally passed to Session.HitTest()
.
hit_point = ray.origin + (hit.distance * ray.direction) local_point = hit.inverse_transform * hit_point
Defined in fuchsia.ui.gfx/nodes.fidl
Characteristics:
Defined in fuchsia.ui.gfx/nodes.fidl
Characteristics:
Defined in fuchsia.ui.gfx/nodes.fidl
Characteristics:
Defined in fuchsia.ui.gfx/nodes.fidl
Characteristics:
Defined in fuchsia.ui.gfx/resources.fidl
Defined in fuchsia.ui.gfx/resources.fidl
ImagePipe2
is a Resource
that can be used as a Texture
for a Material
.
Defined in fuchsia.ui.gfx/resources.fidl
Memory
is a Resource
that wraps a client-provided Zircon vmo to register it with Scenic.
Defined in fuchsia.ui.gfx/resources.fidl
An image mapped to a range of a Memory
resource.
Defined in fuchsia.ui.gfx/resources.fidl
A buffer mapped to a range of Memory
.
Defined in fuchsia.ui.gfx/resources.fidl
Represents the root of a subgraph within a larger scene graph. Nodes can be attached to the View
as children, and these Nodes will have the View
s' coordinate transform applied to their own, in addition to being clipped to the View
s' bounding box. See ViewProperties
.
Each View
is linked to a paired ViewHolder
via a shared token pair.
Usually the View
and its associated ViewHolder
exist in separate processes. By combining them, the UI for an entire system can be built using content contributed from many different processes.
Defined in fuchsia.ui.gfx/resources.fidl
Defined in fuchsia.ui.gfx/resources.fidl
Represents the root of a subgraph within a larger scene graph. Nodes can be attached to the |View| as children, and these Nodes will have the |View|s' coordinate transform applied to their own, in addition to being clipped to the |View|s' bounding box. See |ViewProperties|.
Each |View| is linked to a paired |ViewHolder| via a shared token pair.
Usually the |View| and its associated |ViewHolder| exist in separate processes. By combining them, the UI for an entire system can be built using content contributed from many different processes.
Clients self-identify their |View| with a |ViewRef|, which is a stable identifier that may be cloned and passed to other components in a feed-forward style. It is accompanied by a |ViewRefControl|, which Scenic uses to signal |View| destruction across the system; the |ViewRefControl| must be unique - do not clone it.
Defined in fuchsia.ui.gfx/resources.fidl
Represents an attachment point for a subgraph within a larger scene graph. The ViewHolder
can be attached to a Node as a child, and the contents of the linked View
will become a child of the Node as well.
Each ViewHolder
is linked to a paired View
via a shared token pair.
Usually the ViewHolder
and its associated View
exist in separate processes. By combining them, the UI for an entire system can be built using content contributed from many different processes.
Defined in fuchsia.ui.gfx/resources.fidl
Defined in fuchsia.ui.gfx/resources.fidl
A Compositor draws its LayerStack
into a framebuffer provided by its attached Display
, if any. If no display is attached, nothing is rendered.
Defined in fuchsia.ui.gfx/resources.fidl
A DisplayCompositor draws its attached LayerStack
into an image that is presented on a display.
Defined in fuchsia.ui.gfx/resources.fidl
An ImagePipeCompositor draws its attached LayerStack
into an image that is presented on an image-pipe.
Defined in fuchsia.ui.gfx/resources.fidl
A LayerStack is a stack of layers that are attached to a Compositor, which draws them in order of increasing Z-order (or rather, presents the illusion of drawing them in that order: it may apply any optimizations that don't affect the output).
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
A Layer is a 2-dimensional image that is drawn by a Compositor. The contents of each Layer in a Layerstack are independent of each other. A layer is not drawn unless it has a camera, texture, or color.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
A Scene is the root of a scene-graph, and defines the rendering environment (lighting, etc.) for the tree of nodes beneath it.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
A Camera is used to render a Scene from a particular viewpoint. This is achieved by setting a Renderer to use the camera.
The following commands may be applied to a Camera:
Defined in fuchsia.ui.gfx/resources.fidl
A StereoCamera is a Camera that renders the scene in side-by-side stereo.
Any command which can be applied to a Camera can also be applied to a StereoCamera. Additional supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
A Renderer renders a Scene via a Camera.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
An AmbientLight is a Light that is is assumed to be everywhere in the scene, in all directions.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
A DirectionalLight is a Light that is emitted from a point at infinity.
Although the light is directional, the light has some amount of angular dispersion (i.e., the light is not fully columnated). For simplicity, we assume the dispersion of the light source is symmetric about the light's primary direction.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
A PointLight is a Light that emits light in all directions. By default, the intensity of the light falls off according to the physically based “inverse-square law” (see Wikipedia), although it can be adjusted to other values for artistic effect.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
Simple texture-mapped material.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
Describes a typed, client-modifiable value.
Defined in fuchsia.ui.gfx/shapes.fidl
Rectangle centered at (0,0).
Defined in fuchsia.ui.gfx/shapes.fidl
RoundedRectangle centered at (0,0). Legal parameter values must satisfy the constraint that the flat sides of the rectangle have non-negative length. In other words, the following constraints must hold:
Defined in fuchsia.ui.gfx/shapes.fidl
Defined in fuchsia.ui.gfx/shapes.fidl
A Mesh cannot be rendered until it has been bound to vertex/index buffers; see BindMeshBuffersCmd.
Defined in fuchsia.ui.gfx/tokens.fidl
Token that uniquely identifies an attachment point for a subgraph in the global scene graph. Each ImportToken
has exactly one corresponding ExportToken
.
A Scenic client can reference contents from another client by creating a typed resource using this token. The other client must also create a correspondingly typed resource using the corresponding ExportToken
.
The exact nature of the inter-client reference depends on the specific resources created from the tokens. For example, creating a ViewHolder
resource from this token allows a client to embed another client's View
.
Defined in fuchsia.ui.gfx/tokens.fidl
Token that uniquely identifies a root point for a subgraph in the global scene graph. Each ExportToken
has exactly one corresponding ImportToken
.
A Scenic client can have its contents referenced from another client by creating a typed resource using this token. The other client must also create a correspondingly typed resource using the corresponding ImportToken
.
The exact nature of the inter-client reference depends on the specific resources created from the tokens. For example, creating a View
resource from this token allows everything attached to the View
to be embedded in another clients ViewHolder
.
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Oriented plane described by a normal vector and a distance from the origin along that vector.
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a float32, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a vec2, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a vec3, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a vec4, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a vec4, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a ColorRgb, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a ColorRgba, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a Quaternion, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
Rendering target metrics associated with a node. See also MetricsEvent
.
This scale factors change in relation to the resolution of the rendering target and the scale transformations applied by containing nodes. They are always strictly positive and non-zero.
For example, suppose the rendering target is a high resolution display with a device pixel ratio of 2.0 meaning that each logical pixel within the model corresponds to two physical pixels of the display. Assuming no scale transformations affect the node, then its metrics event will report a scale factor of 2.0.
Building on this example, if instead the node‘s parent applies a scale transformation of 0.25 to the node, then the node’s metrics event will report a scale factor of 0.5 indicating that the node should render its content at a reduced resolution and level of detail since a smaller area of physical pixels (half the size in each dimension) will be rendered.
Defined in fuchsia.ui.gfx/types.fidl
Represents an axis-aligned bounding box. If any of the dimensions has a negative extent (e.g. max.x < min.x) then the bounding box is treated as empty.
Defined in fuchsia.ui.gfx/types.fidl
Represents the properties for a View.
Defined in fuchsia.ui.gfx/types.fidl
Represents the state of a View in Scenic.
Defined in fuchsia.ui.gfx/commands.fidl
Instructs the compositor to create the specified Resource
, and to register it in a table so that it can be referenced by subsequent commands.
Defined in fuchsia.ui.gfx/commands.fidl
Releases the client's reference to the resource; it is then illegal to use the ID in subsequent Commands. Other references to the resource may exist, so releasing the resource does not result in its immediate destruction; it is only destroyed once the last reference is released. For example, the resource may be required to render an in-progress frame, or it may be referred to by another resource). However, the ID will be immediately unregistered, and may be reused to create a new resource.
Defined in fuchsia.ui.gfx/commands.fidl
Create an external reference to the specified resource, which can then be imported into another Session by passing a handle to token
's peer to ImportResourceCmd; see that comment for more details.
The importing client is typically in a different process than the exporter. No specific mechanism is provided for transferring a token from an exporter to an importer; collaborators may choose any out-of-band API they wish to do so.
Defined in fuchsia.ui.gfx/commands.fidl
Import a resource that was exported via ExportResourceCmd(). token
is a handle to the eventpair peer that was used to export the resource, and spec
describes the type of the imported resource, and the commands which can legally be applied to it. Afterward, id
can be used to refer to the resource in an Command, similarly (but not identically: see below) to a resource that was created in the session. For example, you can add children to an imported EntityNode via AddChildCmd.
However, note that the importer does not gain full access to the imported resource, but rather to an attenuated subset of its capabilities. For example, you cannot use a DetachCmd to detach an imported EntityNode from its parent.
Unlike ExportResourceCmd, there is no configurable timeout. There is an expectation that the exported resource will become available in a short amount of time. TODO: this needs elaboration... e.g. we might notify via the SessionListener when we know that the link will never be made (e.g. if the peer of the import token is destroyed).
Defined in fuchsia.ui.gfx/commands.fidl
Sets/clears a node's tag value.
A session can apply a tag value to any node to which it has access, including imported nodes. These tags are private to the session and cannot be read or modified by other sessions. When multiple sessions import the same node, each session will only observe its own tag values.
Hit test results for a session only include nodes which the session has tagged with a non-zero value. Therefore a session can use tag values to associate nodes with their functional purpose when picked.
Constraints:
node_id
refs a Node
.tag_value
is the tag value to assign, or 0 to remove the tag.Defined in fuchsia.ui.gfx/commands.fidl
Detaches a parentable object from its parent (e.g. a node from a parent node, or a layer from a layer stack). It is illegal to apply this command to a non-parentable object. No-op if the target object currently has no parent.
Constraints:
id
refs a parentable objectDiscussion: For nodes, this command will detach a node from its parent, regardless of whether it is a part or a child of its parent.
Defined in fuchsia.ui.gfx/commands.fidl
Sets a Resource‘s (typically a Node’s) translation.
Constraints:
id
refs a Resource with the has_transform characteristic.Defined in fuchsia.ui.gfx/commands.fidl
Sets a Resource‘s (typically a Node’s) scale.
Constraints:
id
refs a Resource with the has_transform characteristic.Defined in fuchsia.ui.gfx/commands.fidl
Sets a Resource‘s (typically a Node’s) rotation.
Constraints:
id
refs a Resource with the has_transform characteristic.Defined in fuchsia.ui.gfx/commands.fidl
Sets a Resource‘s (typically a Node’s) anchor point.
Constraints:
id
refs a Resource with the has_transform characteristic.Defined in fuchsia.ui.gfx/commands.fidl
Sets an object's size.
Constraints:
id
refs a resizeable object.depth
must be zero).Defined in fuchsia.ui.gfx/commands.fidl
Sets a node's opacity.
Constraints:
node_id
refs a Node
with the has_opacity characteristic.opacity
is in the range [0, 1].Defined in fuchsia.ui.gfx/commands.fidl
Sends a hint about a pending size change to the given node and all nodes below. This is generally sent before an animation.
width_change_factor
and height_change_factor
is how much bigger or smaller the item is expected to be in the near future. This one number encapsulate both changes in scale, as well as changes to layout width and height.
Defined in fuchsia.ui.gfx/commands.fidl
Add a node as a child to another node.
Constraints:
id
refs a Node with the has_children characteristic.child_id
refs any Node.Discussion: The child node is first removed from its existing parent, as if DetachCmd was applied first.
Defined in fuchsia.ui.gfx/commands.fidl
Add a node as a part of another node. The implications of being a part rather than a child differ based on the type of the part. However, one implication is constant: removing all of a node's children (e.g. via DetachChildrenCmd) does not affect its parts. This is similar to the “shadow DOM” in a web browser: the controls of a element are implemented as using the shadow DOM, and do no show up amongst the children of that element.
Constraints:
id
refs a Node with the has_parts characteristic.part_id
refs any Node.Discussion: The part node is first removed from its existing parent, as if DetachCmd was applied first.
Defined in fuchsia.ui.gfx/commands.fidl
Detaches all of a node's children (but not its parts).
Defined in fuchsia.ui.gfx/commands.fidl
Sets/clears a node's shape.
Constraints:
node_id
refs a Node
with the has_shape characteristic.shape_id
refs a Shape
, or nothing.Shape
and a Material
, then these must be compatible with each other (see README.md regarding “Shape/Material Compatibility”).Discussion: In order to be painted, a node requires both a Shape
and a Material
. Without a material, a node can still participate in hit-testing and clipping. Without a shape, a node cannot do any of the above.
Defined in fuchsia.ui.gfx/commands.fidl
Sets/clears a node's material.
Constraints:
node_id
refs a Node
with the has_material characteristic.material_id
refs a Material
, or nothing.Shape
and a Material
, then these must be compatible with each other (see README.md regarding “Shape/Material Compatibility”).Discussion: In order to be painted, a node requires both a Shape
and a Material
. Without a material, a node can still participate in hit-testing and clipping. Without a shape, a node cannot do any of the above.
Defined in fuchsia.ui.gfx/commands.fidl
Sets/clears a node's clip. DEPRECATED: use SetClipPlanesCmd.
Constraints:
node_id
refs a Node
with the has_clip characteristic.clip_id
a Node
with the is_clip characteristic, or nothing. If the referenced node is not rooted, then it will have no effect (since its full world-transform cannot be determined).clip_to_self
If false, children are only clipped to the region specified by clip_id
. If true, children are additionally clipped to the node's shape (as determined by its ShapeNode parts).Discussion: If a node has a clip, it will be applied to both the parts and the children of the node. Under some circumstances (TBD), a clip will not be applicable to a node; in such cases it will be as though no clip has been specified for the node.
Defined in fuchsia.ui.gfx/commands.fidl
Sets a node's hit test behavior.
Discussion: By default, hit testing is performed on the node's content, its parts, and its children.
Defined in fuchsia.ui.gfx/commands.fidl
Sets the properties for a ViewHolder's attached View.
Constraints:
view_holder_id
refs a ViewHolder
.Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/commands.fidl
Sets a renderer's camera.
Constraints:
renderer_id
refs a Renderer
.camera_id
refs a Camera
, or stops rendering by passing zero.matrix
is a value or variable of type kMatrix4x4.Defined in fuchsia.ui.gfx/commands.fidl
Sets a camera's view matrix. This operation can be applied to both Cameras and StereoCameras.
Constraints:
camera_id
refs a Camera
.eye_position
is the position of the eye.eye_look_at
is the point is the scene the that eye is pointed at.eye_up
defines the camera's “up” vector.Defined in fuchsia.ui.gfx/commands.fidl
Sets a camera's projection matrix. This operation cannot be applied to a StereoCamera.
Constraints:
camera_id
refs a Camera
that is not a StereoCamera
.fovy
is the Y-axis field of view, in radians.NOTE: A default orthographic projection is specified by setting fovy
to zero. In this case, the camera transform is ignored.
Defined in fuchsia.ui.gfx/commands.fidl
Sets a StereoCamera's projection matrices. This operation can only be applied to a StereoCamera.
Constraints:
camera_id
refs a StereoCamera
.left_projection
is the projection matrix for the left eye.right_projection
is the projection matrix for the right eye.These projection matrices may also contain a transform in camera space for their eye if needed.
Defined in fuchsia.ui.gfx/commands.fidl
Sets a camera's clip-space transform.
Constraints:
camera_id
refs a Camera
.translation
is the desired translation, in Vulkan NDC.scale
is the scale factor to apply before translation.Defined in fuchsia.ui.gfx/commands.fidl
Sets the “pose buffer” for the camera identified by camera_id
. This operation can be applied to both Cameras and StereoCameras.
This will override any position and rotation set for the camera and will make it take its position and rotation from the pose buffer each frame based on the presentation time for that frame.
A pose buffer represents a ring buffer of poses for a fixed number of time points in the future. Each entry in the buffer identified by buffer_id
is a quaternion and a position layed out as follows:
struct Pose { // Quaternion float32 a; float32 b; float32 c; float32 d;
// Position float32 x; float32 y; float32 z;
// Reserved/Padding byte[4] reserved; }
The buffer can be thought of as a packed array of num_entries
Pose structs and is required to be at least num_entries * sizeof(Pose) bytes.
The quaternions and positions are specified in the space of the camera's parent node.
base_time
is a base time point expressed in nanoseconds in the CLOCK_MONOTONIC
timebase and time_interval
is the time in nanoseconds between entries in the buffer. base_time
must be in the past.
For a given point in time t
expressed in nanoseconds in the CLOCK_MONOTONIC
timebase the index of the corresponding pose in the pose buffer can be computed as follows:
index(t) = ((t - base_time) / time_interval) % num_entries
poses[index(t)] is valid for t over the time interval (t - time_interval, t] and should be expected to updated continuously without synchronization for the duration of that interval. If a single pose value is needed for multiple non-atomic operations a value should be latched and stored outside the pose buffer.
Because the poses are not protected by any synchronization primitives it is possible that when a pose is latched it will be only partially updated, and the pose being read will contain some components from the pose before it is updated and some components from the updated pose. The safety of using these “torn” poses relies on two things:
Sequential poses written to poses[index(t)] are very similar to each other numerically, so that if some components are taken from the first and some are taken from another the result is numerically similar to both
The space of positions and quaternions is locally flat at the scale of changes between sequential updates, which guarantees that two poses which are numerically similar also represent semantically similar poses (i.e. there are no discontinuities which will cause a small numerical change in the position or quaterninon to cause a large change in the encoded pose) For positions this is guaranteed because Scenic uses a Euclidean 3-space which is globally flat and for quaternions this is guaranteed because quaternions encode rotation as points on a unit 4-sphere, and spheres are locally flat. For more details on the encoding of rotations in quaterions see https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation
This commanderation is intended for late latching camera pose to support low-latency motion-tracked rendering.
Defined in fuchsia.ui.gfx/commands.fidl
Sets the color of the Light identified by light_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Sets the direction of the DirectionalLight identified by light_id
.
Defined in fuchsia.ui.gfx/commands.fidl
DEPRECATED Adds the light specified by light_id
specified by light_id
to the scene identified by scene_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Detach the light specified by light_id
from the scene that it is attached to, if any.
Defined in fuchsia.ui.gfx/commands.fidl
Detach all lights from the scene specified by scene_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Sets/clears a material's texture.
Constraints:
material_id
refs a Material
.texture_id
refs a Image
, ImagePipe
, or nothing.If no texture is provided (i.e. texture_id
is zero), a solid color is used. If a texture is provided, then the value sampled from the texture is multiplied by the color.
Defined in fuchsia.ui.gfx/commands.fidl
Sets a material's color.
Constraints:
material_id
refs a Material
.If a texture is set on the material, then the value sampled from the texture is multiplied by the color.
Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/commands.fidl
Add a layer to a layer stack. Constraints:
layer_stack_id
refs a LayerStack
.layer_id
refs a Layer
.Defined in fuchsia.ui.gfx/commands.fidl
Remove a layer from a layer stack. Constraints:
layer_stack_id
refs a LayerStack
.layer_id
refs a Layer
.Defined in fuchsia.ui.gfx/commands.fidl
Remove all layers from a layer stack. Constraints
layer_stack_id
refs a LayerStack
.Defined in fuchsia.ui.gfx/commands.fidl
Set a compositor's layer stack, replacing the current stack (if any). Constraints:
compositor_id
refs a DisplayCompositor
or ImagePipeCompositor
.layer_stack_id
refs a LayerStack
.Defined in fuchsia.ui.gfx/commands.fidl
Set a layer's renderer, replacing the current renderer (if any). Constraints:
layer_id
refs a Layer
.renderer_id
refs a Renderer
.Defined in fuchsia.ui.gfx/commands.fidl
Sets a parameter that affects how a renderer renders a scene.
renderer_id
refs the Renderer that is being modified. param
describes the parameter that should be set, and to what.
Defined in fuchsia.ui.gfx/commands.fidl
Sets which events a resource should deliver to the session listener. This command replaces any prior event mask for the resource.
The initial event mask for a resource is zero, meaning no events are reported.
Constraints:
resource_id
is a valid resource idevent_mask
is zero or a combination of k*EventMask
bits OR'ed together.Defined in fuchsia.ui.gfx/commands.fidl
Sets/clears a label to help developers identify the purpose of the resource when using diagnostic tools.
The label serves no functional purpose in the scene graph. It exists only to help developers understand its structure. The scene manager may truncate or discard labels at will.
Constraints:
kLabelMaxLength
characters.Defined in fuchsia.ui.gfx/commands.fidl
Set whether clipping should be disabled for the specified renderer. For a newly-created renderer, clipping will NOT be disabled (i.e. it will be enabled).
NOTE: this disables visual clipping only; objects are still clipped for the purposes of hit-testing.
renderer_id
refs the target renderer. disable_clipping
specifies whether the clipping should be disabled.
Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/commands.fidl
Sets the list of clip planes that apply to a Node and all of its children. Replaces the list set by any previous SetClipPlanesCmd.
node_id
refs a Node
with the has_clip characteristic.clip_planes
is the new list of oriented clip planes.Defined in fuchsia.ui.gfx/commands.fidl
Sets the position of the PointLight identified by light_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Sets the falloff factor of the PointLight identified by light_id
. A value of 1.0 corresponds to the physically-based “inverse-square law” (see Wikipedia). Other values can be used for artistic effect, e.g. a value of 0.0 means that the radiance of a surface is not dependant on its distance from the light.
Defined in fuchsia.ui.gfx/commands.fidl
Adds the light specified by light_id
specified by light_id
to the scene identified by scene_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Adds the light specified by light_id
specified by light_id
to the scene identified by scene_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Adds the light specified by light_id
specified by light_id
to the scene identified by scene_id
.
Defined in fuchsia.ui.gfx/commands.fidl
Set the color conversion applied to the compositor's display. The conversion is applied to to each pixel according to the formula:
(matrix * (pixel + preoffsets)) + postoffsets
where pixel is a column vector consisting of the pixel's 3 components.
matrix
is passed in row-major order. Clients will be responsible for passing default values, when needed. Default values are not currently supported in fidl. Default Values: preoffsets = [0 0 0] matrix = [1 0 0 0 1 0 0 0 1] postoffsets = [0 0 0]
Defined in fuchsia.ui.gfx/commands.fidl
Depending on the device, the display might be rotated with respect to what the lower level device controller considers the physical orientation of pixels. The compositors and layers must be in alignment with the underlying physical orientation which means that for certain operations like screenshotting, they cannot provide results with the accurate orientation unless they have information about how the higher-level display is orienting the screen. The only legal values for the rotation are 0, 90, 180, and 270, which are each applied counterclockwise.
Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/commands.fidl
Defined in fuchsia.ui.gfx/display_info.fidl
Provides information about a display.
Defined in fuchsia.ui.gfx/events.fidl
Provides rendering target metrics information about the specified node.
This event is delivered when the following conditions are true:
Scene
.kMetricsEventMask
set to an enabled state.kMetricsEventMask
transitioned from a disabled state to an enabled state.Subscribe to this event to receive information about the scale factors you should apply when generating textures for your nodes.
Defined in fuchsia.ui.gfx/events.fidl
Delivered in response to a size change hint from a parent node (SendSizeChangeHintCmd).
This event is delivered when the following conditions are true:
kSizeChangeEventMask
set to an enabled state.Subscribe to this event to receive information about how large textures you will need in the near future for your nodes. The canonical use case is to pre-allocate memory to avoid repeated re-allocations.
Defined in fuchsia.ui.gfx/events.fidl
Delivered when the imported resource with the given ID is no longer bound to its host resource, or if the imported resource can not be bound because the host resource is not available.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a ViewHolder's Session when its peer View is connected.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a ViewHolder's Session when its peer View is disconnected or destroyed.
If the View is destroyed before the connection is established, then this event will be delivered immediately when the ViewHolder attempts to connect.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a View's Session when its peer ViewHolder is disconnected or destroyed.
If the ViewHolder is destroyed before the connection is established, then this event will be delivered immediately when the View attempts to connect.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a View's Session when its peer ViewHolder is connected.
If the ViewHolder is destroyed before the connection is established, then this event will not be delivered.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a View's Session when the parent ViewHolder for the given View becomes a part of a Scene.
A ViewHolder is considered to be part of a Scene if there is an unbroken chain of parent-child relationships between the Scene node and the ViewHolder node.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a View's Session when the parent ViewHolder for the given View is no longer part of a scene.
This can happen if the ViewHolder is detached directly from the scene, or if one of its parent nodes is.
A ViewHolder is considered to be part of a Scene if there is an unbroken chain of parent-child relationships between the Scene node and the ViewHolder node.
Defined in fuchsia.ui.gfx/events.fidl
Delivered when the parent ViewHolder for the given View makes a change to the View's properties.
Defined in fuchsia.ui.gfx/events.fidl
Delivered to a ViewHolder‘s Session when its peer View’s state has changed.
Defined in fuchsia.ui.gfx/hit.fidl
Describes where a hit occurred within the content of a node tagged by this session.
To compute the point of intersection within the node's local coordinate system, perform the following calculation using the ray which was originally passed to Session.HitTest()
.
hit_point = ray.origin + (hit.distance * ray.direction) local_point = hit.inverse_transform * hit_point
Defined in fuchsia.ui.gfx/nodes.fidl
Characteristics:
Defined in fuchsia.ui.gfx/nodes.fidl
Characteristics:
Defined in fuchsia.ui.gfx/nodes.fidl
Characteristics:
Defined in fuchsia.ui.gfx/nodes.fidl
Characteristics:
Defined in fuchsia.ui.gfx/resources.fidl
Defined in fuchsia.ui.gfx/resources.fidl
ImagePipe2
is a Resource
that can be used as a Texture
for a Material
.
Defined in fuchsia.ui.gfx/resources.fidl
Memory
is a Resource
that wraps a client-provided Zircon vmo to register it with Scenic.
Defined in fuchsia.ui.gfx/resources.fidl
An image mapped to a range of a Memory
resource.
Defined in fuchsia.ui.gfx/resources.fidl
A buffer mapped to a range of Memory
.
Defined in fuchsia.ui.gfx/resources.fidl
Represents the root of a subgraph within a larger scene graph. Nodes can be attached to the View
as children, and these Nodes will have the View
s' coordinate transform applied to their own, in addition to being clipped to the View
s' bounding box. See ViewProperties
.
Each View
is linked to a paired ViewHolder
via a shared token pair.
Usually the View
and its associated ViewHolder
exist in separate processes. By combining them, the UI for an entire system can be built using content contributed from many different processes.
Defined in fuchsia.ui.gfx/resources.fidl
Defined in fuchsia.ui.gfx/resources.fidl
Represents the root of a subgraph within a larger scene graph. Nodes can be attached to the |View| as children, and these Nodes will have the |View|s' coordinate transform applied to their own, in addition to being clipped to the |View|s' bounding box. See |ViewProperties|.
Each |View| is linked to a paired |ViewHolder| via a shared token pair.
Usually the |View| and its associated |ViewHolder| exist in separate processes. By combining them, the UI for an entire system can be built using content contributed from many different processes.
Clients self-identify their |View| with a |ViewRef|, which is a stable identifier that may be cloned and passed to other components in a feed-forward style. It is accompanied by a |ViewRefControl|, which Scenic uses to signal |View| destruction across the system; the |ViewRefControl| must be unique - do not clone it.
Defined in fuchsia.ui.gfx/resources.fidl
Represents an attachment point for a subgraph within a larger scene graph. The ViewHolder
can be attached to a Node as a child, and the contents of the linked View
will become a child of the Node as well.
Each ViewHolder
is linked to a paired View
via a shared token pair.
Usually the ViewHolder
and its associated View
exist in separate processes. By combining them, the UI for an entire system can be built using content contributed from many different processes.
Defined in fuchsia.ui.gfx/resources.fidl
Defined in fuchsia.ui.gfx/resources.fidl
A Compositor draws its LayerStack
into a framebuffer provided by its attached Display
, if any. If no display is attached, nothing is rendered.
Defined in fuchsia.ui.gfx/resources.fidl
A DisplayCompositor draws its attached LayerStack
into an image that is presented on a display.
Defined in fuchsia.ui.gfx/resources.fidl
An ImagePipeCompositor draws its attached LayerStack
into an image that is presented on an image-pipe.
Defined in fuchsia.ui.gfx/resources.fidl
A LayerStack is a stack of layers that are attached to a Compositor, which draws them in order of increasing Z-order (or rather, presents the illusion of drawing them in that order: it may apply any optimizations that don't affect the output).
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
A Layer is a 2-dimensional image that is drawn by a Compositor. The contents of each Layer in a Layerstack are independent of each other. A layer is not drawn unless it has a camera, texture, or color.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
A Scene is the root of a scene-graph, and defines the rendering environment (lighting, etc.) for the tree of nodes beneath it.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
A Camera is used to render a Scene from a particular viewpoint. This is achieved by setting a Renderer to use the camera.
The following commands may be applied to a Camera:
Defined in fuchsia.ui.gfx/resources.fidl
A StereoCamera is a Camera that renders the scene in side-by-side stereo.
Any command which can be applied to a Camera can also be applied to a StereoCamera. Additional supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
A Renderer renders a Scene via a Camera.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
An AmbientLight is a Light that is is assumed to be everywhere in the scene, in all directions.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
A DirectionalLight is a Light that is emitted from a point at infinity.
Although the light is directional, the light has some amount of angular dispersion (i.e., the light is not fully columnated). For simplicity, we assume the dispersion of the light source is symmetric about the light's primary direction.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
A PointLight is a Light that emits light in all directions. By default, the intensity of the light falls off according to the physically based “inverse-square law” (see Wikipedia), although it can be adjusted to other values for artistic effect.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
Simple texture-mapped material.
Supported commands:
Defined in fuchsia.ui.gfx/resources.fidl
Describes a typed, client-modifiable value.
Defined in fuchsia.ui.gfx/shapes.fidl
Rectangle centered at (0,0).
Defined in fuchsia.ui.gfx/shapes.fidl
RoundedRectangle centered at (0,0). Legal parameter values must satisfy the constraint that the flat sides of the rectangle have non-negative length. In other words, the following constraints must hold:
Defined in fuchsia.ui.gfx/shapes.fidl
Defined in fuchsia.ui.gfx/shapes.fidl
A Mesh cannot be rendered until it has been bound to vertex/index buffers; see BindMeshBuffersCmd.
Defined in fuchsia.ui.gfx/tokens.fidl
Token that uniquely identifies an attachment point for a subgraph in the global scene graph. Each ImportToken
has exactly one corresponding ExportToken
.
A Scenic client can reference contents from another client by creating a typed resource using this token. The other client must also create a correspondingly typed resource using the corresponding ExportToken
.
The exact nature of the inter-client reference depends on the specific resources created from the tokens. For example, creating a ViewHolder
resource from this token allows a client to embed another client's View
.
Defined in fuchsia.ui.gfx/tokens.fidl
Token that uniquely identifies a root point for a subgraph in the global scene graph. Each ExportToken
has exactly one corresponding ImportToken
.
A Scenic client can have its contents referenced from another client by creating a typed resource using this token. The other client must also create a correspondingly typed resource using the corresponding ImportToken
.
The exact nature of the inter-client reference depends on the specific resources created from the tokens. For example, creating a View
resource from this token allows everything attached to the View
to be embedded in another clients ViewHolder
.
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
Oriented plane described by a normal vector and a distance from the origin along that vector.
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a float32, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a vec2, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a vec3, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a vec4, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a vec4, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a ColorRgb, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a ColorRgba, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
A value that is specified explicitly by value
if variable_id
is zero, or is the value produced by the resource identified by variable_id
, e.g. an animation or expression. In the latter case, the value produced by the resource must be a Quaternion, and value
is ignored.
Defined in fuchsia.ui.gfx/types.fidl
Rendering target metrics associated with a node. See also MetricsEvent
.
This scale factors change in relation to the resolution of the rendering target and the scale transformations applied by containing nodes. They are always strictly positive and non-zero.
For example, suppose the rendering target is a high resolution display with a device pixel ratio of 2.0 meaning that each logical pixel within the model corresponds to two physical pixels of the display. Assuming no scale transformations affect the node, then its metrics event will report a scale factor of 2.0.
Building on this example, if instead the node‘s parent applies a scale transformation of 0.25 to the node, then the node’s metrics event will report a scale factor of 0.5 indicating that the node should render its content at a reduced resolution and level of detail since a smaller area of physical pixels (half the size in each dimension) will be rendered.
Defined in fuchsia.ui.gfx/types.fidl
Represents an axis-aligned bounding box. If any of the dimensions has a negative extent (e.g. max.x < min.x) then the bounding box is treated as empty.
Defined in fuchsia.ui.gfx/types.fidl
Represents the properties for a View.
Defined in fuchsia.ui.gfx/types.fidl
Represents the state of a View in Scenic.
Type: uint32
Defined in fuchsia.ui.gfx/commands.fidl
Set a mesh's indices and vertices.
mesh_id
refs the Mesh to be updated. index_buffer_id
refs a Buffer that contains the mesh indices. index_format
defines how the index buffer data is to be interpreted. index_offset
number of bytes from the start of the index Buffer. index_count
number of indices. vertex_buffer_id
refs a Buffer that contains the mesh vertices. vertex_format
defines how the vertex buffer data is to be interpreted. vertex_offset
number of bytes from the start of the vertex Buffer. vertex_count
number of vertices. bounding_box
must contain all vertices within the specified range.
The MeshVertexFormat defines which per-vertex attributes are provided by the mesh, and the size of each attribute (and therefore the size of each vertex). The attributes are ordered within the vertex in the same order that they appear within the MeshVertexFormat struct. For example, if the values are kVector3, kNone and kVector2, then:
Type: uint32
Defined in fuchsia.ui.gfx/renderer.fidl
Represents the shadow algorithm that the Renderer
should use when lighting the scene.
Type: uint32
Defined in fuchsia.ui.gfx/renderer.fidl
Type: uint32
Defined in fuchsia.ui.gfx/resources.fidl
Describes an exported resource that is to be imported by an ImportResourceCmd.
NOTE: Currently just an enum of importable resource types, but may later be expanded to express concepts like “meshes with a particular vertex format”.
Type: uint32
Defined in fuchsia.ui.gfx/types.fidl
Type: uint32
Defined in fuchsia.ui.gfx/types.fidl
Describes how nodes interact with hit testings.
Type: uint32
Defined in fuchsia.ui.gfx/commands.fidl
Set a mesh's indices and vertices.
mesh_id
refs the Mesh to be updated. index_buffer_id
refs a Buffer that contains the mesh indices. index_format
defines how the index buffer data is to be interpreted. index_offset
number of bytes from the start of the index Buffer. index_count
number of indices. vertex_buffer_id
refs a Buffer that contains the mesh vertices. vertex_format
defines how the vertex buffer data is to be interpreted. vertex_offset
number of bytes from the start of the vertex Buffer. vertex_count
number of vertices. bounding_box
must contain all vertices within the specified range.
The MeshVertexFormat defines which per-vertex attributes are provided by the mesh, and the size of each attribute (and therefore the size of each vertex). The attributes are ordered within the vertex in the same order that they appear within the MeshVertexFormat struct. For example, if the values are kVector3, kNone and kVector2, then:
Type: uint32
Defined in fuchsia.ui.gfx/renderer.fidl
Represents the shadow algorithm that the Renderer
should use when lighting the scene.
Type: uint32
Defined in fuchsia.ui.gfx/renderer.fidl
Type: uint32
Defined in fuchsia.ui.gfx/resources.fidl
Describes an exported resource that is to be imported by an ImportResourceCmd.
NOTE: Currently just an enum of importable resource types, but may later be expanded to express concepts like “meshes with a particular vertex format”.
Type: uint32
Defined in fuchsia.ui.gfx/types.fidl
Type: uint32
Defined in fuchsia.ui.gfx/types.fidl
Describes how nodes interact with hit testings.
Defined in fuchsia.ui.gfx/commands.fidl
Commands that are used to modify the state of a Session
.
Defined in fuchsia.ui.gfx/events.fidl
These are all of the types of events which can be reported by a Session
. Use SetEventMaskCmd
to enable event delivery for a resource.
Defined in fuchsia.ui.gfx/renderer.fidl
These are all of the types of parameters that can be set to configure a Renderer
.
Defined in fuchsia.ui.gfx/resources.fidl
These are all of the types of resources that can be created within a Session
. Add new fields only to the bottom of the list.
Defined in fuchsia.ui.gfx/types.fidl
Defined in fuchsia.ui.gfx/commands.fidl
Commands that are used to modify the state of a Session
.
Defined in fuchsia.ui.gfx/events.fidl
These are all of the types of events which can be reported by a Session
. Use SetEventMaskCmd
to enable event delivery for a resource.
Defined in fuchsia.ui.gfx/renderer.fidl
These are all of the types of parameters that can be set to configure a Renderer
.
Defined in fuchsia.ui.gfx/resources.fidl
These are all of the types of resources that can be created within a Session
. Add new fields only to the bottom of the list.
Defined in fuchsia.ui.gfx/types.fidl