Skip to content

附录 B:Cargo Features 完整清单

Bevy 0.19.0 的 bevy crate 提供了大量 feature flag,用于按需裁剪引擎功能。默认启用的 feature 为 2d3dui

Profile Features(组合 feature)

Feature包含内容
default2d + 3d + ui
2d核心框架 + 2D 渲染 + UI + 场景 + 音频 + Picking
3d核心框架 + 3D 渲染 + UI + 场景 + 音频 + Picking
ui核心框架 + UI + 场景 + 音频 + Picking
devdebug + bevy_dev_tools + file_watcher
default_appasync_executor + bevy_asset + bevy_input_focus + bevy_log + bevy_state + bevy_window + custom_cursor + reflect_auto_register
default_platformstd + 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自动注册反射类型
serializeserde 序列化支持
debug系统/组件调试信息
track_location变更检测的源码位置追踪

渲染

Feature说明
bevy_render渲染后端(wgpu)
bevy_core_pipeline核心渲染管线
bevy_pbrPBR 材质
bevy_sprite2D Sprite
bevy_sprite_renderSprite 渲染
bevy_gizmosGizmos 调试图形
bevy_gizmos_renderGizmos 渲染
bevy_anti_alias抗锯齿
bevy_post_process后处理(bloom、DoF 等)
bevy_light光源类型
bevy_camera相机与可见性
bevy_meshMesh 格式与几何体
bevy_shaderShader 资产
bevy_text文本渲染
bevy_solari光线追踪(实验性)
meshletMeshlet 渲染(实验性)

3D 专用

Feature说明
bevy_gltfglTF 模型加载
bevy_mikktspace切线空间生成
morphMorph target
morph_animationMorph 动画
gltf_animationglTF 动画
tonemapping_lutsTonemapping 查找表
smaa_lutsSMAA 抗锯齿查找表
bluenoise_texture蓝噪声纹理
dlssNVIDIA 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_pcssPCSS 软阴影(实验性)

图像格式

Feature格式
pngPNG
jpegJPEG
hdrHDR
bmpBMP
gifGIF
icoICO
tgaTGA
tiffTIFF
webpWebP
qoiQOI
ddsDDS 压缩纹理
ktx2KTX2 压缩纹理
exrOpenEXR
pnmPNM (PAM/PBM/PGM/PPM)
ffFarbfeld

音频格式

Feature格式
wavWAV
mp3MP3
flacFLAC
vorbisOGG Vorbis
symphonia-allSymphonia 全格式支持

平台与输入

Feature说明
bevy_winitwinit 窗口后端
bevy_gilrsGamepad 支持
x11X11 显示服务器
waylandWayland 显示服务器
webgl2WebGL2 支持
webgpuWebGPU 支持
android-game-activityAndroid GameActivity
android-native-activityAndroid NativeActivity
mouse鼠标支持
keyboard键盘支持
gamepad手柄支持
touch触摸支持
gestures手势支持
custom_cursor自定义光标

资产与调试

Feature说明
file_watcher资产热重载
embedded_watcher内存资产热重载
asset_processor资产处理器
http / httpsHTTP 资产下载
web_asset_cacheWeb 资产缓存
bevy_dev_tools开发工具集
bevy_remoteBevy Remote Protocol
bevy_world_serialization世界序列化(DynamicWorld)
bevy_feathers编辑器 UI 组件库(实验性)
bevy_solari实验性光线追踪照明
bevy_debug_stepping系统单步调试
traceTracing 性能追踪
trace_chromeChrome Tracing 格式
trace_tracyTracy 集成
hotpatching系统热补丁

Shader 格式

Feature说明
shader_format_glslGLSL 支持
shader_format_spirvSPIR-V 支持
shader_format_weslWESL 支持
spirv_shader_passthroughSPIR-V 直通

其他

Feature说明
multi_threaded多线程并行(默认启用)
async_executorasync-executor 后端
dynamic_linking动态链接(仅开发期)
default_font默认 ASCII 字体
glam_assertglam 向量运算断言
debug_glam_assertDebug 模式下的 glam 断言
sysinfo_plugin系统信息诊断
web浏览器 API
std标准库
libm纯 Rust 数学库