-
Notifications
You must be signed in to change notification settings - Fork 42
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
Closed
Changes from 9 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
7783e0e
Initial setup of instancing modelgroup
stevk 03b1b7b
Add a runtime comparision function between generic objects
stevk c74f5cf
Cleanup visuals of instancing models and fix bug with comparing arrays
stevk 5f1975b
Add model for instancing an image
stevk c1cf803
Merge remote-tracking branch 'upstream/master' into instancing
stevk 6547413
Fix another bug with comparing arrays
stevk eb9612a
Cleanup some state models
stevk bfa4148
Cleanup ObjectEqual function
stevk 5ad6ed4
Fix bug with null check
stevk 2ab1c68
Add support for instancing by checking for duplicate entries while ad…
stevk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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 not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
"translation": [ | ||
0.5, | ||
0.0, | ||
0.0 | ||
] | ||
} | ||
], | ||
"scene": 0, | ||
"scenes": [ | ||
{ | ||
"nodes": [ | ||
0, | ||
1 | ||
] | ||
} | ||
] | ||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 not shown.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.