How to make skybox from sky texture?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.
User avatar
MartinHowe
Posts: 2111
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Linux Mint
Graphics Processor: nVidia with Vulkan support
Location: East Suffolk (UK)

How to make skybox from sky texture?

Post by MartinHowe »

Does anyone know if there is a way to make a skybox from a sky texture? Is there some algorithmic way to do it? If I understand how skboxes work, I would have thought not as it would involve finding textures for the walls and floor that (at least roughly) match the original sky texture; however I thought I'd ask.

(If somebody already knows of a skybox based on (or closely resembling) the E4 sky, that would be helpful too as that's what I'm aiming at).
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: How to make skybox from sky texture?

Post by Graf Zahl »

Since a sky texture misses most of what makes up a skybox you won't be able to produce good results. That problem aside, it requires a complete recalculation because a skybox is a projection of a 360° view onto a cube surface. I don't know if any tool exists that could do it, but I don't think so.
User avatar
MartinHowe
Posts: 2111
Joined: Mon Aug 11, 2003 1:50 pm
Preferred Pronouns: He/Him
Operating System Version (Optional): Linux Mint
Graphics Processor: nVidia with Vulkan support
Location: East Suffolk (UK)

Re: How to make skybox from sky texture?

Post by MartinHowe »

Thanks - I thought probably not :(
I'll have a look at various skyboxes people have pointed me to in the other thread and see what I can find.
User avatar
JPL
 
 
Posts: 523
Joined: Mon Apr 09, 2012 12:27 pm

Re: How to make skybox from sky texture?

Post by JPL »

MartinHowe wrote:Does anyone know if there is a way to make a skybox from a sky texture? Is there some algorithmic way to do it? If I understand how skboxes work, I would have thought not as it would involve finding textures for the walls and floor that (at least roughly) match the original sky texture; however I thought I'd ask.

(If somebody already knows of a skybox based on (or closely resembling) the E4 sky, that would be helpful too as that's what I'm aiming at).
Something I did a long time ago, unfortunately with no source file or repeatable steps to pass on, was take a static bitmap image and map it to a sphere in a 3D program, tiled it across the sphere as many times as looked good, then placed 6 square aspect cameras at the center of the (normals flipped) sphere and rendered out the usually top/bottom/front/back/left/right images. I iterated on it by editing the original image and managing the distortion across the sphere until it looked good enough.
This works a lot better with natural features like clouds and mountains, if you want rectilinear things like buildings and stuff to look good that will take more work.

There's probably a program that automates this kind of work to some extent, though the camera rig I made wasn't too tough. Getting the cameras' views' edges to line up with one another took the most fiddling but once it was done, I didn't need to touch it again.
PoptartNoahh
Posts: 36
Joined: Mon Dec 11, 2017 11:40 am

Re: How to make skybox from sky texture?

Post by PoptartNoahh »

What type of projection are you trying to make, and from what source? the doom skies are rectangular equidistant and this is enough to make a cube/gnomonic map.

Return to “Assets (and other stuff)”