Hello there, seeing as how much trouble I have had doing this I decided I will share how I made a skybox of my own. What are skyboxes?
Skyboxes are virtually a group of 6 textures that form a 3D cube around the player in the environment. These textures are 'Unlit' therefore do not take or emit light and seem to hold in the same position, even if you move freely around a map. This therefore creates an illusion of sky, or faraway objects that movement will not alter the position of the objects featured in the skybox.How do I create one?
To create one from scratch is a very difficult thing to do, especially if you want it to be fully seamless. You can find many images that are ready for skybox incorporation, however here I am going to tell you how to make a skybox from a panorama
which is virtually a long strip of landscape, but for a skybox you need one that matches one end to the other - I will tell you the importance of this later.
Firstly if you want to create a skybox out of a custom idea/place you need to first gather or create the environment. You can even make a panorama from a series of pictures of a real place, swiveled upon a tripod.
I took a series of screen shots from inside another game, this is probably one of the easier ways to create a panorama, seeing as lighting does not affect what angle you point the camera at.
If you do it this way, or the tripod way, you need to then create a long line of images (a panorama). The best way to put them together is to get into photoshop and overlap the pictures and blend the images together so they seem seamless.
Here I just put all the images, at 50% opacity so then I can see where they best match up, next I will do a bit of clone stamping, blending and transparency overlays in order to create a long strip that looks like a very long landscape, don't worry about making the ends meet exactly, I will do this a little later.
If you did take the pictures in exactly a circle, ending up where you started, then you can easily, using the same technique as above, blend the landscape together. Copy the first image from the strip and paste it to the end of your strip. When it looks right, you need a way to split the picture so then the end meets up exactly with the start. This is simply a matter of trial and error.
If you haven't done so already, merge all the layers together (or create a copy of each and then merge just in case), then select one of the ends to move directly onto a spot like so:
Then move it so then it overlaps exactly with the image on the other side Like this:
If you are using photoshop like me, right click on the part you have selected and click select inverse, then click on the intersect tool, we only need to select the side we wish to delete.
Then press delete to remove the selection so then the panorama would match exactly. In order to check this: crop the image exactly to your panorama's size, then go to the Filter menu -> Other -> Offset and move the image a hundred pixels or so, if the image seems seamless then lets move on.
Next we need to cut the panorama into 4 sections (FT, BK, LF, RT), a normal skybox would consist of 6 images 1024x1024. Your skybox can be larger or smaller depending on what resolution you have, and what power of 2.
Mine is 1024px high and 6036px wide meaning that if i was to cut it into 4 pieces (1509px), it would not be in a power of 2 (this is needed for any VTF or Valve Texture Format).
This is easily fixed by adding a strip of colour to the bottom and top so then it is 1509x1509, then just resize the image so then it is back to 1024x1024.
Make sure your horizon is exactly in the center of the image because this is the flattest part of the image.
Here I added and made up parts of the skybox to make them the size of 1024x1024.
To continue download this PSD: http://chickenmob.sqweebs.org/downloads/guide.psd
. This we will need as a template to warp the image into shape. Once that is downloaded get your four splitted images and rotate them so that the sky is facing the middle like this:
The hardest bit about making a seamless skybox is matching up the TOP and BOTTOM of the skybox, so then it doesn't look like you are inside a cube, this is easily done if you took pictures that are exact
of each angle. This can only be done in scenery makers where: the camera defines one point in a non moving world.
Since we are making it from a panorama and maybe a shot at the sky, we need to shape the squares of the cube, into more of a spherical shape.
In order to do this we need to make it into a shape that represents this:
The straight lines indicate the 'Horizon' or middle view of where players will look at. and the white dot in the center represents "straight up"
To create an illusion of a seamless skybox first we need to look at the center. Highlight the middle of 1024x1024 and go to filters. Look for distort->spherize. We want it to be about -50%.
This makes it so then it doesn't seem like the top is flat.
Paste your series of pictures in the right positions and highlight half of the landscape and using the Edit->Transform->Warp option get it so then it matches the edges of the circle (the circle is the black line). Like this:
Once you have warped each of the sides we need to now warp the circle in the center so then it also is along the black line. Again highlight and warp to the closest you can get to the line.
Using the stamp tool and the patch tool, fix the edges so then they look like they seamlessly fit into each other like so:
Since we fixed the edges of the image, split the image again into the 5 different images, but before you make them into VTF's rotate the original panorama back, so then you can see if editing the center changed the joints between them. If they are all good then you can do the same technique to do the bottom. I however made mine dark water so all I need is a dark blue texture, if yours is more difficult such as a space texture do the same as above.
That is it: Look at the finished result:
Can you see the corners? :)