-
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
Ways for using more data types: int64_t, uint64_t, double, half-float... #2216
Comments
glTF accessors are used to access mesh, joint, and animation data, so their types are limited to these use cases. A custom extension may start with overriding the list of allowed On the other hand, a regular combination of |
From a bird's eye perspective, I fully agree. I think that the lack of (Of course, people would then ask for support of further data types (like So right now, the support for additional |
Thanks, I didn't know about However, from the comment by @lexaknyazev I just learnt that extensions can modify the list of entries allowed for a given field (such as Another problem: if your extension adds new allowable entries to |
JSON Schema for An alternative approach would be to extend accessor objects in general. The extension object would contain pointers to Both options have their pros and cons.
In case of |
Thanks a lot!!! With this I think I have everything that I need for start working. I'm going to close this issue, but if you think it should be kept open, or if you think a new one should be created as a feature request of adding support in accessors for all OpenGL types, just feel free to do so. |
@cesss Have you finished writing the extension proposal? I'd be very interested in an extension that allows |
I really love glTF, and I consider it one of the hugest achievements in CG history. But I'm facing now an obstacle in my use case, and it's that I'd like it to store values in more data types.
I tend to believe that this shouldn't affect JSON sections, as JSON is very permissive in number datatypes, and you could basically throw whatever data type you wish in a JSON value. But it affects buffers and accessors, because the allowed data types are limited by the glTF 2.0 spec.
I'd basically wish to have all the C standard data types at my fingertips:
int8_t
,uint8_t
,int16_t
,uint16_t
,int32_t
,uint32_t
,int64_t
,uint64_t
,float
, anddouble
. And considering how useful 16bit half-floats are in OpenGL, I'd like to havehalf
floats too.From that set, glTF buffers already support 32-bit
float
, as well as the 8 bit and 16 bit integer variants (32 bit too but only as unsigned, and only for indices IIRC -thus, you cannot define 32bit/channel images).Now, because I'm the kind of person who likes to start doing things just right now, I'm thinking how I could do this without changing the spec. The obvious choice would be with an extension.
But I'm failing to find a way of writing a clean extension: the spec says that
componentType
is required in accessors. This means that if I implement my ownextComponentType
and put it inside the"extensions"
of the accessor, I will have duplicated values of the component type. Yes, I can specify that myextComponentType
overrides the standardcomponentType
, but it looks not clean at all...Do you think there could be a cleaner way for writing this extension?
The text was updated successfully, but these errors were encountered: