Open droqen opened 1 year ago
can share the model for testing or you can confirm behavior when you import the model in : https://sandbox.babylonjs.com/
and
Good point. I've attached a zipped really_tall_lumpy_wall.glb file which renders in the 'correct' way in both those importers but not Ambient:
And this is a version with transformations applied, tall_noscale.glb (note the texture looks a bit different, it's weird), which works the same in everything:
I took a look; the model is processed correctly in the asset pipeline, this is the outputed main.json:
{
"AQAAAAAAAAAAAAAAAAAAAA": {
"ambient_core::app::name": "really_tall_lumpy_wall.glb",
"ambient_core::hierarchy::children": [
"3_VYN2ucw3IDBOM03tv-bQ"
],
"ambient_core::transform::local_to_parent": [
1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
1.0,
0.0,
0.0,
1.0,
0.0,
0.0,
0.0,
0.0,
0.0,
1.0
],
"ambient_core::rendering::local_bounding_aabb": {
"min": [
-4.9624176,
-0.79670465,
-14.395552
],
"max": [
5.214872,
0.78311956,
13.87838
]
},
"ambient_core::model::model_skins": []
},
"3_VYN2ucw3IDBOM03tv-bQ": {
"ambient_core::animation::bind_id": "Cube",
"ambient_core::app::name": "Cube",
"ambient_core::transform::rotation": [
0.0,
0.0,
0.0,
1.0
],
"ambient_core::transform::scale": [
4.590142,
13.87838,
0.22796158
],
"ambient_core::transform::translation": [
0.0,
0.0,
0.0
],
"ambient_core::rendering::local_bounding_aabb": {
"min": [
-1.0811033,
-1.0372646,
-3.4949076
],
"max": [
1.1361026,
1.0,
3.4353137
]
},
"ambient_core::model::pbr_renderer_primitives_from_url": [
{
"mesh": "../meshes/Cube_0_0.mesh",
"material": "../materials/Material_0.json",
"lod": 0
}
]
}
}
The problem might be here: https://github.com/AmbientRun/Ambient/blob/main/crates/model/src/model.rs#L553 (Since it's only got one child this will be processed as a single-entity model).
Path forward:
Image of model as viewed in 'Windows 3D Viewer' as well as Blender, Godot:
Image of model imported into Ambient via model_from_url or prefab_from_url:
In Blender, the problem is clear: The model's vertices are being imported, but not its transform data.
See import:
See import with scale set to 1, 1, 1: