mirror of https://github.com/mosra/magnum.git
Browse Source
Amazing, I haven't been in this corner of the codebase for over six months but the test setup and code coverage still makes it quite straightforward to add a rather complex new feature without breaking unrelated cases or leaving certain areas completely untested.pull/168/head
8 changed files with 480 additions and 10 deletions
@ -0,0 +1,24 @@ |
|||||||
|
{ |
||||||
|
"asset": { |
||||||
|
"version": "2.0" |
||||||
|
}, |
||||||
|
"meshes": [ |
||||||
|
{ |
||||||
|
"primitives": [ |
||||||
|
{ |
||||||
|
"indices": 0 |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
], |
||||||
|
"nodes": [ |
||||||
|
{ |
||||||
|
"mesh": 0 |
||||||
|
} |
||||||
|
], |
||||||
|
"scenes": [ |
||||||
|
{ |
||||||
|
"nodes": [0] |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
@ -0,0 +1,129 @@ |
|||||||
|
{ |
||||||
|
"asset": { |
||||||
|
"version": "2.0" |
||||||
|
}, |
||||||
|
"extensionsUsed": [ |
||||||
|
"KHR_materials_unlit" |
||||||
|
], |
||||||
|
"buffers": [ |
||||||
|
{ |
||||||
|
"uri": "materials-duplicate-removed.bin", |
||||||
|
"byteLength": 108 |
||||||
|
} |
||||||
|
], |
||||||
|
"bufferViews": [ |
||||||
|
{ |
||||||
|
"buffer": 0, |
||||||
|
"byteOffset": 0, |
||||||
|
"byteLength": 36, |
||||||
|
"byteStride": 12, |
||||||
|
"target": 34962 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"buffer": 0, |
||||||
|
"byteOffset": 36, |
||||||
|
"byteLength": 36, |
||||||
|
"byteStride": 12, |
||||||
|
"target": 34962 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"buffer": 0, |
||||||
|
"byteOffset": 72, |
||||||
|
"byteLength": 36, |
||||||
|
"byteStride": 12, |
||||||
|
"target": 34962 |
||||||
|
} |
||||||
|
], |
||||||
|
"accessors": [ |
||||||
|
{ |
||||||
|
"bufferView": 0, |
||||||
|
"componentType": 5126, |
||||||
|
"count": 3, |
||||||
|
"type": "VEC3", |
||||||
|
"min": [-1, -1, 0], |
||||||
|
"max": [1, 1, 0] |
||||||
|
}, |
||||||
|
{ |
||||||
|
"bufferView": 1, |
||||||
|
"componentType": 5126, |
||||||
|
"count": 3, |
||||||
|
"type": "VEC3", |
||||||
|
"min": [-1, -1, 0], |
||||||
|
"max": [1, 1, 0] |
||||||
|
}, |
||||||
|
{ |
||||||
|
"bufferView": 2, |
||||||
|
"componentType": 5126, |
||||||
|
"count": 3, |
||||||
|
"type": "VEC3", |
||||||
|
"min": [-1, -1, 0], |
||||||
|
"max": [1, 1, 0] |
||||||
|
} |
||||||
|
], |
||||||
|
"meshes": [ |
||||||
|
{ |
||||||
|
"primitives": [ |
||||||
|
{ |
||||||
|
"attributes": { |
||||||
|
"POSITION": 0 |
||||||
|
}, |
||||||
|
"material": 1 |
||||||
|
} |
||||||
|
], |
||||||
|
"name": "First mesh" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"primitives": [ |
||||||
|
{ |
||||||
|
"attributes": { |
||||||
|
"POSITION": 2 |
||||||
|
}, |
||||||
|
"material": 0 |
||||||
|
} |
||||||
|
], |
||||||
|
"name": "Third mesh that should get a material same as second" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"primitives": [ |
||||||
|
{ |
||||||
|
"attributes": { |
||||||
|
"POSITION": 1 |
||||||
|
}, |
||||||
|
"material": 0 |
||||||
|
} |
||||||
|
], |
||||||
|
"name": "Second mesh, unfortunately the shared verted data get duplicated" |
||||||
|
} |
||||||
|
], |
||||||
|
"materials": [ |
||||||
|
{ |
||||||
|
"pbrMetallicRoughness": { |
||||||
|
"baseColorFactor": [0.5, 0.25, 0.75, 1] |
||||||
|
}, |
||||||
|
"name": "Duplicate material, this name is preserved" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"extensions": { |
||||||
|
"KHR_materials_unlit": {} |
||||||
|
}, |
||||||
|
"name": "Unique material" |
||||||
|
} |
||||||
|
], |
||||||
|
"nodes": [ |
||||||
|
{ |
||||||
|
"mesh": 0 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"mesh": 1 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"mesh": 2 |
||||||
|
} |
||||||
|
], |
||||||
|
"scenes": [ |
||||||
|
{ |
||||||
|
"nodes": [0, 2, 1], |
||||||
|
"name": "Scene with three nodes" |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
@ -0,0 +1,103 @@ |
|||||||
|
{ |
||||||
|
"asset": { |
||||||
|
"version": "2.0" |
||||||
|
}, |
||||||
|
"buffers": [ |
||||||
|
{ |
||||||
|
"uri": "quad.bin", |
||||||
|
"byteLength": 72 |
||||||
|
} |
||||||
|
], |
||||||
|
"bufferViews": [ |
||||||
|
{ |
||||||
|
"buffer": 0, |
||||||
|
"byteOffset": 24, |
||||||
|
"byteLength": 36, |
||||||
|
"byteStride": 12, |
||||||
|
"target": 34962 |
||||||
|
} |
||||||
|
], |
||||||
|
"accessors": [ |
||||||
|
{ |
||||||
|
"bufferView": 0, |
||||||
|
"componentType": 5126, |
||||||
|
"count": 3, |
||||||
|
"type": "VEC3", |
||||||
|
"min": [-1, -1, 0], |
||||||
|
"max": [1, 1, 0] |
||||||
|
} |
||||||
|
], |
||||||
|
"meshes": [ |
||||||
|
{ |
||||||
|
"name": "First mesh", |
||||||
|
"primitives": [ |
||||||
|
{ |
||||||
|
"attributes": { |
||||||
|
"POSITION": 0 |
||||||
|
}, |
||||||
|
"material": 1 |
||||||
|
} |
||||||
|
] |
||||||
|
}, |
||||||
|
{ |
||||||
|
"name": "Second mesh, unfortunately the shared verted data get duplicated", |
||||||
|
"primitives": [ |
||||||
|
{ |
||||||
|
"attributes": { |
||||||
|
"POSITION": 0 |
||||||
|
}, |
||||||
|
"material": 0 |
||||||
|
} |
||||||
|
] |
||||||
|
}, |
||||||
|
{ |
||||||
|
"name": "Third mesh that should get a material same as second", |
||||||
|
"primitives": [ |
||||||
|
{ |
||||||
|
"attributes": { |
||||||
|
"POSITION": 0 |
||||||
|
}, |
||||||
|
"material": 2 |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
], |
||||||
|
"materials": [ |
||||||
|
{ |
||||||
|
"name": "Duplicate material, this name is preserved", |
||||||
|
"pbrMetallicRoughness": { |
||||||
|
"baseColorFactor": [0.5, 0.25, 0.75, 1] |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"name": "Unique material", |
||||||
|
"extensions": { |
||||||
|
"KHR_materials_unlit": {} |
||||||
|
} |
||||||
|
}, |
||||||
|
{ |
||||||
|
"name": "Duplicate material, this name in't preserved", |
||||||
|
"pbrMetallicRoughness": { |
||||||
|
"baseColorFactor": [0.5, 0.25, 0.75, 1] |
||||||
|
} |
||||||
|
} |
||||||
|
], |
||||||
|
"nodes": [ |
||||||
|
{ |
||||||
|
"mesh": 0, |
||||||
|
"name": "First" |
||||||
|
}, |
||||||
|
{ |
||||||
|
"mesh": 2 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"mesh": 1 |
||||||
|
} |
||||||
|
], |
||||||
|
"scenes": [ |
||||||
|
{ |
||||||
|
"nodes": [0, 2, 1], |
||||||
|
"name": "Scene with three nodes" |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
@ -0,0 +1,16 @@ |
|||||||
|
{ |
||||||
|
"asset": { |
||||||
|
"version": "2.0" |
||||||
|
}, |
||||||
|
"nodes": [ |
||||||
|
{} |
||||||
|
], |
||||||
|
"scenes": [ |
||||||
|
{ |
||||||
|
"nodes": [0] |
||||||
|
}, |
||||||
|
{ |
||||||
|
"nodes": [0] |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
Loading…
Reference in new issue