Bevy Version:0.11(outdated!)

As this page is outdated, please refer to Bevy's official migration guides while reading, to cover the differences: 0.11 to 0.12, 0.12 to 0.13, 0.13 to 0.14. 0.14 to 0.15.

I apologize for the inconvenience. I will update the page as soon as I find the time.


List of Bevy Builtins

This page is a quick condensed listing of all the important things provided by Bevy.

SystemParams

These are all the special types that can be used as system parameters.

(List in API Docs)

In regular systems:

In exclusive systems:

  • [&mut World]: Full direct access to the ECS World
  • [Local<T>]: Data local to the system
  • [&mut SystemState<P>][SystemState]: Emulates a regular system, allowing you to easily access data from the World. P are the system parameters.
  • [&mut QueryState<Q, F = ()>][QueryState]: Allows you to perform queries on the World, similar to a [Query] in regular systems.

Your function can have a maximum of 16 total parameters. If you need more, group them into tuples to work around the limit. Tuples can contain up to 16 members, but can be nested indefinitely.

Systems running during the Extract schedule can also use Extract<T>, to access data from the Main World instead of the Render World. T can be any read-only system parameter type.

Assets

(more info about working with assets)

These are the Asset types registered by Bevy by default.

  • Image: Pixel data, used as a texture for 2D and 3D rendering; also contains the SamplerDescriptor for texture filtering settings
  • TextureAtlas: 2D "Sprite Sheet" defining sub-images within a single larger image
  • Mesh: 3D Mesh (geometry data), contains vertex attributes (like position, UVs, normals)
  • Shader: GPU shader code, in one of the supported languages (WGSL/SPIR-V/GLSL)
  • ColorMaterial: Basic "2D material": contains color, optionally an image
  • StandardMaterial: "3D material" with support for Physically-Based Rendering
  • AnimationClip: Data for a single animation sequence, can be used with AnimationPlayer
  • Font: Font data used for text rendering
  • Scene: Scene composed of literal ECS entities to instantiate
  • DynamicScene: Scene composed with dynamic typing and reflection
  • Gltf: GLTF Master Asset: index of the entire contents of a GLTF file
  • GltfNode: Logical GLTF object in a scene
  • GltfMesh: Logical GLTF 3D model, consisting of multiple GltfPrimitives
  • GltfPrimitive: Single unit to be rendered, contains the Mesh and Material to use
  • AudioSource: Audio data for bevy_audio
  • FontAtlasSet: (internal use for text rendering)
  • SkinnedMeshInverseBindposes: (internal use for skeletal animation)

File Formats

These are the asset file formats (asset loaders) supported by Bevy. Support for each one can be enabled/disabled using cargo features. Some are enabled by default, many are not.

Image formats (loaded as Image assets):

FormatCargo featureDefault?Filename extensions
PNG"png"Yes.png
HDR"hdr"Yes.hdr
KTX2"ktx2"Yes.ktx2
KTX2+zstd"ktx2", "zstd"Yes.ktx2
JPEG"jpeg"No.jpg, .jpeg
WebP"webp"No.webp
OpenEXR"exr"No.exr
TGA"tga"No.tga
PNM"pnm"No.pam, .pbm, .pgm, .ppm
BMP"bmp"No.bmp
DDS"dds"No.dds
KTX2+zlib"ktx2", "zlib"No.ktx2
Basis"basis-universal"No.basis

Audio formats (loaded as AudioSource assets):

FormatCargo featureDefault?Filename extensions
OGG Vorbis"vorbis"Yes.ogg, .oga, .spx
FLAC"flac"No.flac
WAV"wav"No.wav
MP3"mp3"No.mp3

3D asset (model or scene) formats:

FormatCargo featureDefault?Filename extensions
GLTF"bevy_gltf"Yes.gltf, .glb

Shader formats (loaded as Shader assets):

FormatCargo featureDefault?Filename extensions
WGSLn/aYes.wgsl
GLSL"shader_format_glsl"No.vert, .frag, .comp
SPIR-V"shader_format_spirv"No.spv

Font formats (loaded as Font assets):

FormatCargo featureDefault?Filename extensions
TrueTypen/aYes.ttf
OpenTypen/aYes.otf

Bevy Scenes:

FormatFilename extensions
RON-serialized scene.scn,.scn.ron

There are unofficial plugins available for adding support for even more file formats.

GLTF Asset Labels

Asset path labels to refer to GLTF sub-assets.

The following asset labels are supported ({} is the numerical index):

  • Scene{}: GLTF Scene as Bevy Scene
  • Node{}: GLTF Node as GltfNode
  • Mesh{}: GLTF Mesh as GltfMesh
  • Mesh{}/Primitive{}: GLTF Primitive as Bevy Mesh
  • Mesh{}/Primitive{}/MorphTargets: Morph target animation data for a GLTF Primitive
  • Texture{}: GLTF Texture as Bevy Image
  • Material{}: GLTF Material as Bevy StandardMaterial
  • DefaultMaterial: as above, if the GLTF file contains a default material with no index
  • Animation{}: GLTF Animation as Bevy AnimationClip
  • Skin{}: GLTF mesh skin as Bevy SkinnedMeshInverseBindposes

Shader Imports

TODO

wgpu Backends

wgpu (and hence Bevy) supports the following backends:

PlatformBackends (in order of priority)
LinuxVulkan, GLES3
WindowsDirectX 12, Vulkan, GLES3
macOSMetal
iOSMetal
AndroidVulkan, GLES3
WebWebGPU, WebGL2

On GLES3 and WebGL2, some renderer features are unsupported and performance is worse.

WebGPU is experimental and few browsers support it.

Schedules

Internally, Bevy has these built-in schedules:

  • Main: runs every frame update cycle, to perform general app logic
  • ExtractSchedule: runs after Main, to copy data from the Main World into the Render World
  • Render: runs after ExtractSchedule, to perform all rendering/graphics, in parallel with the next Main run

The Main schedule simply runs a sequence of other schedules:

On the first run (first frame update of the app):

On every run (controlled via the MainScheduleOrder resource):

  • First: any initialization that must be done at the start of every frame
  • PreUpdate: for engine-internal systems intended to run before user logic
  • StateTransition: perform any pending state transitions
  • RunFixedUpdateLoop: runs the FixedUpdate schedule as many times as needed
  • Update: for all user logic (your systems) that should run every frame
  • PostUpdate: for engine-internal systems intended to run after user logic
  • Last: any final cleanup that must be done at the end of every frame

FixedUpdate is for all user logic (your systems) that should run at a fixed timestep.

StateTransition runs the OnEnter(...)/OnTransition(...)/OnExit(...) schedules for your states, when you want to change state.

The Render schedule is organized using sets (RenderSet):

  • ExtractCommands: apply deferred buffers from systems that ran in ExtractSchedule
  • Prepare/PrepareFlush: set up data on the GPU (buffers, textures, etc.)
  • Queue/QueueFlush: generate the render jobs to be run (usually phase items)
  • PhaseSort/PhaseSortFlush: sort and batch phase items for efficient rendering
  • Render/RenderFlush: execute the render graph to actually trigger the GPU to do work
  • Cleanup/CleanupFlush: clear any data from the render World that should not persist to the next frame

The *Flush variants are just to apply any deferred buffers after every step, if needed.

Run Conditions

TODO

Plugins

TODO

Bundles

Bevy's built-in bundle types, for spawning different common kinds of entities.

(List in API Docs)

Any tuples of up to 15 Component types are valid bundles.

General:

Scenes:

Audio:

Bevy 3D:

Bevy 2D:

Bevy UI:

Resources

(more info about working with resources)

Configuration Resources

These resources allow you to change the settings for how various parts of Bevy work.

These may be inserted at the start, but should also be fine to change at runtime (from a system):

  • ClearColor: Global renderer background color to clear the window at the start of each frame
  • GlobalVolume: The overall volume for playing audio
  • AmbientLight: Global renderer "fake lighting", so that shadows don't look too dark / black
  • Msaa: Global renderer setting for Multi-Sample Anti-Aliasing (some platforms might only support the values 1 and 4)
  • UiScale: Global scale value to make all UIs bigger/smaller
  • GizmoConfig: Controls how gizmos are rendered
  • WireframeConfig: Global toggle to make everything be rendered as wireframe
  • GamepadSettings: Gamepad input device settings, like joystick deadzones and button sensitivities
  • WinitSettings: Settings for the OS Windowing backend, including update loop / power-management settings
  • TimeUpdateStrategy: Used to control how the Time is updated
  • Schedules: Stores all schedules, letting you register additional functionality at runtime
  • MainScheduleOrder: The sequence of schedules that will run every frame update

Settings that are not modifiable at runtime are not represented using resources. Instead, they are configured via the respective plugins.

Engine Resources

These resources provide access to different features of the game engine at runtime.

Access them from your systems, if you need their state, or to control the respective parts of Bevy. These resources are in the Main World. See here for the resources in the Render World.

Render World Resources

These resources are present in the Render World. They can be accessed from rendering systems (that run during render stages).

  • MainWorld: (extract schedule only!) access data from the Main World
  • RenderGraph: The Bevy Render Graph
  • PipelineCache: Bevy's manager of render pipelines. Used to store render pipelines used by the app, to avoid recreating them more than once.
  • TextureCache: Bevy's manager of temporary textures. Useful when you need textures to use internally during rendering.
  • DrawFunctions<P>: Stores draw functions for a given phase item type
  • RenderAssets<T>: Contains handles to the GPU representations of currently loaded asset data
  • DefaultImageSampler: The default sampler for Image asset textures
  • FallbackImage: Dummy 1x1 pixel white texture. Useful for shaders that normally need a texture, when you don't have one available.

There are many other resources in the Render World, which are not mentioned here, either because they are internal to Bevy's rendering algorithms, or because they are just extracted copies of the equivalent resources in the Main World.

Low-Level wgpu Resources

Using these resources, you can have direct access to the wgpu APIs for controlling the GPU. These are available in both the Main World and the Render World.

  • RenderDevice: The GPU device, used for creating hardware resources for rendering/compute
  • [RenderQueue][bevy::RenderQueue]: The GPU queue for submitting work to the hardware
  • RenderAdapter: Handle to the physical GPU hardware
  • RenderAdapterInfo: Information about the GPU hardware that Bevy is running on

Input Handling Resources

These resources represent the current state of different input devices. Read them from your systems to handle user input.

Events

(more info about working with events)

Input Events

These events fire on activity with input devices. Read them to [handle user input][cb::input].

  • MouseButtonInput: Changes in the state of mouse buttons
  • MouseWheel: Scrolling by a number of pixels or lines (MouseScrollUnit)
  • MouseMotion: Relative movement of the mouse (pixels from previous frame), regardless of the OS pointer/cursor
  • CursorMoved: New position of the OS mouse pointer/cursor
  • KeyboardInput: Changes in the state of keyboard keys (keypresses, not text)
  • ReceivedCharacter: Unicode text input from the OS (correct handling of the user's language and layout)
  • Ime: Unicode text input from IME (support for advanced text input in different scripts)
  • TouchInput: Change in the state of a finger touching the touchscreen
  • GamepadEvent: Changes in the state of a gamepad or any of its buttons or axes
  • GamepadRumbleRequest: Send these events to control gamepad rumble
  • TouchpadMagnify: Pinch-to-zoom gesture on laptop touchpad (macOS)
  • TouchpadRotate: Two-finger rotate gesture on laptop touchpad (macOS)

Engine Events

Events related to various internal things happening during the normal runtime of a Bevy app.

System and Control Events

Events from the OS / windowing system, or to control Bevy.

Components

The complete list of individual component types is too specific to be useful to list here.

See: (List in API Docs)