Skybox stretching texture

So I know I’m not the only one in skybox hell when it comes to Unreal, but I’ve read through a bunch of the other threads asking similar questions and thanks to those I’ve managed to get the texture quality itself up to par (nomipmaps to stop detail loss, double checked to make sure the textures were below 4096x4096, etc). The thing I can’t seem to figure out is why applying the texture to the skybox seems to be stretching it? Or maybe it’s a scaling problem. So the texture I have is this:

As you can see, the stars all look nice enough. There was a little loss in detail, but spacescape’s images are just way too high resolution. I’m satisfied with this.

For the skybox, it’s just a static mesh using the SM_Skysphere and I apply the texture to it.

But when I put it in the level itself, it’s almost like I’ve put it through a zoom-in effect. The material itself looks really nice in the editor. I thought it might be a scaling problem, but even when I set the scale to 1-1-1 just to take a look, it still seems to stretch everything.

It doesn’t look BAD, per se but it’s definitely stretched/scaled/zoomed whatever. In the material editor, it looks much crisper (and the stars smaller)

Is this just how the engine renders it? I would understand if it was because I had scaled it up, but even when I set it to the default it’s still sort of “zoomed-in”. Compare the above sphere in the material editor to the unscaled skybox when I drop it into the level:

If this is just a limitation of the engine, I’ll just have to deal with it but I feel like I’m missing something very simple here.

Did you find a solution for this? I am having the same problem.

Unfortunately, no. I thought perhaps for some reason it might have been the skysphere itself doing some funky business, so I dragged in a plain old Sphere object (just the basic sphere) and put the space material on it and I got the same result.

Since in the material editor (which previews the material on a sphere) the texture is high quality and crisp, I think it’s just how the engine is rendering it in game. Which is even more confusing because just to make sure I RAMPED up the material and texture quality settings and still nothing. I’m utterly stumped. It’s not a problem of my texture being low-res (which a lot of the other threads were struggling with), it’s that Unreal does not want to use it as is in the game itself. I’m not sure why it scales everything up. Those stars in my screenshot are literally a one or two pixel wide. I opened it up in photoshop to check. And when I apply the material, it looks worse because that single pixel is being stretched.

Aaaand here’s the most annoying part. Unreal gives you the option to use a preview mesh in the Material Editor so you can see what it looks like applied to an object before you actually stick it in game. I used the EditorSkysphere and it looks GREAT…in the editor. Now I’m just baffled.

When I used cubemap or HDRI, my sky would zoom in, the stars would be zoomed up close and blurred. I decided to save it as a Jpeg checking my texture size was 4096 by 2048 and reimported It seems to work a little better, I got rid of the zooming however, still a little bit of stretching. I will continue playing with settings and troubleshooting. If I do find the solution I will update you on here.

Did you get it to wrap properly as a single JPG image? I tried stitching my images together to make it a single image but I’m probably just crap at photo manips. You can tell where the edges don’t line up properly (the nebula looks a little off in that area) I tried HDRI as well and had the same issue. But you are right that the JPG version doesn’t have the zoom problem.

Which means that Unreal can’t use cubemaps properly?? That just seems silly considering how many 3D modeling applications use them.

It did wrap properly, I converted the HDR map to Jpeg in photoshop, Probably has something to do with the blueprint or the set up. We must be doing something wrong. Hopefully I will get to the bottom of it, or someone else will before me.

So, whats happening is Unreal is limiting each texture quadrant size to 512x512.

Basically, you are going to need to change your method of creating your sky. You’ll likely need to either go procedural, or find a different way to map your sky to a mesh using UVs instead. That way you’ll be able to import a nice high res image at least.

Best of luck!

Seriously? That seems rather silly considering how many 3D modeling programs allow the use of cubemaps for modeling, for things from skyboxes to skin textures. None of those are going to be 512x512. If it were easy to procedurally generate the starry night sky, I would have done that. And what about hand-painted sky textures then? Not everyone’s going to be using a bunch of real-life photo source HDR images. The only thing I can think of now is to use the reflection capture since it generates its own cubemap and that just sounds needlessly complicated.

For a supposedly professional engine there’s some unintuitive stuff. Even Unity generates skyboxes from cubemaps with no issue.

Ok, so way back in March of last year, someone else asked regarding a similar issue and the whole 512x512 clamping issue came up there:

Where Unreal said it basically a code problem that they planned on fixing eventually.

Fast forwards a year and apparently it’s still a thing. I understand that UE wants people to use HDR mostly for ambient cubemaps now but I don’t see why that should be a reason to FORCE the issue by automatically clamping the size during the import process. At least give other people the option to use cubemaps for their skyboxes. Some types of skies are easier to procedurally generate, like the day sky with some clouds in the Content Examples. Some…really, really not so much. And it also takes out the option of artists creating their own hand-painted skies as well.

For now, I’m going to dig through the source files and see if I can find this mysterious .cpp file that the others in the thread found that controls the clamping and ramp it up to 1024 or 2048 (since luckily I’m not using cubemaps for anything else in my game at the moment) but this is such a convoluted solution.

And there are no tutorials on how to create procedural skyboxes either that I can find. Or at least, no complete ones.

So I hard coded the max size to 2048 (my texture is actually a bit smaller but in case I use a larger on later) and unfortunately didn’t see any change.

Ah, ok. I only have DDS files (not an HDR map unfortuantely) so I’m going to go dig up a converter for that and see if it helps for me as well. Here’s hoping

Sorry, but could you post a picture with your material set up? I tried converting it to JPG and using that instead but instead of getting it to wrap around the sphere, it ended up mirroring like this

42282-purplenebulacross2.png

So after uninstalling and reinstalling the Nvidia plugin and trying again, it seems that UE is letting me import larger files finally, so it might have been a problem. The other cubemap generator I was using still gets forcibly clamped for some odd reason. As it turns out, you can go into the Compression tab in the editor and manually set the texture size, which solves the second problem.

DDS files take forever to import though.