Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instancing Model Group #424

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Output/Instancing/Instancing_00.bin
Binary file not shown.
136 changes: 136 additions & 0 deletions Output/Instancing/Instancing_00.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
{
"accessors": [
{
"bufferView": 0,
"componentType": 5126,
"count": 3,
"type": "VEC3",
"max": [
0.5,
0.5,
0.0
],
"min": [
-0.5,
-0.5,
0.0
],
"name": "Positions Accessor"
},
{
"bufferView": 1,
"componentType": 5125,
"count": 3,
"type": "SCALAR",
"name": "Indices Accessor"
},
{
"bufferView": 2,
"componentType": 5126,
"count": 3,
"type": "VEC3",
"max": [
0.5,
0.5,
0.0
],
"min": [
-0.5,
-0.5,
0.0
],
"name": "Positions Accessor"
},
{
"bufferView": 3,
"componentType": 5125,
"count": 3,
"type": "SCALAR",
"name": "Indices Accessor"
}
],
"asset": {
"generator": "glTF Asset Generator",
"version": "2.0"
},
"buffers": [
{
"uri": "Instancing_00.bin",
"byteLength": 96
}
],
"bufferViews": [
{
"buffer": 0,
"byteLength": 36,
"name": "Positions"
},
{
"buffer": 0,
"byteOffset": 36,
"byteLength": 12,
"name": "Indices"
},
{
"buffer": 0,
"byteOffset": 48,
"byteLength": 36,
"name": "Positions"
},
{
"buffer": 0,
"byteOffset": 84,
"byteLength": 12,
"name": "Indices"
}
],
"meshes": [
{
"primitives": [
{
"attributes": {
"POSITION": 0
},
"indices": 1
}
]
},
{
"primitives": [
{
"attributes": {
"POSITION": 2
},
"indices": 3
}
]
}
],
"nodes": [
{
"mesh": 0,
"translation": [
-0.5,
0.0,
0.0
]
},
{
"mesh": 1,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the mesh is not instanced here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, this is an issue. I could make a short term fix by removing the indices from both meshes, otherwise this will require the same solution needed by other models with properties added to the buffer.

"translation": [
0.5,
0.0,
0.0
]
}
],
"scene": 0,
"scenes": [
{
"nodes": [
0,
1
]
}
]
}
Binary file added Output/Instancing/Instancing_01.bin
Binary file not shown.
165 changes: 165 additions & 0 deletions Output/Instancing/Instancing_01.gltf
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
{
"accessors": [
{
"bufferView": 0,
"componentType": 5126,
"count": 3,
"type": "VEC3",
"max": [
0.5,
0.5,
0.0
],
"min": [
-0.5,
-0.5,
0.0
],
"name": "Positions Accessor"
},
{
"bufferView": 1,
"componentType": 5126,
"count": 3,
"type": "VEC2",
"name": "UV Accessor 0"
},
{
"bufferView": 2,
"componentType": 5125,
"count": 3,
"type": "SCALAR",
"name": "Indices Accessor"
},
{
"bufferView": 3,
"componentType": 5126,
"count": 3,
"type": "VEC3",
"max": [
0.5,
0.5,
0.0
],
"min": [
-0.5,
-0.5,
0.0
],
"name": "Positions Accessor"
},
{
"bufferView": 4,
"componentType": 5126,
"count": 3,
"type": "VEC2",
"name": "UV Accessor 0"
},
{
"bufferView": 5,
"componentType": 5125,
"count": 3,
"type": "SCALAR",
"name": "Indices Accessor"
}
],
"asset": {
"generator": "glTF Asset Generator",
"version": "2.0"
},
"buffers": [
{
"uri": "Instancing_01.bin",
"byteLength": 144
}
],
"bufferViews": [
{
"buffer": 0,
"byteLength": 36,
"name": "Positions"
},
{
"buffer": 0,
"byteOffset": 36,
"byteLength": 24,
"name": "Texture Coords 0"
},
{
"buffer": 0,
"byteOffset": 60,
"byteLength": 12,
"name": "Indices"
},
{
"buffer": 0,
"byteOffset": 72,
"byteLength": 36,
"name": "Positions"
},
{
"buffer": 0,
"byteOffset": 108,
"byteLength": 24,
"name": "Texture Coords 0"
},
{
"buffer": 0,
"byteOffset": 132,
"byteLength": 12,
"name": "Indices"
}
],
"images": [
{
"uri": "Textures/Normal_Plane.png"
}
],
"materials": [
{
"normalTexture": {
"index": 0
}
}
],
"meshes": [
{
"primitives": [
{
"attributes": {
"POSITION": 0,
"TEXCOORD_0": 1
},
"indices": 2,
"material": 0
},
{
"attributes": {
"POSITION": 3,
"TEXCOORD_0": 4
},
"indices": 5,
"material": 0
}
]
}
],
"nodes": [
{
"mesh": 0
}
],
"scene": 0,
"scenes": [
{
"nodes": [
0
]
}
],
"textures": [
{
"source": 0
}
]
}
Binary file added Output/Instancing/Instancing_02.bin
Binary file not shown.
Loading