BC converter tool
This commit is contained in:
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);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user