I'm using the gltf-json crate for this job. I want to be able to change the normal texture scale to [1, -1] to an asset that comes with [1, 1], however, the scale field is of type f32.
pub struct NormalTexture {
pub index: Index<Texture>,
pub scale: f32,
pub tex_coord: u32,
pub extensions: Option<NormalTexture>,
pub extras: Extras,
}
Does anyone know if there's a workaround for this?
This is based in the glTF specification, which requires a scalar value for
material.normalTextureInfo.scale. No valid tool will be able to work around that, other than writingextrasor a custom extension to the file.An aside, I would note that depending on the client loading this file, the correct client interpretation of
scale = 1might turn out to be[1, -1], based on the UV conventions of the engine, presence of vertex tangents, etc. This occurs in the three.js glTF loader, for example.