[][src]Crate amethyst_renderer

A data parallel rendering engine developed by the Amethyst project.

The source code is available for download on GitHub. See the online book for a complete guide to using Amethyst.

Background

This crate provides OpenGL graphics rendering functionality through various rendering passes. The rendering passes may handle different domains of rendering, such as "draw game objects" vs "render text"; or they can handle the same domain with different variations, such as "draw objects with lighting" vs "draw objects ignoring lighting".

Skinning: Interleaved Versus Separate Passes

In an application, objects may be composed of multiple renderable entities, such as a main body and separate limbs. Where the limbs join the the body, it will look more realistic if the vertex positions are affected by the relative positions to the body and limb.

This is where, for a DrawX pass, you will find a corresponding DrawXSeparate pass which supports vertex skinning and joint transformations to improve the render. An exception to this is the DrawFlat2D pass, which does not support joint transformations.

Modules

error

Renderer error types.

mouse

Util functions that change how the mouse moves and looks.

pipe

Renderer pipeline configuration.

Structs

ActiveCamera

Active camera resource, used by the renderer to choose which camera to get the view matrix from. If no active camera is found, the first camera will be used as a fallback.

ActiveCameraPrefab

Active camera prefab

AmbientColor

The ambient color of a scene

AnimatedComboMeshCreator

Mesh creator for VertexBufferCombination.

Blend
BlendChannel
BmpFormat

Allows loading of BMP files.

Camera

Camera struct.

ColorBuffer

Target color buffer.

ColorMask
ComboMeshCreator

Mesh creator for VertexBufferCombination.

Data
DebugLines

Resource that stores non-persistent debug lines to be rendered in DebugLinesPass draw pass. The vector is automatically cleared after being rendered.

DebugLinesComponent

Component that stores persistent debug lines to be rendered in DebugLinesPass draw pass. The vector can only be cleared manually.

DebugLinesParams

Parameters for renderer of debug lines. The params affect all lines.

DepthBuffer

Target depth-stencil buffer.

DirectionalLight

A directional light source.

DisplayConfig

Structure for holding the renderer configuration.

DrawDebugLines

Draw several simple lines for debugging

DrawFlat

Draw mesh without lighting

DrawFlat2D

Draws sprites on a 2D quad.

DrawFlatSeparate

Draw mesh without lighting

DrawPbm

Draw mesh with physically based lighting

DrawPbmSeparate

Draw mesh with physically based lighting

DrawShaded

Draw mesh with simple lighting technique

DrawShadedSeparate

Draw mesh with simple lighting technique

DrawSkybox

Draw a simple gradient skybox

Effect
EffectBuilder
GraphicsPrefab

PrefabData for loading graphics, ie Mesh + Material

Hidden

Hidden mesh component Useful for entities, that should not be rendered, but stay loaded in memory.

HiddenPropagate

Like Hidden, but can propagate through children when the HideHierarchySystem is enabled in the RenderBundle.

HideHierarchySystem

This system adds a HiddenPropagate-component to all children. Using this system will result in every child being hidden. Depends on the resource "ParentHierarchy", which is set up by the TransformBundle

ImageData

ImageData provided by formats, can be interpreted as a texture.

Init

FIXME: Cannot Deserialize for some reason.

InternalShape

Internal Shape, used for transformation from genmesh to MeshData

JointTransforms

Transform storage for the skin, should be attached to all mesh entities that use a skin

JointTransformsPrefab

Prefab for JointTransforms

JpgFormat

Allows loading of jpg or jpeg files.

KeyboardInput

Describes a keyboard input event.

LightPrefab

Prefab for lighting

Material

Material struct.

MaterialDefaults

A resource providing default textures for Material. These will be be used by the renderer in case a texture handle points to a texture which is not loaded already. Additionally, you can use it to fill up the fields of Material you don't want to specify.

MaterialPrefab

PrefabData for loading Materials

Mesh

Represents a polygonal mesh.

MeshBuilder

Builds new meshes.

Meta
NewEffect
ObjFormat

Allows loading from Wavefront files see: https://en.wikipedia.org/wiki/Wavefront_.obj_file

Pipeline

Defines how the rendering pipeline should be configured.

PipelineBuilder

Constructs a new pipeline with the given render targets and layers.

PngFormat

Allows loading of PNG files.

PointLight

A point light source. Uses the Transform set of components for positioning, and requires a GlobalTransform component to be included in rendering.

PosColor

Vertex format with position and RGBA8 color attributes.

PosColorNorm

Vertex format with position, RGBA8 color and normal attributes.

PosNormTangTex

Vertex format with position, normal, and UV texture coordinate attributes.

PosNormTex

Vertex format with position, normal, and UV texture coordinate attributes.

PosTex

Vertex format with position and UV texture coordinate attributes.

RenderBundle

Rendering bundle

RenderSystem

Rendering system.

Renderer

Generic renderer.

Rgba

An RGBA color value.

SamplerInfo

Specifies how to sample from a texture.

ScreenDimensions

World resource that stores screen dimensions.

Separate

Vertex format for attributes in separate buffers

ShapePrefab

Prefab for generating Mesh from basic shapes

ShapeUpload

SystemData needed to upload a Shape directly to create a MeshHandle

SkyboxColor

Colors used for the gradient skybox

SpotLight

A spot light source.

Sprite

Dimensions and texture coordinates of each sprite in a sprite sheet.

SpriteRender

Information for rendering a sprite.

SpriteSheet

Meta data for a sprite sheet texture.

SpriteSheetFormat

Allows loading of sprite sheets in RON format.

SpriteVisibility

Resource for controlling what entities should be rendered, and whether to draw them ordered or not, which is useful for transparent surfaces.

SpriteVisibilitySortingSystem

Determines what entities to be drawn. Will also sort transparent entities back to front based on position on the Z axis.

Stage

A stage in the rendering pipeline.

StageBuilder

Constructs a new rendering stage.

SunLight

A realistic disk-shaped sun light source.

Target

A render target.

TargetBuilder

Builds new render targets.

Texture

Handle to a GPU texture resource.

TextureBuilder

Builds new textures.

TextureCoordinates

Texture coordinates of the sprite

TextureMetadata

Additional texture metadata that can be passed to the asset loader or added to the prefab.

TextureOffset

Material reference this part of the texture

TgaFormat

Allows loading of TGA files.

Transparent

Transparent mesh component

VertexBuffer

Raw buffer with its attributes

Visibility

Resource for controlling what entities should be rendered, and whether to draw them ordered or not, which is useful for transparent surfaces.

VisibilitySortingSystem

Determine what entities are visible to the camera, and which are not. Will also sort transparent entities back to front based on distance from camera.

WindowMessages

This specs resource with id 0 permits sending commands to the renderer internal window.

Enums

BlendValue
CameraPrefab

Projection prefab

Color

Type for color attribute of vertex

DepthMode
DeviceEvent

Represents raw hardware events that are not associated with any particular window.

ElementState

Describes the input state of a key.

Equation
Event

Describes a generic event.

Factor
FilterMethod

How to filter the texture when sampling. They correspond to increasing levels of quality, but also cost. Mipmap, trilinear and anisotropic filtering require mipmapping, but the other filtering methods do not.

Flipped

Information about whether or not a texture should be flipped when rendering.

JointIds

Type for joint ids attribute of vertex

JointWeights

Type for joint weights attribute of vertex

Light

A light source.

MeshData

Mesh data for loading

MouseButton

Describes a button of a mouse controller.

Normal

Type for texture coord attribute of vertex

Position

Type for position attribute of vertex

Projection

The projection mode of a Camera.

Shape

Shape generators

SurfaceType

Type of the allocated texture surface. It is supposed to only carry information about the number of bits per each channel. The actual types are up to the views to decide and interpret. The actual components are up to the swizzle to define.

Tangent

Type for tangent attribute of vertex

TexCoord

Type for texture coord attribute of vertex

TextureData

Texture data for loading

TextureFormat

Aggregate texture format

TexturePrefab

PrefabData for loading Textures.

VirtualKeyCode

Symbolic name for a keyboard key.

WindowEvent

Describes an event from a Window.

WrapMode

Specifies how texture coordinates outside the range [0, 1] are handled.

Constants

ALPHA

When combining two fragments, add the value of the source times its alpha channel with the value of the destination multiplied by the inverse of the source alpha channel. Has the usual transparency effect: mixes the two colors using a fraction of each one specified by the alpha of the source.

REPLACE

When combining two fragments, choose the source value

Traits

Attribute

Trait for vertex attributes to implement

MeshCreator

Trait used by the asset processor to convert any user supplied mesh representation into an actual Mesh.

PipelineBuild
PipelineData

The data requested from the specs::World by the Pipeline.

PolyPipeline

Trait used for the pipeline.

PolyStage

A stage in the rendering. Contains multiple passes.

PolyStages
Query

Allows to query specific Attributes of VertexFormat

VertexFormat

Trait implemented by all valid vertex formats.

With

Trait implemented by all valid vertex formats for each field

Functions

build_mesh_with_combo

Build Mesh with vertex buffer combination

create_mesh_asset

Create mesh

create_texture_asset

Create a texture asset.

get_camera

Returns the main camera and its GlobalTransform

set_vertex_args

Sets the vertex argument in the constant buffer.

vertex_data

Construct new vertex data from raw data and vertex format

Type Definitions

AnimatedVertexBufferCombination

Animation vertex combo

AttributeFormat

Format for vertex attribute

Attributes

Slice of attributes

Encoder

Command buffer encoder type.

Factory

Graphics factory type.

MeshHandle

A handle to a mesh.

PipelineState

Statically-typed pipeline state object (PSO).

Resources

Graphics resource type.

SpriteSheetHandle

An asset handle to sprite sheet metadata.

Targets

A hash map containing named render targets.

TextureHandle

A handle to a Texture asset.

VertexBufferCombination

Vertex combo