-
-
Notifications
You must be signed in to change notification settings - Fork 79
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
add cesium ext_mesh_features #199
add cesium ext_mesh_features #199
Conversation
I can't find the code that generates the ext.MeshFeaturesMesh.g.cs file. Ideally, the PR should include the Build\ SharpGLTF.CodeGen code, so the generator and the generated code can be tracked to the same PR It is fine to modify the codegen project to either:
|
Added the schemas (see https://github.com/bertt/SharpGLTF/tree/add_cesium_ext_mesh_features/src/SharpGLTF.Cesium/EXT_mesh_features/schema), next is generating the code. |
Amended Code generation for FeatureIdTexture.
I've fixed the code generator, the field access was in the wrong method, and there's no good way of defining a default value, so I completely removed it (which I think it's the best choice) I also changed the generated class names to something less generic as "FeatureID" It's odd to me that these cesium extensions are "EXT" extensions, but I think that if they originated from Cesium they should be called something else, I don't know. Anyway, I also dislike these alternate names, they're provisional until we settle on a better naming convention. |
@@ -4,7 +4,7 @@ | |||
namespace SharpGLTF.Schema2 | |||
{ | |||
[System.Diagnostics.DebuggerDisplay("LogicalTexture[{_LogicalTextureIndex}]")] | |||
internal partial class TextureInfo | |||
public partial class TextureInfo |
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.
Must be public otherwise generated code MeshExtMeshFeatureIDTexture : TextureInfo does not compile (error: 'TextureInfo is inaccessible due to it's protection level')
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.
Must be public
I agree, as more extensions are created outside the core repository, there'll be a demand for exposing some internals.
On the current extension:
Eventually, these classes will also need constructors, specialised collections and probably some validation.
For example, I think "attribute" is actually an index to an Accessor, so it will probably require the same wiring used in cesium_outline.
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.
its little different, if attribute=0 then there must be a custom vertex attribute with name _FEATURE_ID_0, we can check on that
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.
To tell you the truth, I don't fully understand some of the details of this extension, specially the bit-based thing of the feature Id... and I understand the general concepts of the extension, but I haven't fully grasped all the details, so I am relying on you to flesh out this extension
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.
I've added a check for the attribute (https://github.com/vpenades/SharpGLTF/pull/199/files#diff-6ea6b6829d26c72a50a197edad04c83f6a8ada627b9bf96affb2aea89f725801R81) , some more checks to go
Adds Cesium EXT_Mesh_Features extension
Spec: https://github.com/CesiumGS/glTF/tree/proposal-EXT_mesh_features/extensions/2.0/Vendor/EXT_mesh_features
Sample using FeatureId's by custom vertex attribute see https://github.com/CesiumGS/3d-tiles-samples/blob/main/glTF/EXT_mesh_features/FeatureIdAttribute:
Sample using FeatureId's by texture see https://github.com/CesiumGS/3d-tiles-samples/blob/main/glTF/EXT_mesh_features/FeatureIdTexture