Dynamically setting `invertY` property on Texture if ktx load falls back to png


We have a situation in which our KTX textures fallback to PNGs, but one is y-inverted and the other is not. When falling back, we want PNG textures not to be inverted, whereas our KTX textures should be. Currently, we are setting the private _invertY property on the texture in the onLoad callback to the Texture constructor. Obviously, this isn’t ideal.

Do you know of another way to do this? Ideally, we would make the orientation consistent across formats, but being able to do it in code will save us some time and headache.


Well this seems to be the best option so far :slight_smile: (or to set the texture.scaleV = -1 ?)

1 Like

Thanks @deltakosh. It turns out setting texture.vScale = -1 is a lot faster than setting _invertY.

1 Like