-
Notifications
You must be signed in to change notification settings - Fork 184
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
[Feature] glTF: Support per-texture transforms in KHR_texture_transform #2929
Comments
For reference, the full implementation can get verbose, especially with support for the various https://github.com/mrdoob/three.js/blob/dev/src/renderers/shaders/ShaderChunk/uv_pars_vertex.glsl.js |
We may be able to detect reuse of buffers and clone them. Loaders.gl offers a way to handle certain extensions on the CPU during loading. Of course if we implement in luma.gl we don't need to rely on that and we can share buffers as intended. |
Currently the glTF
KHR_texture_transform
extension is only partially implemented by loaders.gl:https://github.com/visgl/loaders.gl/blob/master/modules/gltf/src/lib/extensions/KHR_texture_transform.ts
Unless I've misread, the implementation assumes that UV vertex attribute has at most one UV transform applied to it. But the
KHR_texture_transform
extension is more flexible, and allows per-texture transforms. For example, a particular material may have 4 textures, all sharing TEXCOORD_0, but all transforming those UVs differently. The current implementation overwrites the (shared) UVs and cannot support this.Ideally the texture transforms are passed to the material shader as uniforms, rather than overwriting the vertex attributes directly.
The following examples may be helpful in testing more complete support for the extension:
Archive.zip
Models in zip are sourced from:
The text was updated successfully, but these errors were encountered: