by JPL » Mon May 21, 2018 9:03 pm
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.
[quote="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 [url=https://doomwiki.org/wiki/File:E4M6Courtyard.png]E4 sky[/url], that would be helpful too as that's what I'm aiming at).[/quote]
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.