|
|
@ -200,7 +200,14 @@ impl Model {
|
|
|
|
layout: &wgpu::BindGroupLayout,
|
|
|
|
layout: &wgpu::BindGroupLayout,
|
|
|
|
path: P,
|
|
|
|
path: P,
|
|
|
|
) -> Result<Self> {
|
|
|
|
) -> Result<Self> {
|
|
|
|
let (obj_models, obj_materials) = tobj::load_obj(path.as_ref(), true)?;
|
|
|
|
let (obj_models, obj_materials) = tobj::load_obj(path.as_ref(), &LoadOptions {
|
|
|
|
|
|
|
|
triangulate: true,
|
|
|
|
|
|
|
|
single_index: true,
|
|
|
|
|
|
|
|
..Default::default()
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
)?;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
let obj_materials = obj_materials?;
|
|
|
|
|
|
|
|
|
|
|
|
// We're assuming that the texture files are stored with the obj file
|
|
|
|
// We're assuming that the texture files are stored with the obj file
|
|
|
|
let containing_folder = path.as_ref().parent()
|
|
|
|
let containing_folder = path.as_ref().parent()
|
|
|
|