Sign in to follow this  
Kexikus

Cubemap orientation

Recommended Posts

I'm currently trying to figure out cubemaps.

The conversion from a simple folded cube to KotORs format is okay.

But I'm now wondering how the cubemap is "oriented" in space. Up and down are obvious but which side is "facing" north?

Any help here would be very welcome :)

Share this post


Link to post
Share on other sites

Should be simple enough to test, let's see...

In descending order: bottom / top / left / right / front / back

With directions relative to a player facing north. At least for what I tested.

  • Thanks 1

Share this post


Link to post
Share on other sites

May I ask how you tested this?

The reason why I'm wondering is that judging by Darth_Sapiens examples the order would be different:

Cubemap.png.0a580bb69f7f6bd10f2c2ed920d72e78.png

Let's say that 3 is north or front, then 4 and 2 would be switched in your order (5 and 6 are flipped by 180° here).

I tried both versions ingame (these are for sky reflections on Taris buildings) but it's really hard to tell whether or not the reflections are accurate.

Maybe that's also due to a misunderstanding on my side about how cubemaps for reflections work.

Share this post


Link to post
Share on other sites

I just made a cube map with a different color on each side, then applied it to a cube and looked at how each face changed relative to the viewing angle.

That picture looks consistent with my testing. I think you've got it flipped around in your head. Your building and the cube map have opposite texture wrapping. If it helps, imagine the cube map is being wrapped onto the skybox rather than the building. The map is then drawn on each part of the building that's facing that part of the skybox.

If you mapped the cube map onto a cube, then you would indeed get two faces swapped, similar to how you get a left/right flip with a reflection in a mirror.

  • Thanks 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this