Sandbox IBL orientation incorrect?

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.

Pinging @PatrickRyan and @sebavan

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

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 (2.6 MB)

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.

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


    According to DDS Cube Map Example - Windows applications | Microsoft Docs

    The faces are written in the order: positive x, negative x, positive y, negative y, positive z, negative z

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.

2 Likes

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.

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). I’m waiting for the IBL extensions for glTF to solidify and the tools necessary to generate the right IBL before submitting another version.

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.