# Sandbox IBL orientation incorrect?

**URL:** <https://forum.babylonjs.com/t/sandbox-ibl-orientation-incorrect/3982>\
**Category:** Bugs\
**Created:** [June 18, 2019, 9:10pm UTC](https://forum.babylonjs.com/t/sandbox-ibl-orientation-incorrect/3982 "2019-06-18T21:10:17Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![echadwick-artist](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/echadwick-artist/32/41009_2.png) [@echadwick-artist](https://forum.babylonjs.com/u/echadwick-artist)\
**Post date:** [June 18, 2019, 9:10pm UTC](https://forum.babylonjs.com/t/sandbox-ibl-orientation-incorrect/3982/1 "2019-06-18T21:10:17Z")

</div>

In the sandbox, IBLs are oriented looking at the +X cube face. But I thought the default “front” angle was supposed to be looking at the +Y cube face?

I found a bug report about this earlier, but now I can’t seem to find it. Might not have been here. They referenced how other programs seem to align on their standards, different from the way the Sandbox works. Marmoset, Blender, etc.

I find if I rotate the Sandbox skybox 135 on Y, then I’m seeing +Y. But I wonder if this should be the default?

Edit: a standardized orientation would help us in our testing here, since we use Sandbox regularly for testing, using drag-n-drop to add our own ENV file.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [June 18, 2019, 9:12pm UTC](https://forum.babylonjs.com/t/sandbox-ibl-orientation-incorrect/3982/2 "2019-06-18T21:12:17Z")

</div>

Pinging @PatrickRyan and @sebavan

---

<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:** [June 18, 2019, 9:37pm UTC](https://forum.babylonjs.com/t/sandbox-ibl-orientation-incorrect/3982/3 "2019-06-18T21:37:52Z")

</div>

Adding @bghgary who added it for GLTF and see where we chose the default from ?

---

<div class="post-metadata">

**Author:** ![echadwick-artist](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/echadwick-artist/32/41009_2.png) [@echadwick-artist](https://forum.babylonjs.com/u/echadwick-artist)\
**Post date:** [June 18, 2019, 9:58pm UTC](https://forum.babylonjs.com/t/sandbox-ibl-orientation-incorrect/3982/4 "2019-06-18T21:58:28Z")

</div>

Test assets

1. Drag-n-drop the GLB into Sandbox.
2. Drag-n-drop the ENV into Sandbox.
3. Display Inspector
4. Scene Explorer \> Textures \> choose the 2nd cubemap (it’s the skybox).
5. Inspector \> Properties \> General \> Sampling = Nearest & Linear. (so we can see the skybox clearly).

> > Notice we’re looking at +X.

1. Drag mouse left, then we see +Y in the skybox. That should probably be the default angle? Needs to be researched and confirmed. This is at least the default view when I load the PNG in 3ds Max. Not sure about other apps.

> > Notice the PX/NX/PY/NY/PZ/NZ Preview images at top right are incorrectly assigned. PX = +Y cube face which is also flipped horizontally. Etc.

[Cubemap\_Test\_Axes.zip](https://forum.babylonjs.com/uploads/short-url/wUqJFRzpB01qwuJuL97AR3GWgnO.zip) (2.6 MB)

---

<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 19, 2019, 12:45am UTC](https://forum.babylonjs.com/t/sandbox-ibl-orientation-incorrect/3982/5 "2019-06-19T00:45:29Z")

</div>

> [@echadwick-artist](#):
>
> They referenced how other programs seem to align on their standards, different from the way the Sandbox works. Marmoset, Blender, etc.

Can you elaborate on this?

@PatrickRyan and I looked into this:

1. First, the typical convention with Lat/Lon panorama being converted to a cubemap is that the front face is the center of the image. You can see this with Lys that the front is currently -Y. I would expect the front to be +Z. See [Cube mapping - Wikipedia](https://en.wikipedia.org/wiki/Cube_mapping#Memory_addressing).

2. The DDS also has the incorrect conventions, probably because the source has the wrong conventions.

Perhaps you are using the coordinate system from Max (+Y forward, +Z up)? That doesn’t translate to DDS cubemap which has a specific convention.

---

<div class="post-metadata">

**Author:** ![echadwick-artist](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/echadwick-artist/32/41009_2.png) [@echadwick-artist](https://forum.babylonjs.com/u/echadwick-artist)\
**Post date:** [June 19, 2019, 9:11pm UTC](https://forum.babylonjs.com/t/sandbox-ibl-orientation-incorrect/3982/6 "2019-06-19T21:11:13Z")

</div>

Yep, I’m most likely wrong! No worries. I’ll do some more testing here.

I found the thread I was looking for. Not about BabylonJS Sandbox, it’s about the Khronos Ref Viewer. Might provide some insight though.

> <https://github.com/KhronosGroup/glTF-Sample-Viewer/issues/213>

---

<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 20, 2019, 6:31pm UTC](https://forum.babylonjs.com/t/sandbox-ibl-orientation-incorrect/3982/7 "2019-06-20T18:31:18Z")

</div>

Yeah, the sample viewer had some issues at some point, but I believe they are all sorted out now. I still want to put a test IBL (like this [Add test environment by bghgary · Pull Request #175 · KhronosGroup/glTF-Sample-Viewer · GitHub](https://github.com/KhronosGroup/glTF-Sample-Viewer/pull/175)). I’m waiting for the IBL extensions for glTF to solidify and the tools necessary to generate the right IBL before submitting another version.

---

<div class="post-metadata">

**Author:** ![echadwick-artist](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/echadwick-artist/32/41009_2.png) [@echadwick-artist](https://forum.babylonjs.com/u/echadwick-artist)\
**Post date:** [August 19, 2019, 8:21pm UTC](https://forum.babylonjs.com/t/sandbox-ibl-orientation-incorrect/3982/8 "2019-08-19T20:21:33Z")

</div>

I was able to solve this by simply rotating my panorama rendering camera in 3ds Max, so it points the same direction as +X.

This is a bit counter-intuitive, but it works.
