# Doubt as inverted texture

**URL:** https://forum.babylonjs.com/t/doubt-as-inverted-texture/11737
**Category:** Questions
**Created:** [June 16, 2020, 3:10am UTC](https://forum.babylonjs.com/t/doubt-as-inverted-texture/11737 "2020-06-16T03:10:58Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![gilberto\_barbosa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gilberto_barbosa/32/4399_2.png) [@gilberto\_barbosa](https://forum.babylonjs.com/u/gilberto_barbosa)
#### Post date: [June 16, 2020, 3:10am UTC](https://forum.babylonjs.com/t/doubt-as-inverted-texture/11737/1 "2020-06-16T03:10:58Z")

</div>

i have loaded OBJ with a material like 🙂

```
    BABYLON.SceneLoader.LoadAssetContainer("models/raptor/", "raptor.obj", scene, function (_container) {
            player_meshes = _container.meshes;
           
            
            let myMaterial = new BABYLON.StandardMaterial("mat_raptor", scene);

            myMaterial.diffuseTexture = new BABYLON.Texture("models/raptor/Raptor_Albedo2.PNG", scene);
            myMaterial.invertNormalMapX = true; 
            //myMaterial.invertNormalMapY = true;
            //myMaterial.bumpTexture = new BABYLON.Texture("models/raptor/Raptor_NormalMap.PNG", scene);

            //meshes[0].material = myMaterial;
            player_meshes[1].material = myMaterial;
            player_meshes[1].setParent(player_meshes[0]);
            player_meshes[2].setParent(player_meshes[0]);
            player_meshes[3].setParent(player_meshes[0]);
            player_meshes[4].setParent(player_meshes[0]);
            player_meshes[5].setParent(player_meshes[0]);
            player_meshes[6].setParent(player_meshes[0]);
            player_meshes[7].setParent(player_meshes[0]);
            player_meshes[8].setParent(player_meshes[0]);
            player_meshes[9].setParent(player_meshes[0]);
            

            // Adds all elements to the scene
            _container.addAllToScene();
            ready_play=true;
        });

```

but

 ![erty](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/3/3da8e6545956edaf3e0aded175b263e469445ee9.jpeg)

in blender is correctly

i tried

myMaterial.invertNormalMapX = true;  
myMaterial.invertNormalMapY = true;

myMaterial.invertX = true;

---

<div class="post-metadata">

### Author: ![JohnK](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/johnk/32/26764_2.png) [@JohnK](https://forum.babylonjs.com/u/JohnK)
#### Post date: [June 16, 2020, 10:15am UTC](https://forum.babylonjs.com/t/doubt-as-inverted-texture/11737/2 "2020-06-16T10:15:29Z")

</div>

Hi @gilberto_barbosa try

```javascript
scene.useRightHandedSystem = true

```

as Babylon.s is a left handed system by default.

---

<div class="post-metadata">

### Author: ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)
#### Post date: [June 16, 2020, 12:54pm UTC](https://forum.babylonjs.com/t/doubt-as-inverted-texture/11737/3 "2020-06-16T12:54:49Z")

</div>

I only ever inverted on Y, when I was creating KTX files. I have no doubt that these are working. Inverting Y has them right side up, & inverting X has them backwards. Think all you should need to do is stop inverting X.

---

<div class="post-metadata">

### Author: ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)
#### Post date: [June 16, 2020, 6:19pm UTC](https://forum.babylonjs.com/t/doubt-as-inverted-texture/11737/4 "2020-06-16T18:19:00Z")

</div>

Is your texture a .dds texture?

I had some problems lately with dds texture that was displayed inverted whatever I did and converting them to .png “fixed” the problem.

---

<div class="post-metadata">

### Author: ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)
#### Post date: [June 16, 2020, 7:09pm UTC](https://forum.babylonjs.com/t/doubt-as-inverted-texture/11737/5 "2020-06-16T19:09:35Z")

</div>

Think that is because, like a ktx texture, you have to flip it on Y when it is created. He does show that they are PNG’s in the code.

---

<div class="post-metadata">

### Author: ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)
#### Post date: [June 16, 2020, 7:38pm UTC](https://forum.babylonjs.com/t/doubt-as-inverted-texture/11737/6 "2020-06-16T19:38:10Z")

</div>

Even by setting the `invertY` parameter of the `Texture` constructor did not change anything:  
`invertY = false`:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/b/b3ed6f289d8b7b00ebf856c3cc737392ad14d176.jpeg)  
`invertY = true`:  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/7/7520fd71b8c1428cf7b26d8cf384f130b10675ac.jpeg)  
If using a .png instead and not setting the `invertY` parameter (so it is `true` by default):  
 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/6/6a3077120d35be48970af6e7e306c0890d0e51fd.jpeg)  
Note: if anyone wonders, it’s an asset from the game **Skyrim**

So, from these tests, it seems the .dds texture loader does not honor the `invertY = true` value, or there’s something in the .dds file that conflicts with the code…

But it is not the problem of the op, as you said he is using png textures.

[EDIT] Sorry for the OT, but if someone is coming here because of inversion problem with dds pictures: it’s because the inversion does not work for compressed textures (s3tc and such) - the `UNPACK_FLIP_Y_WEBGL = 1` gl flag does not work for such textures [/EDIT]

---

<div class="post-metadata">

### Author: ![gilberto\_barbosa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gilberto_barbosa/32/4399_2.png) [@gilberto\_barbosa](https://forum.babylonjs.com/u/gilberto_barbosa)
#### Post date: [June 16, 2020, 10:19pm UTC](https://forum.babylonjs.com/t/doubt-as-inverted-texture/11737/7 "2020-06-16T22:19:10Z")

</div>

My texture is PNG, i will try :

scene.useRightHandedSystem = true

---

<div class="post-metadata">

### Author: ![gilberto\_barbosa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gilberto_barbosa/32/4399_2.png) [@gilberto\_barbosa](https://forum.babylonjs.com/u/gilberto_barbosa)
#### Post date: [June 18, 2020, 5:09am UTC](https://forum.babylonjs.com/t/doubt-as-inverted-texture/11737/8 "2020-06-18T05:09:57Z")

</div>

> [@JohnK](#):
>
> `scene.useRightHandedSystem = true`

great:

 ![erty](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/2/2060ea70bc04a020f53e28fc0b7eb543be1eed1e.png)

---

<div class="post-metadata">

### Author: ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)
#### Post date: [June 18, 2020, 4:14pm UTC](https://forum.babylonjs.com/t/doubt-as-inverted-texture/11737/9 "2020-06-18T16:14:09Z")

</div>

I don’t know what your requirements are, but if you can use glTF, these kinds of problems will be much less likely to occur as glTF is more strict on conventions.

---

<div class="post-metadata">

### Author: ![gilberto\_barbosa](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gilberto_barbosa/32/4399_2.png) [@gilberto\_barbosa](https://forum.babylonjs.com/u/gilberto_barbosa)
#### Post date: [June 18, 2020, 9:42pm UTC](https://forum.babylonjs.com/t/doubt-as-inverted-texture/11737/10 "2020-06-18T21:42:48Z")

</div>

ok, i will think about it
