KhronosGroup / KhronosGroup/glTF
use mesh primitive for submesh use
- Dominant language
- HTML
- Stars
- 7.8k
- Forks
- 1.2k
- Avg merge
- 17h 26m
- Merged PRs (30d)
- 5
Description
I think it is better to use mesh primitives for `submesh`.
`submesh` assumes the following call, for example:
```c
// pseudocode
setVBOandIBO (mesh);
var offset = 0;
foreach (var submesh: submeshes)
{
setMaterial (submesh.material);
gl.drawElements (sbumesh.mode, submesh.count, mesh.indicesType, offset);
offset + = submesh.count;
}
```
submesh is a range of indices (offset, count), with material as a specific parameter.
Relatedly, in many apps, Blender and Unity, MorphTarget is per mesh, not per submesh. It is more convenient if targets are on mesh.
In order to use the mesh primitive for `submesh`,
Suggest moving primitive.indices, primitive.attributes, primitive.targets to mesh.
Also add offset and count to the primitive.
Also, change node.mesh to node.meshes.
#1278
Contributor guide
Research direction
Review related issue #1278 and the current definitions of mesh, submesh, node.mesh, primitive.indices, primitive.attributes, and primitive.targets. Compare the proposed ownership and range changes with the rendering assumptions shown in the example. Done means the schema change is fully specified and its compatibility implications are resolved.
Written by the indexing model from the issue text.
Assessment
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100