You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
donmccurdy
changed the title
[Feature] Support per-texture transforms in KHR_texture_transform
[Feature] glTF: Support per-texture transforms in KHR_texture_transform
Mar 25, 2024
For reference, the full implementation can get verbose, especially with support for the various KHR_materials_* extensions and their textures. three.js handles this by compiling shader variants:
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: