Warning: this page has not been updated for Bevy 0.10 yet!
List of Bevy Builtins
This page is a quick condensed listing of all the important things provided by Bevy.
- SystemParams
- Assets
- File Formats
wgpu
Backends- Bundles
- Resources (Configuration)
- Resources (Engine User)
- Resources (Input)
- Events (Input)
- Events (Engine)
- Events (System/Control)
- Components
- GLTF Asset Labels
- Stages
SystemParams
These are all the special types that can be used as system parameters.
In regular systems:
Commands
: Manipulate the ECS using commandsRes<T>
: Shared access to a resourceResMut<T>
: Exclusive (mutable) access to a resourceOption<Res<T>>
: Shared access to a resource that may not existOption<ResMut<T>>
: Exclusive (mutable) access to a resource that may not existQuery<T, F = ()>
(can contain tuples of up to 15 types): Access to entities and componentsParamSet
(with up to 8 params): Resolve conflicts between incompatible system parametersLocal<T>
: Data local to the systemEventReader<T>
: Receive eventsEventWriter<T>
: Send eventsRemovedComponents<T>
: Removal detectionNonSend<T>
: Shared access to Non-Send
(main thread only) dataNonSendMut<T>
: Mut access to Non-Send
(main thread only) dataParallelCommands
: Abstraction to help useCommands
when you will do your own parallelismSystemName
: The name (string) of the system, may be useful for debugging&World
: Read-only direct access to the ECS WorldEntities
: Low-level ECS metadata: All entitiesComponents
: Low-level ECS metadata: All componentsBundles
: Low-level ECS metadata: All bundlesArchetypes
: Low-level ECS metadata: All archetypesSystemChangeTick
: Low-level ECS metadata: Tick used for change detectionStaticSystemParam
: Helper for generic system abstractions, to avoid lifetime annotations- tuples containing any of these types, with up to 16 members
&mut World
: Full direct access to the ECS WorldLocal<T>
: Data local to the systemSystemState<P>
: Emulates a regular system, allowing you to easily access data from the World.P
are the system parameters.QueryState<Q, F = ()>
: Allows you to perform queries on the World, similar to aQuery
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 stage can also use
Extract<T>
, to access data from the Main World instead of the
Render World. T
can be any other 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 theSamplerDescriptor
for texture filtering settingsTextureAtlas
: 2D "Sprite Sheet" defining sub-images within a single larger imageMesh
: 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 imageStandardMaterial
: "3D material" with support for Physically-Based RenderingAnimationClip
: Data for a single animation sequence, can be used withAnimationPlayer
Font
: Font data used for text renderingScene
: Scene composed of literal ECS entities to instantiateDynamicScene
: Scene composed with dynamic typing and reflectionGltf
: GLTF Master Asset: index of the entire contents of a GLTF fileGltfNode
: Logical GLTF object in a sceneGltfMesh
: Logical GLTF 3D model, consisting of multipleGltfPrimitive
sGltfPrimitive
: Single unit to be rendered, contains the Mesh and Material to useAudioSource
: Raw audio data forbevy_audio
AudioSink
: Audio that is currently active, can be used to control playbackFontAtlasSet
: (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):
Format | Cargo feature | Default? | Filename extensions |
---|---|---|---|
PNG | "png" | Yes | .png |
HDR | "hdr" | Yes | .hdr |
JPEG | "jpeg" | No | .jpg , .jpeg |
TGA | "tga" | No | .tga |
BMP | "bmp" | No | .bmp |
DDS | "dds" | No | .dds |
KTX2 | "ktx2" | No | .ktx2 |
Basis | "basis-universal" | No | .basis |
Audio formats (loaded as AudioSource
assets):
Format | Cargo feature | Default? | Filename extensions |
---|---|---|---|
OGG Vorbis | "vorbis" | Yes | .ogg |
FLAC | "flac" | No | .flac |
WAV | "wav" | No | .wav |
MP3 | "mp3" | No | .mp3 |
3D asset (model or scene) formats:
Format | Cargo feature | Default? | Filename extensions |
---|---|---|---|
GLTF | "bevy_gltf" | Yes | .gltf , .glb |
Shader formats (loaded as Shader
assets):
Format | Cargo feature | Default? | Filename extensions |
---|---|---|---|
SPIR-V | n/a | Yes | .spv |
WGSL | n/a | Yes | .wgsl |
GLSL | n/a | Yes | .vert , .frag , .comp |
Font formats (loaded as Font
assets):
Format | Cargo feature | Default? | Filename extensions |
---|---|---|---|
TrueType | n/a | Yes | .ttf |
OpenType | n/a | Yes | .otf |
Bevy Scenes:
Format | Filename extensions |
---|---|
RON-serialized scene | .scn ,.scn.ron |
There are unofficial plugins available for adding support for even more file formats.
wgpu
Backends
wgpu
(and hence Bevy) supports the following backends for each platform:
- Vulkan (Linux/Windows/Android)
- DirectX 12 (Windows)
- Metal (Apple)
- WebGL2 (Web)
- WebGPU (Web; experimental)
- GLES3 (Linux/Android; legacy)
- DirectX 11 (Windows; legacy; WIP (not yet ready for use))
Bundles
Bevy's built-in bundle types, for spawning different common kinds of entities.
Any tuples of up to 15 Component
types are valid bundles.
General:
SpatialBundle
: Contains the required transform and visibility components that must be included on all entities that need rendering or hierarchyTransformBundle
: Contains only the transform types, subset ofSpatialBundle
VisibilityBundle
: Contains only the visibility types, subset ofSpatialBundle
Scenes:
SceneBundle
: Used for spawning scenesDynamicSceneBundle
: Used for spawning dynamic scenes
Bevy 3D:
Camera3dBundle
: 3D camera, can use perspective (default) or orthographic projectionMaterialMeshBundle
: 3D Object/Primitive: a Mesh and the Material to draw it withPbrBundle
:MaterialMeshBundle
with the standard Physically-Based MaterialStandardMaterial
DirectionalLightBundle
: 3D directional light (like the sun)PointLightBundle
: 3D point light (like a lamp or candle)SpotLightBundle
: 3D spot light (like a projector or flashlight)
Bevy 2D:
Camera2dBundle
: 2D camera, uses orthographic projection + other special configuration for 2DSpriteBundle
: 2D sprite (Image
asset type)SpriteSheetBundle
: 2D sprite (TextureAtlas
asset type)MaterialMesh2dBundle
: 2D shape, with custom Mesh and Material (similar to 3D objects)Text2dBundle
: Text to be drawn in the 2D world (not the UI)
Bevy UI:
NodeBundle
: Empty node element (like HTML<div>
)ButtonBundle
: Button elementImageBundle
: Image elementTextBundle
: Text element
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 frameAmbientLight
: Global renderer "fake lighting", so that shadows don't look too dark / blackMsaa
: Global renderer setting for Multi-Sample Anti-Aliasing (some platforms might only support the values 1 and 4)ClusterConfig
: Configuration of the light clustering algorithm, affects the performance of 3D scenes with many lightsWireframeConfig
: Global toggle to make everything be rendered as wireframeGamepadSettings
: Gamepad input device settings, like joystick deadzones and button sensitivitiesWinitSettings
: Settings for the OS Windowing backend, including update loop / power-management settings
Settings that are not modifiable at runtime are not represented using resources. Instead, they are configured via the respective plugins.
In Bevy 0.9, there is an exception to this rule:
WgpuSettings
: Low-level settings for the GPU API and backends
These settings must be inserted as a resource to the app, at the top,
before adding DefaultPlugins
.
This API inconsistency will be addressed in future versions of Bevy. These settings will be configurable using the plugin, instead of a resource, just like other settings that are only used during engine startup.
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.
Time
: Global time-related information (current frame delta time, time since startup, etc.)AssetServer
: Control the asset system: Load assets, check load status, etc.Assets<T>
: Contains the actual data of the loaded assets of a given typeState<T>
: Control over app statesGamepads
: List of IDs for all currently-detected (connected) gamepad devicesWindows
: All the open windows (the primary window + any additional windows in a multi-window gui app)WinitWindows
(non-send): Raw state of thewinit
backend for each windowAudio
: Use this to play sounds viabevy_audio
SceneSpawner
: Direct control over spawning Scenes into the main app WorldAppTypeRegistry
: Access to the Reflection Type RegistryFixedTimesteps
: The state of all registeredFixedTimestep
driversAsyncComputeTaskPool
: Task pool for running background CPU tasksComputeTaskPool
: Task pool where the main app schedule (all the systems) runsIoTaskPool
: Task pool where background i/o tasks run (like asset loading)FrameCount
: Global time-related information (current frame delta time, time since startup, etc.)Diagnostics
: Diagnostic data collected by the engine (like frame times)NonSendMarker
: Dummy resource to ensure a system always runs on the main thread
Render World Resources
These resources are present in the Render World. They can be accessed from rendering systems (that run during render stages).
RenderGraph
: The Bevy Render GraphPipelineCache
: 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.RenderAssets<T>
: Contains handles to the GPU representations of currently loaded asset dataDefaultImageSampler
: The default sampler forImage
asset texturesFallbackImage
: 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/computeRenderQueue
: The GPU queue for submitting work to the hardwareRenderAdapter
: Handle to the physical GPU hardwareRenderAdapterInfo
: 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.
Input<KeyCode>
: Keyboard key state, as a binary Input valueInput<MouseButton>
: Mouse button state, as a binary Input valueInput<GamepadButton>
: Gamepad buttons, as a binary Input valueAxis<GamepadAxis>
: Analog Axis gamepad inputs (joysticks and triggers)Axis<GamepadButton>
: Gamepad buttons, represented as an analog Axis valueTouches
: The state of all fingers currently touching the touchscreenGamepads
: Registry of all the connectedGamepad
IDs
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 buttonsMouseWheel
: Scrolling by a number of pixels or lines (MouseScrollUnit
)MouseMotion
: Relative movement of the mouse (pixels from previous frame), regardless of the OS pointer/cursorCursorMoved
: New position of the OS mouse pointer/cursorKeyboardInput
: 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)TouchInput
: Change in the state of a finger touching the touchscreenGamepadEvent
: Changes in the state of a gamepad or any of its buttons or axesGamepadEventRaw
: Gamepad events unaffected byGamepadSettings
Engine Events
Events related to various internal things happening during the normal runtime of a Bevy app.
AssetEvent<T>
: Sent by Bevy when asset data has been added/modified/removed; can be used to detect changes to assetsHierarchyEvent
: Sent by Bevy when entity parents/children changeAppExit
: Tell Bevy to shut down
System and Control Events
Events from the OS / windowing system, or to control Bevy.
RequestRedraw
: In an app that does not refresh continuously, request one more update before going to sleepCreateWindow
: Tell Bevy to open a new windowFileDragAndDrop
: The user drag-and-dropped a file into our appCursorEntered
: OS mouse pointer/cursor entered one of our windowsCursorLeft
: OS mouse pointer/cursor exited one of our windowsWindowCloseRequested
: OS wants to close one of our windowsWindowCreated
: New application window openedWindowFocused
: One of our windows is now focusedWindowMoved
: OS/user moved one of our windowsWindowResized
: OS/user resized one of our windowsWindowScaleFactorChanged
: One of our windows has changed its DPI scaling factorWindowBackendScaleFactorChanged
: OS reports change in DPI scaling factor for a window
Components
The complete list of individual component types is too specific to be useful to list here.
See: (List in API Docs)
Curated/opinionated list of the most important built-in component types:
Transform
: Local transform (relative to parent, if any)GlobalTransform
: Global transform (in the world)Parent
: Entity's parent, if in a hierarchyChildren
: Entity's children, if in a hierarchyHandle<T>
: Reference to an asset of specific typeVisibility
: Manually control visibility, whether to display the entity (hide/show)ComputedVisibility
: Check if an entity should be rendered (is it hidden? is it culled?)RenderLayers
: Group entities into "layers" and control which "layers" a camera should displayAnimationPlayer
: Make the entity capable of playing animations; used to control animationsCamera
: Camera used for renderingUiCameraConfig
: Can be used to disable or configure UI rendering for a specific cameraCamera2d
: Configuration parameters for 2D camerasCamera3d
: Configuration parameters for 3D camerasOrthographicProjection
: Orthographic projection for a 2D cameraProjection
: Projection for a 3D camera (perspective or orthographic)Sprite
: (2D) Properties of a sprite, using a whole imageTextureAtlasSprite
: (2D) Properties of a sprite, using a sprite sheetPointLight
: (3D) Properties of a point lightSpotLight
: (3D) Properties of a spot lightDirectionalLight
: (3D) Properties of a directional lightNoFrustumCulling
: (3D) Cause this mesh to always be drawn, even when not visible by any cameraNotShadowCaster
: (3D) Disable entity from producing dynamic shadowsNotShadowReceiver
: (3D) Disable entity from having dynamic shadows of other entitiesWireframe
: (3D) Draw object in wireframe modeNode
: (UI) Mark entity as being controlled by the UI layout systemStyle
: (UI) Layout properties of the nodeInteraction
: (UI) Track interaction/selection state: if the node is clicked or hovered overUiImage
: (UI) Image to be displayed as part of a UI nodeBackgroundColor
: (UI) Color to use for a UI nodeButton
: (UI) Marker for a pressable buttonText
: Text to be displayed
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 BevyScene
Node{}
: GLTF Node asGltfNode
Mesh{}
: GLTF Mesh asGltfMesh
Mesh{}/Primitive{}
: GLTF Primitive as BevyMesh
Texture{}
: GLTF Texture as BevyImage
Material{}
: GLTF Material as BevyStandardMaterial
DefaultMaterial
: as above, if the GLTF file contains a default material with no indexAnimation{}
: GLTF Animation as BevyAnimationClip
Skin{}
: GLTF mesh skin as BevySkinnedMeshInverseBindposes
Stages
Internally, Bevy has at least these built-in stages:
- In the main_app (
StartupStage
, run once at app startup):PreStartup
,Startup
,PostStartup
- In the main app (
CoreStage
, run every frame update):First
,PreUpdate
,Update
,PostUpdate
,Last
- In the render sub-app (
RenderStage
):Extract
,Prepare
,Queue
,PhaseSort
,Render
,Cleanup
The Render Stages are each intended for a specific purpose:
Extract
: quickly copy the minimal data you need from the main World to the render WorldPrepare
: send data to the GPU (buffers, textures, bind groups)Queue
: generate the render jobs to be run (usually phase items)PhaseSort
: sort and batch phase items for efficient renderingRender
: execute the render graph to produce actual GPU commands and do the workCleanup
: clear any data from the render World that should not persist to the next frame