Skip to content

Commit

Permalink
Use crates.io version of meshopt, rename meshopt feature
Browse files Browse the repository at this point in the history
  • Loading branch information
JMS55 committed Jan 24, 2024
1 parent 67a0bc5 commit 6e72360
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ file_watcher = ["bevy_internal/file_watcher"]
embedded_watcher = ["bevy_internal/embedded_watcher"]

# Enables processing meshes into meshlet meshes for bevy_pbr
meshopt = ["bevy_internal/meshopt"]
meshlet_processor = ["bevy_internal/meshlet_processor"]

[dependencies]
bevy_dylib = { path = "crates/bevy_dylib", version = "0.12.0", default-features = false, optional = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ file_watcher = ["bevy_asset?/file_watcher"]
embedded_watcher = ["bevy_asset?/embedded_watcher"]

# Enables processing meshes into meshlet meshes for bevy_pbr
meshopt = ["bevy_pbr?/meshopt"]
meshlet_processor = ["bevy_pbr?/meshlet_processor"]

[dependencies]
# bevy
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_pbr/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ webgl = []
shader_format_glsl = ["naga_oil/glsl"]
pbr_transmission_textures = []
# Enables processing meshes into meshlet meshes
meshopt = ["dep:meshopt"]
meshlet_processor = ["dep:meshopt"]

[dependencies]
# bevy
Expand All @@ -32,7 +32,7 @@ bevy_window = { path = "../bevy_window", version = "0.12.0" }
bevy_derive = { path = "../bevy_derive", version = "0.12.0" }

# other
meshopt = { git = "https://github.com/JMS55/meshopt-rs", optional = true }
meshopt = { version = "0.2", optional = true }
bitflags = "2.3"
fixedbitset = "0.4"
# direct dependency required for derive macro
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_pbr/src/meshlet/asset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use std::sync::Arc;

/// A mesh that has been pre-processed into multiple small clusters of triangles called meshlets.
///
/// A [`bevy_render::mesh::Mesh`] can be converted to a [`MeshletMesh`] using `MeshletMesh::from_mesh` when the `meshopt` cargo feature is enabled.
/// A [`bevy_render::mesh::Mesh`] can be converted to a [`MeshletMesh`] using `MeshletMesh::from_mesh` when the `meshlet_processor` cargo feature is enabled.
/// The conversion step is very slow, and is meant to be ran once ahead of time, and not during runtime. This type of mesh is not suitable for
/// dynamically generated geometry.
///
Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_pbr/src/meshlet/from_mesh.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ impl MeshletMesh {
///
/// This process is very slow, and should be done ahead of time, and not at runtime.
///
/// This function requires the `meshopt` cargo feature, as it uses [meshoptimizer](https://github.com/zeux/meshoptimizer)
/// to generate meshlets.
/// This function requires the `meshlet_processor` cargo feature.
///
/// The input mesh must:
/// 1. Use [`PrimitiveTopology::TriangleList`]
Expand Down
4 changes: 2 additions & 2 deletions crates/bevy_pbr/src/meshlet/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Render high-poly 3d meshes using an efficient GPU-driven method. See [`MeshletPlugin`] and [`MeshletMesh`] for details.

mod asset;
#[cfg(feature = "meshopt")]
#[cfg(feature = "meshlet_processor")]
mod from_mesh;
mod gpu_scene;
mod material_draw_nodes;
Expand All @@ -19,7 +19,7 @@ pub(crate) use self::{
};

pub use self::asset::{Meshlet, MeshletBoundingSphere, MeshletMesh};
#[cfg(feature = "meshopt")]
#[cfg(feature = "meshlet_processor")]
pub use self::from_mesh::MeshToMeshletMeshConversionError;

use self::{
Expand Down
2 changes: 1 addition & 1 deletion docs/cargo_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The default feature set enables most of the expected features of a game engine,
|flac|FLAC audio format support|
|glam_assert|Enable assertions to check the validity of parameters passed to glam|
|jpeg|JPEG image format support|
|meshopt|Enables processing meshes into meshlet meshes for bevy_pbr|
|meshlet_processor|Enables processing meshes into meshlet meshes for bevy_pbr|
|minimp3|MP3 audio format support (through minimp3)|
|mp3|MP3 audio format support|
|pbr_transmission_textures|Enable support for transmission-related textures in the `StandardMaterial`, at the risk of blowing past the global, per-shader texture limit on older/lower-end GPUs|
Expand Down

0 comments on commit 6e72360

Please sign in to comment.