# Handling texture coordinates across different platforms in BabylonNative

**URL:** https://forum.babylonjs.com/t/handling-texture-coordinates-across-different-platforms-in-babylonnative/55278
**Category:** Questions
**Tags:** texture, babylon-native, cubetexture
**Created:** [December 9, 2024, 6:54pm UTC](https://forum.babylonjs.com/t/handling-texture-coordinates-across-different-platforms-in-babylonnative/55278 "2024-12-09T18:54:17Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![kmatzen](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kmatzen/32/42356_2.png) [@kmatzen](https://forum.babylonjs.com/u/kmatzen)
#### Post date: [December 9, 2024, 6:54pm UTC](https://forum.babylonjs.com/t/handling-texture-coordinates-across-different-platforms-in-babylonnative/55278/1 "2024-12-09T18:54:17Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)
#### Post date: [December 9, 2024, 8:41pm UTC](https://forum.babylonjs.com/t/handling-texture-coordinates-across-different-platforms-in-babylonnative/55278/2 "2024-12-09T20:41:44Z")

</div>

cc [@BabylonNative](https://forum.babylonjs.com/groups/babylonnative)

---

<div class="post-metadata">

### Author: ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)
#### Post date: [December 10, 2024, 9:04am UTC](https://forum.babylonjs.com/t/handling-texture-coordinates-across-different-platforms-in-babylonnative/55278/4 "2024-12-10T09:04:19Z")

</div>

Hi @kmatzen

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

> <https://github.com/BabylonJS/BabylonNative/blob/6f8f211d7ddf89b9ec9f622701b9feb36654fa1b/Plugins/NativeEngine/Source/NativeEngine.cpp#L945>

And it’s also flipped when preparing image

> <https://github.com/BabylonJS/BabylonNative/blob/6f8f211d7ddf89b9ec9f622701b9feb36654fa1b/Plugins/NativeEngine/Source/NativeEngine.cpp#L253>

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