Cargo Features
[dependencies]
bevy_hanabi = { version = "0.14.0", default-features = false, features = ["2d", "3d", "serde", "trace", "gpu_tests", "examples_world_inspector"] }
- default = 2d, 3d, examples_world_inspector, gpu_tests, serde
-
These default features are set whenever
bevy_hanabi
is added without
somewhere in the dependency tree.default-features = false - 2d default
-
Enable support for rendering through a 2D camera (Camera2d).
You need to activate either the 2d or 3d feature at least (or both).Affects
bevy_hanabi::ParticleEffect.z_layer_2d
… - 3d default
-
Enable support for rendering through a 3D camera (Camera3d).
You need to activate either the 2d or 3d feature at least (or both). - serde default = typetag
-
Enable serializing and deserializing of assets. This doesn't work on WASM,
because typetag is not available for the wasm target.Affects
asset::EffectAssetLoader
,asset::EffectAssetLoaderError
… - trace
-
Enable tracing annotations. This is disabled by default for performance.
- gpu_tests default
-
Special feature to enable GPU-based tests, which otherwise fail on a CI machine without a graphic adapter or without proper drivers.
This is a testing-only feature, which has no effect on the build. - examples_world_inspector default
-
Enable world inspector in examples, via bevy-inspector-egui.
This has no effect on the crate itself, only affects examples.
Unfortunately cargo doesn't allow example-only features.
We don't force a dependency on the bevy-inspector-egui crate because:
1. dev-dependencies cannot be optional
2. there's a bunch of duplicate deps and dodgy licenses pulled
Features from optional dependencies
In crates that don't use the dep:
syntax, optional dependencies automatically become Cargo features. These features may have been created by mistake, and this functionality may be removed in the future.