-
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
Improving texture support for 1.0.1+ #620
Comments
To control the scope, I suggest
Not considering this until PBR.
Not considering this until this is enough community interest.
Isn't this implicit in the ability to have different materials, each of which can have different parameters, e.g., with different resolution textures? For the remaining items, it would be good if you can provide example JSON snippets for discussion, then we can iterate and formalize them in the schema and spec. The scope may turn out to be too big for 1.0.1; keep in mind that we need to actually implement these features as well to make sure they are pragmatic and solid enough for inclusion. In general, we need to be very careful about adding too many features to glTF too soon. The community needs a reliable, consistent format that is widely supported by exporters and easy to implement importers. If we add too much complexity too early in glTF's life, we risk making the barrier-to-entry too high, and therefore, hurt adoption and consistency of implementations. |
It depends on how we treat glTF: scene format vs asset format. I think it's perfectly fine to have, e.g., simple skybox without any PBR since cubemaps are in the core OpenGL ES 2.0 spec.
I don't think so, because mesh primitive can reference only one material. So it would be an application specific approach to switch them. Anyway it's a really complex issue (meshes LoD, textures resolution/format, shaders with optional code paths via conditional preprocessor directives). I think the real question is about the glTF's mission: universal runtime format that can be used with (almost) any engine (like image/sound/video file formats as it was mentioned in glTF slides) or some sort of "building block" for a particular application. It can be something in between, of course.
Already started working on them.
I believe it's kind of a chicken-egg problem. If format doesn't provide enough functionality why should someone use glTF instead of creating a proprietary format? |
Agreed. It's just a matter of 1.0.1 spec scope and priorities. The goal of the 1.0.1 is to aid in validation; we need to be careful of feature creep.
Yes, exactly. I believe that is standard practice for many apps. Any LOD/streaming approach should first be proposed as an extension before it would go into core spec, especially a minor spec revision. In general, LOD approaches are so far and wide (for example, we built 3D Tiles on top of glTF and others are building a progressive approach).
The ecosystem: exporters, converters, optimizers, etc. glTF is also extensible so users can add content in |
First draft of texture updates proposalBase principles
Spec changes for uncompressed texturesDefine
Updates for compressed textures (
|
A few more updates on
Thoughts? |
Updates for cube mapping supportWith aforementioned changes for uncompressed and compressed texture support adding cubemaps support for such formats is as trivial as allowing It implies that Supporting cubemaps is more tricky for web formats such as JPG or PNG as Proposal: Example: {
"textures": {
"texture_0001": {
"target": 34067, // TEXTURE_CUBE_MAP
"sampler": "sampler_0",
"source": "CubeImage0001" // reference to instance of cubeImage
}
},
"cubeImages": {
"CubeImage0001": {
"sources": [ // string[6], IDs of image objects, same fixed order (-X, +X, -Y, +Y, -Z, +Z)
"CubeImage0001_NegX",
"CubeImage0001_PosX",
"CubeImage0001_NegY",
"CubeImage0001_PosY",
"CubeImage0001_NegZ",
"CubeImage0001_PosZ"
]
}
},
"images": {
"CubeImage0001_NegX": {
"uri": "negX.jpg"
},
"CubeImage0001_PosX": {
"uri": "posX.jpg"
},
"CubeImage0001_NegY": {
"uri": "negY.jpg"
},
"CubeImage0001_PosY": {
"uri": "posY.jpg"
},
"CubeImage0001_NegZ": {
"uri": "negZ.jpg"
},
"CubeImage0001_PosZ": {
"uri": "posZ.jpg"
}
}
} What do you think? |
@lexaknyazev thanks for this proposal. Questions
I know
OK. What is our reasoning for directly using
"extensions": {
"KHR_compressed_texture": {
"WEBGL_compressed_texture_s3tc": {
"internalFormat": 33776, //COMPRESSED_RGB_S3TC_DXT1_EXT
"width": 256,
"height": 256,
"bufferView": "bufferView_s3tc01"
},
"WEBGL_compressed_texture_pvrtc": {
"internalFormat": 35840, //COMPRESSED_RGB_PVRTC_4BPPV1_IMG
"width": 256,
"height": 256,
"bufferView": "bufferView_pvrtc01"
}
} Why are
Yes, I think.
Sounds good.
Will get back to you about this. |
Looks like it's still in spec and schema.
Seems fair to clarify it here, because using
Because of two format-specific limitations:
|
Addition to Mipmapping Implementation Note: |
ha. You are right. I didn't remember adding it. |
There are couple more reasons to have dimensions inside extension JSON:
|
I've two concerns about meaning of those keys and the extension structure: Names of texture compression extensions are different in WebGL and OpenGL ES. So ES runtime will have to translate them first to be able to render WebGL assets. On the other hand, making those names clear and consistent (i.e., aligning them with WebGL extension registry) seems to be a good way to achieve assets interoperability across different runtimes. It may be useful (for some specific rare cases) to provide two textures of the same compression format but with different bitrate (2bpp/4bpp). While it makes sense only for S3TC and PVRTC now, situation may change later with ASTC adoption. Again, this is a highly application specific issue, so I don't think it should be addressed here. |
OK, sounds good.
OK with me. Labeling as 1.1 to keep 1.0.1 scoped for validation. However, I am happy to keep discussing this now. |
With 1.1 we can do even more here: allow |
Can this issue be closed? |
Yeah, this is obsolete. |
List of possible issues worth considering
texture.type
has no use withoutKHR_binary_glTF
while spec & extension are in their current state.FLOAT
textures with precomputed data. EnablingOES_texture_float
&OES_texture_half_float
could be done similar to Draft of uint32 support #619.width
,height
andmimeType
fields toimage
and remove them fromKHR_binary_glTF\image
. This will serve two purposes:width
,height
and"mimeType": "application/octet-stream"
) and from embeddeddata:
URI. In the latter case, we should omitmimeType
field and use URI:data:application/octet-stream;base64,...
.KHR_binary_glTF\image
will contain onlybufferView
just likeKHR_binary_glTF\shader
.image
is both ways compatible, removing fields fromKHR_binary_glTF\image
is not. New/updated assets won't work with older versions of Cesium, so changes toKHR_binary_glTF
could be queued up for the next version to preserve compatibility.EXT_texture_filter_anisotropic
The text was updated successfully, but these errors were encountered: