-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
EXT_mesh_features: Features and Properties for structured data #2082
base: main
Are you sure you want to change the base?
EXT_mesh_features: Features and Properties for structured data #2082
Conversation
Some earlier context on the use cases this extension addresses: |
Talked with @wallabyway and others today and there were some interesting interesting takeways. There is a strong need for global feature IDs. In some systems these are 64-bit uints; after all 32-bit uints can only represent up to 4,294,967,295 discrete features and collisions could start to occur for a variety of reasons. The In order to support 64-bit IDs you'd need to store these in a property table with the An example of this might be worth including in the extension writeup. |
Good point on the UINT24 (safe float)... We render to a target buffer RGBA (using MRT) to get UINT32 featureID (equivalent), but that complicates implementation for others. Hmmm🤔 what to do? |
RE: The section in the spec on 'Schema-definitions' Is it possible to limit this spec to just a featureID and not define how the ID is used? Currently, the spec has a schema requirement, which is a bit too limiting for our AEC use-cases. Having just an featureID requirement, and not a schema definition, broadens the use for this extension. Or perhaps I mis-interpreted the "Schema-definitions" section of the spec. |
The schema definition itself is not required in the top-level extension object
I think that the case that you are referring to is already covered in the "Specifying Feature IDs" section. It says
So it is valid to say
to assign Feature IDs to the triangles of a primitive, without specifying property tables, and therefore without assigning any internal meaning to these IDs. These IDs could then be picked up and resolved externally by an application. (Maybe I overlooked some other requirement - so if there is a reason why this wouldn't be possible based on the specification, then this should indeed be clarified). |
@javagl - Ah, thank you ! I think this is worth explicitly mentioning "what you said" somewhere in the spec. ie. Basically "What you said" 'verbatim', along with your json example. |
FWIW my understanding of the spec is that this only works for un-indexed geometry. |
Yeah, if you assign a unique feature ID to each triangle like with But more often groups of triangles will have the same feature ID and you can still benefit from indexed geometry. Maybe the example should be |
@lilleyse Hmm I'd like to clarify this to make sure we're on the same page. My understanding is that using offset/repeat doesn't actually make all vertices unique by itself. What I meant is that typically in indexed geometry, there's no obvious mapping between the vertices and triangles (well, short of the index buffer). When you specify offset=0 repeat=3, my understanding of the spec is that you're taking the existing vertices - whatever the number and order - and assigning feature ids to vertices, the same one to each 3 consecutive ones. If the geometry is not indexed, this in effect will result in all 3 vertices of each triangle having a unique feature id. If the geometry is indexed, you're going to get the same mesh with the same indexing, but the feature ids are not going to map to triangles. As a positive example, imagine a tool that batches N instances of the same mesh together by transforming each instance, generating a new vertex buffer, concatenating all vertex buffers and index buffers together. E.g. gltfpack does that on request. In this case, if each mesh had V vertices and T triangles, you can specify |
@zeux yes exactly, everything you wrote is my understanding too. |
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.
Just wanted to cross-link a couple relevant issues/PRs from our end for better visibility.
} | ||
}, | ||
{ | ||
"description": "Implicit feature ID. Both 'offset' and 'repeat' are optional; 'attribute' is disallowed.", |
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.
Note that we've had some back-and-forth about the best way to describe the different types of feature IDs in JSON schema, see CesiumGS/3d-tiles#508.
The issue is that this very flexible definition of implicit feature IDs causes problems when used in this oneOf
clause, as a valid featureIdTexture
is valid here as well.
The latest update that has been integrated here separates the definition of feature IDs for elements of a glTF asset from the actual storage and structure of metadata. This extension now focusses on the definition of feature IDs for vertices and texels in a glTF asset. The definition of the structure and storage of metadata is covered with the |
This extension is already in use by published software, right? Is this ready to be merged? |
(Disclosure: I'm an independent Khronos contributor, but have been involved in the development of this extension as part of contracted (freelancer) work for Cesium. I do not speak on behalf of Khronos or Cesium here, but just try to summarize the state) Support for reading the extension is implemented in CesiumJS. Basic structures for the extension are part of I think that further reviews could be worthwhile. But as for all extension PRs, there's the question: Who of the WG could allocate the time that is necessary for that...? |
Change integer to glTFid
EXT_mesh_features
defines a means of storing structured metadata associated with geometry and subcomponents of geometry within a glTF 2.0 asset.In most realtime 3D contexts, performance requirements demand minimizing the number of nodes and meshes in an asset. These requirements compete with interactivity, as applications may wish to merge static objects while still supporting interaction or inspection on those objects. Common performance optimizations for GPU rendering — like merging geometry or GPU instancing to reduce CPU overhead — may destroy references to distinct objects, their attributes, and their behaviors.
By defining a representation of conceptual objects ("features") distinct from rendered geometry, and a means of associating structured metadata ("properties") with those features, this extension allows applications to preserve important details of 3D assets for inspection and interaction without compromising runtime performance and draw calls.
This extension will be used by embedded glTF content in 3D Tiles for loading large, tiled geospatial datasets. The extension's design is intended to be similarly useful for individual glTF 2.0 assets outside of geospatial use cases, like large AEC designs, CAD models, or photogrammetry captures.
Markdown Preview: