Skip to main content

Crate graphics

Crate graphics 

Source
Expand description

This crate is an abstraction layer for graphical services like OpenGL. See the server::GraphicsServer trait for the rendering features that are available through this abstraction layer. The fyrox-graphics-gl crate provides an OpenGL implementation of GraphicsServer.

Modules§

buffer
Buffer is a type-agnostic data storage located directly in GPU memory. It could be considered as a data block which content is a pile of bytes, whose meaning is defined externally.
core
Core data structures and algorithms used throughout Fyrox.
error
Contains all possible errors that may occur during rendering, initialization of renderer structures, or GAPI.
framebuffer
Framebuffer objects are user-defined framebuffers which allow one to render to memory locations instead of the screen. First a framebuffer is created, and then textures are attached to it in order to control where the rendering data is stored. There are attachments for color, attachments for depth, and attachments for stencil, thereby providing memory for everything that is required for rendering. See GpuFrameBufferTrait docs for more info.
geometry_buffer
Geometry buffer is a mesh buffer, that could contain multiple vertex buffers and only one element buffer.
gpu_program
A GPU program is a collection of shaders that are linked together so that they can run on the GPU to control how rendering is performed.
gpu_texture
Texture is an image that used to fill faces to add details to them. It could also be used as a generic and mostly unlimited capacity storage for arbitrary data.
query
A query object is used to fetch some data from rendering operations asynchronously. See GpuQueryTrait docs for more info.
read_buffer
A GpuAsyncReadBufferTrait object handles the transfering pixel data from a frame buffer into a color buffer in the background, and provides a method to poll the object and take the data once it arrives.
sampler
A sampler is a GPU entity that defines how texels will be fetched from a texture. See GpuSamplerDescriptor docs for more info.
server
Graphics server is an abstraction layer over various graphics APIs used on different platforms supported by the engine.
stats
Structs to keep count of the numbers of various operations that are performed during rendering.
uniform
Uniform buffer is a special byte storage that ensures correct data alignment suitable for GPU. Current implementation supports std140 data layout scheme.

Macros§

define_shared_wrapper
Define a wrapper struct that holds an Rc containing the given type. It implements Clone to copy the Rc and implements Deref to access the value inside the Rc.

Structs§

BlendEquation
An equation used for blending a source pixel color with the destination color (the one that is already in a frame buffer). This equation has different modes for rgb/alpha parts.
BlendFunc
Blending function defines factors for both operands in blending equation (separately for RGB and Alpha parts). Default blending function is replacing destination values with the source ones.
BlendParameters
Blending parameters (such as blending function and its equation).
ColorMask
A mask that defines which colors will be stored in a frame buffer during rendering operation. By default, all colors are stored (every field is set to true).
DrawParameters
A set of drawing parameters, that are used during draw call. It defines pretty much all pipeline settings all at once.
ScissorBox
A rectangular area that defines which pixels will be rendered in a frame buffer or not.
StencilFunc
Defines a function that used in a stencil test by comparing the ref_value to the stencil buffer.
StencilOp
A set of actions that will be performed with the stencil buffer during various testing stages.

Enums§

BlendFactor
Defines how some color will be multiplied before being blended. The destination color is the color that is currently in the frame buffer, and the source color is the color that is produced by the fragment shader. See BlendFunc for more about how to use these.
BlendMode
Defines an operation used in blending equation.
CompareFunc
A function used to compare two values. Usually it is used for depth and stencil testing.
CullFace
A face side to cull.
ElementKind
Element kind of geometry.
ElementRange
A range of elements (usually it’s triangles) to draw in a draw call.
PolygonFace
Defines a polygon face that will be rendered. This is usually used for back face culling. Default value is PolygonFace::FrontAndBack.
PolygonFillMode
A set of possible polygon filling modes.
StencilAction
An action with the stencil value in the stencil buffer is the stencil test passed.