Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pnm textures #8601

Merged
merged 2 commits into from
May 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,9 @@ dds = ["bevy_internal/dds"]
# KTX2 compressed texture support
ktx2 = ["bevy_internal/ktx2"]

# PNM image format support, includes pam, pbm, pgm and ppm
pnm = ["bevy_internal/pnm"]

# For KTX2 supercompression
zlib = ["bevy_internal/zlib"]

Expand Down
1 change: 1 addition & 0 deletions crates/bevy_internal/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ bmp = ["bevy_render/bmp"]
webp = ["bevy_render/webp"]
basis-universal = ["bevy_render/basis-universal"]
dds = ["bevy_render/dds"]
pnm = ["bevy_render/pnm"]
ktx2 = ["bevy_render/ktx2"]
# For ktx2 supercompression
zlib = ["bevy_render/zlib"]
Expand Down
1 change: 1 addition & 0 deletions crates/bevy_render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jpeg = ["image/jpeg"]
bmp = ["image/bmp"]
webp = ["image/webp"]
dds = ["ddsfile"]
pnm = ["image/pnm"]
bevy_ci_testing = ["bevy_app/bevy_ci_testing"]

shader_format_glsl = ["naga/glsl-in", "naga/wgsl-out"]
Expand Down
8 changes: 8 additions & 0 deletions crates/bevy_render/src/texture/image_texture_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,14 @@ const FILE_EXTENSIONS: &[&str] = &[
"ktx2",
#[cfg(feature = "webp")]
"webp",
#[cfg(feature = "pnm")]
"pam",
#[cfg(feature = "pnm")]
"pbm",
#[cfg(feature = "pnm")]
"pgm",
#[cfg(feature = "pnm")]
"ppm",
];

impl AssetLoader for ImageTextureLoader {
Expand Down
1 change: 1 addition & 0 deletions docs/cargo_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ The default feature set enables most of the expected features of a game engine,
|jpeg|JPEG image format support|
|minimp3|MP3 audio format support (through minimp3)|
|mp3|MP3 audio format support|
|pnm|PNM image format support, includes pam, pbm, pgm and ppm|
|serialize|Enable serialization support through serde|
|shader_format_glsl|Enable support for shaders in GLSL|
|shader_format_spirv|Enable support for shaders in SPIR-V|
Expand Down