-
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
Texture.type and Texture.format should be Image.type and Image.format #640
Comments
Loosely, glTF Moving |
Imho, current layout seems to be well aligned with API calls especially considering possible future support for more traditional texture formats. Having |
Why should it? A texture has a reference to an image which points to the image uri. Where do you see an issue with getting image type and format as well as the pixel bytes from the same place?
Sorry, in both cases I am not getting the relevance of your arguments, in fact quite the opposite. Whenever any data should go into a glTexture the data must inform GL about its type and format. Otherwise you constraint the data sources to exactly one type and format. Quite inflexible in particular with streaming, isn't it? Btw, a side question, is glTF still supposed to work with desktop GL and Vulkan or are you going straight for webGL only? |
glTF 1.0 was initially designed around WebGL 1.0 API (with a few exceptions). It was even called WebGLTF some time ago.
I think the main issue here is WebGL 1.0 workflow with web image formats (JPG, PNG): All processing is done by browser and JavaScript runtime doesn't even need to know image dimensions to upload texture data.
Again, WebGL 1.0 limitations: Nevertheless, I admit that decoupling actual pixel format from texture storage is worth considering in the context of upcoming WebGL 2.0 (based on ES 3.0) with |
I didn't know that, however this is the description of the repository:
Same as above, I wasn't aware of that fact and now I see your reason but still disagree with the implementation. Your decision seems to be comfortable for WebGL and that only because its (current) limitations but will lead to issues with other APIs in the long run. |
@lexaknyazev is this worth considering for a future spec version? |
This will be covered by the upcoming texture transmission extension and/or API-specific extensions (probably separately during draft stage, can't say anything specific). |
Closing, since further texture transmission will be covered by CTTF/KTX2. |
Sorry if this was pointed out already, I could not find any issue describing it.
The function
glTexImage2D
creates a Texture object ofTexture.internalFormat
AND (if last parameterdata
is not null) uploads image pixel data ofImage.type
andImage.format
converting the data intoTexture.internalFormat
while uploading.Is there any reason for mixing the semantics which I am not able to see?
The text was updated successfully, but these errors were encountered: