Handling texture coordinates across different platforms in BabylonNative

If I construct a RawTexture on OpenGL in BabylonNative or in the browser with BabylonJS, the texture appears to be interpreted according to OpenGL texture coordinate conventions, whereas the same code with D3D11 or Metal in BabylonNative interprets it flipped as is the convention with those platforms. I took a look and saw that NativeEngine delegates the texture data upload directly to bgfx without conversion. Is there a utility function that BabylonNative provides so that I can write clean cross platform code without manually checking which graphics platform is in use and flipping textures myself?

cc @BabylonNative

Hi @kmatzen

Texture is flipped vertically when rendering. UV Tex coord is flipped when sampling textures.

And it’s also flipped when preparing image

So, it should be transparent for most usages. Can you please elaborate or provide a PG that highlights your issue?

2 Likes