Equiangular Cube Map Projection

Hi, I’ve been trying to get Equiangular Cubemaps to work inside Unreal. You can read about this concept here. The gist of it would be it has mostly uniform pixel density, and so the quality would be consistent across the entire cubemap.

Right now, I have this material function set up to undo the distortion:




The texture used is laid out in the standard Unreal cubemap format, and then mapped onto a cube that has its UV’s placed in the 0-5 range. The result is as expected:

However there are artifacts at the edges of the cube, as the texture filtering results in the faces bleeding over each other. This isn’t a problem on actual Texture Cube assets, rather than the regular Texture I’m using, however I don’t know how I would go about applying this formula to undo the distortion on each face of a Texture Cube.

My first intuition is that the discontinuity may be caused by standard mipmapping issues when altering UV coordinates. Try setting the texture sampler to use derivatives or explicit mips so you can calculate them yourself using ddx and ddy or some other means.

I don’t think this is it, I can turn mipmapping off inside the texture itself and still get the issue. The seams are caused because of the texture filtering, using anything that isn’t nearest.


You can see how the edges bleed over each other, so when its mapped onto the cube, then some of the wrong parts come through on the edges.

I can’t say I’ve ever had issues with filtering when using discontinuous UVs, but I’ve definitely had issues with mips. That said, you could try adding a pixel or two of padding so that any filtering is happening with the right colors.

Figured it out :D!! This method uses an actual Texture Cube asset so the mip maps and filtering are done correctly, and also the texture is actually streamable as well.

I have a material function that takes in a constant (0-5) to return the UVW of a face of a cubemap:


I also apply that EAC distortion function I posted originally when feeding the Texture Coordinates in, so that everything looks proper:

I used the fast arctangent node instead of the actual one since the difference is negligible, but for accuracy you can just swap it.

The face number is gotten by using Vertex Normals:

This is the cube mesh I’m using if someone else needs it, make sure you enable High Precision UV’s on LoD 0:
ultimate cube skybox.fbx (11.8 KB)

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.