附录 B:Cargo Features 完整清单
Bevy 0.19.0 的 bevy crate 提供了大量 feature flag,用于按需裁剪引擎功能。默认启用的 feature 为 2d、3d、ui。
Profile Features(组合 feature)
| Feature | 包含内容 |
|---|---|
default | 2d + 3d + ui |
2d | 核心框架 + 2D 渲染 + UI + 场景 + 音频 + Picking |
3d | 核心框架 + 3D 渲染 + UI + 场景 + 音频 + Picking |
ui | 核心框架 + UI + 场景 + 音频 + Picking |
dev | debug + bevy_dev_tools + file_watcher |
default_app | async_executor + bevy_asset + bevy_input_focus + bevy_log + bevy_state + bevy_window + custom_cursor + reflect_auto_register |
default_platform | std + android-game-activity + bevy_gilrs + bevy_winit + default_font + multi_threaded + webgl2 + x11 + wayland + sysinfo_plugin |
核心功能
| Feature | 说明 |
|---|---|
bevy_asset | 资产系统 |
bevy_state | 状态机 |
bevy_window | 窗口管理 |
bevy_log | 日志(tracing 集成) |
bevy_input_focus | 输入焦点子系统 |
bevy_reflect | 运行时反射(通过 bevy_internal) |
reflect_functions | 函数反射 |
reflect_documentation | 反射文档注释 |
reflect_auto_register | 自动注册反射类型 |
serialize | serde 序列化支持 |
debug | 系统/组件调试信息 |
track_location | 变更检测的源码位置追踪 |
渲染
| Feature | 说明 |
|---|---|
bevy_render | 渲染后端(wgpu) |
bevy_core_pipeline | 核心渲染管线 |
bevy_pbr | PBR 材质 |
bevy_sprite | 2D Sprite |
bevy_sprite_render | Sprite 渲染 |
bevy_gizmos | Gizmos 调试图形 |
bevy_gizmos_render | Gizmos 渲染 |
bevy_anti_alias | 抗锯齿 |
bevy_post_process | 后处理(bloom、DoF 等) |
bevy_light | 光源类型 |
bevy_camera | 相机与可见性 |
bevy_mesh | Mesh 格式与几何体 |
bevy_shader | Shader 资产 |
bevy_text | 文本渲染 |
bevy_solari | 光线追踪(实验性) |
meshlet | Meshlet 渲染(实验性) |
3D 专用
| Feature | 说明 |
|---|---|
bevy_gltf | glTF 模型加载 |
bevy_mikktspace | 切线空间生成 |
morph | Morph target |
morph_animation | Morph 动画 |
gltf_animation | glTF 动画 |
tonemapping_luts | Tonemapping 查找表 |
smaa_luts | SMAA 抗锯齿查找表 |
bluenoise_texture | 蓝噪声纹理 |
dlss | NVIDIA DLSS 支持 |
PBR 扩展
| Feature | 说明 |
|---|---|
pbr_transmission_textures | 透射纹理 |
pbr_clustered_decals | 集群贴花 |
pbr_light_textures | 光照纹理 |
pbr_multi_layer_material_textures | 多层材质纹理 |
pbr_anisotropy_texture | 各向异性纹理 |
pbr_specular_textures | 高光纹理 |
experimental_pbr_pcss | PCSS 软阴影(实验性) |
图像格式
| Feature | 格式 |
|---|---|
png | PNG |
jpeg | JPEG |
hdr | HDR |
bmp | BMP |
gif | GIF |
ico | ICO |
tga | TGA |
tiff | TIFF |
webp | WebP |
qoi | QOI |
dds | DDS 压缩纹理 |
ktx2 | KTX2 压缩纹理 |
exr | OpenEXR |
pnm | PNM (PAM/PBM/PGM/PPM) |
ff | Farbfeld |
音频格式
| Feature | 格式 |
|---|---|
wav | WAV |
mp3 | MP3 |
flac | FLAC |
vorbis | OGG Vorbis |
symphonia-all | Symphonia 全格式支持 |
平台与输入
| Feature | 说明 |
|---|---|
bevy_winit | winit 窗口后端 |
bevy_gilrs | Gamepad 支持 |
x11 | X11 显示服务器 |
wayland | Wayland 显示服务器 |
webgl2 | WebGL2 支持 |
webgpu | WebGPU 支持 |
android-game-activity | Android GameActivity |
android-native-activity | Android NativeActivity |
mouse | 鼠标支持 |
keyboard | 键盘支持 |
gamepad | 手柄支持 |
touch | 触摸支持 |
gestures | 手势支持 |
custom_cursor | 自定义光标 |
资产与调试
| Feature | 说明 |
|---|---|
file_watcher | 资产热重载 |
embedded_watcher | 内存资产热重载 |
asset_processor | 资产处理器 |
http / https | HTTP 资产下载 |
web_asset_cache | Web 资产缓存 |
bevy_dev_tools | 开发工具集 |
bevy_remote | Bevy Remote Protocol |
bevy_world_serialization | 世界序列化(DynamicWorld) |
bevy_feathers | 编辑器 UI 组件库(实验性) |
bevy_solari | 实验性光线追踪照明 |
bevy_debug_stepping | 系统单步调试 |
trace | Tracing 性能追踪 |
trace_chrome | Chrome Tracing 格式 |
trace_tracy | Tracy 集成 |
hotpatching | 系统热补丁 |
Shader 格式
| Feature | 说明 |
|---|---|
shader_format_glsl | GLSL 支持 |
shader_format_spirv | SPIR-V 支持 |
shader_format_wesl | WESL 支持 |
spirv_shader_passthrough | SPIR-V 直通 |
其他
| Feature | 说明 |
|---|---|
multi_threaded | 多线程并行(默认启用) |
async_executor | async-executor 后端 |
dynamic_linking | 动态链接(仅开发期) |
default_font | 默认 ASCII 字体 |
glam_assert | glam 向量运算断言 |
debug_glam_assert | Debug 模式下的 glam 断言 |
sysinfo_plugin | 系统信息诊断 |
web | 浏览器 API |
std | 标准库 |
libm | 纯 Rust 数学库 |