Skip to content
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 transform is not written for property textures #88

Open
javagl opened this issue Dec 19, 2023 · 1 comment
Open

Texture transform is not written for property textures #88

javagl opened this issue Dec 19, 2023 · 1 comment

Comments

@javagl
Copy link
Contributor

javagl commented Dec 19, 2023

The block at

const basicTextureDef = context.createTextureInfoDef(texture, textureInfo);
(or the corresponding block in the state after merging #64 ) has to be replaced with a block like this, which also contains some information about what went wrong there:

    // The 'textureInfoDef' that is created here will be stored 
    // by glTF-Transform internally. If there are extensions for
    // this object (e.g. a KHR_texture_transform extension), then
    // the extension information will be added to THE exact object.
    // Creating and returning a new object here would cause this
    // information to be omitted. So the object that is returned here
    // has to be THE exact object that was created internally, but
    // extended with the structural metadata extension information.
    const basicTextureDef = context.createTextureInfoDef(texture, textureInfo);
    const propertyTexturePropertyDef = basicTextureDef as any; 
    propertyTexturePropertyDef.channels = propertyTextureProperty.getChannels();
    propertyTexturePropertyDef.offset = propertyTextureProperty.getOffset();
    propertyTexturePropertyDef.scale =  propertyTextureProperty.getScale();
    propertyTexturePropertyDef.max =  propertyTextureProperty.getMax();
    propertyTexturePropertyDef.min =  propertyTextureProperty.getMin();
    return propertyTexturePropertyDef as PropertyTexturePropertyDef;
@javagl
Copy link
Contributor Author

javagl commented Jan 29, 2024

The proposed snippet will not resolve the issue. There's a deeper, darker issue lurking beneath that. After some investigation, I opened donmccurdy/glTF-Transform#1256 , to sort out where and how this issue has to be handled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant