BC converter tool
This commit is contained in:
@@ -3,6 +3,7 @@ name = "rust-engine"
|
||||
version = "0.1.0"
|
||||
authors = ["Till <asuro@posteo.de>"]
|
||||
edition = "2018"
|
||||
default-run = "rust-engine"
|
||||
|
||||
[dependencies]
|
||||
vulkano-shaders = "0.20"
|
||||
@@ -19,5 +20,9 @@ gilrs = "0.7.4"
|
||||
gltf = "0.15.2"
|
||||
mgf = "1.4.0"
|
||||
|
||||
[[bin]]
|
||||
name = "converter"
|
||||
path = "build/converter/src/main.rs"
|
||||
|
||||
[profile.dev.package."*"]
|
||||
opt-level = 3
|
||||
20
build/converter/src/main.rs
Normal file
20
build/converter/src/main.rs
Normal file
@@ -0,0 +1,20 @@
|
||||
use gltf::image::Source;
|
||||
|
||||
fn main() {
|
||||
let doc = gltf::Gltf::open("models/box.gltf").unwrap();
|
||||
for image in doc.images() {
|
||||
if let Source::Uri { uri, .. } = image.source() {
|
||||
println!("{}", uri);
|
||||
let tex_conv_output = std::process::Command::new("build/nvidia-texture-converter/nvtt_export.exe")
|
||||
.arg("-q").arg("fastest")
|
||||
.arg("-f").arg("bc1")
|
||||
.arg("--no-mips")
|
||||
.arg("-o").arg(format!("textures/{}.dds", image.name().unwrap()))
|
||||
.arg(uri)
|
||||
.current_dir("models")
|
||||
.output().expect("Failed to run texture converter.");
|
||||
println!("{:?}", tex_conv_output);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
BIN
build/nvidia-texture-converter/FreeImage.dll
Normal file
BIN
build/nvidia-texture-converter/FreeImage.dll
Normal file
Binary file not shown.
BIN
build/nvidia-texture-converter/nvtt_export.exe
Normal file
BIN
build/nvidia-texture-converter/nvtt_export.exe
Normal file
Binary file not shown.
Reference in New Issue
Block a user