What is the best method for a background ?

I need some advise in this area. I can create a background for a 3d world that looks very nice with a sphere wrapped with background picture. The texture only has to tile on the horizontal and after applying a photoshop filter that does a distortion for polar coordinates it works pretty well.

However I dont know the advantages of other methods. I know that a cube can be used instead with 6 tiling pictures but do we have to apply any distortion filter to the textures to make them look seamless not like a cube ?

What about if we use a cylinder for the background 3d object ? What are the advantages ?

Another thing im trying to simulate a day/night cycle like in Morrowind, with the sun moving in the sky and the sky fading into a star field. Any sugestion on how to do this ?

I have been giving this some thought myself - I’m afraid I can’t be a world of help with the skybox thing, I have usually used a sphere for this, but on the weather pattern thing I have tried to think through a route to having it work.

I think the best way is to use a Texture-By-Reference to map the skybox and use Java2D to generate the actual image. Now I think about it, it may be a lot easier to do this using a square skybox because otherwise you need to sort out sphere mapping as well as any changes to the image itself.

I would suggest using a standard day/night pattern with straight blue-sky through to starry night and then overlaying a plasma cloud pattern over it. It may even be smart to alphablend the layer and place it on another shape inside the skybox to create some degree of parallax, but it may be as effective and more efficient to merge the two layers into a single image.

If you’re not too up on them, plasma patterns are often used in fractal terrain generation - there is a good tutorial page here.

Thanks for your help. I use real images for the sky but its neccessary to equalize the bright in photoshop for those pictures before using them otherwise it gets hugly.

I have a problem with making a background using a cube and 6 textures. The problem is that it looks like a cube. Specially in the corners. Maybe I have to do something to the textures or the cube before rendering the background geometry. Any help would be apreceated.

The skybox will look ugly unless the textures are made properly. This is done by setting up 6 cameras in a modelling progam, where the lenses makes up a unit cube. I found some skybox textures here:
http://www.geocities.com/-harlequin-/quake/

NB! the pk3 file inside the zip is actually a zip. Rename it and unzip it.

That sky box page was quite useful. Thanks a lot.

How exactly do you set up the 6 cameras to make a unit cube ? And how do you use the raw images in there ?

I supose you use each of the 6 cameras to take a snapshot image, distorced by those cameras, that will will render nicely in the skybox.

Terragen can be used to make nice skyboxes if thats the style you’re after. The only thing you need to remember is to set the field of view to 90 deg and generate square images for each direction. The perpective warping will be correct when applied to a skybox then.

Terragen gives you a whole bunch of rendering options as well, and I seem to remember one being to render without the sky, so you could keep it separate to make it change in game :slight_smile:

Btw, Serious Sam used Terragen to create its skyboxes.

Yes, i made a google search a while ago and it come up with terragen. It looks a good program. It also gave me a lot of serious sam howto pages for skyboxes. I have to look at this program more carefully. Thanks.

Im also trying to determine the type of distortion op used in the raw texture images before using them on a cubic skybox. I think its some sort of equation using sin and cos that makes each texture shrink at the center. Then maybe i can use the advanced imaging api to work on the images without need to use extra programs.

how does your raw textures look like?

It’s difficult to create a skybox from just any odd image. If you wan’t good result you’ll have to render the skybox textures.

I was thinking of geting some real images of backgrounds from the internet or take some real photos with a digital camera and make them tile with each other using photoshop stamp tool. However if i just use them like that it just looks like i am inside a big cube.

Then I think you’re better off using a cylinder, sphere or some other object. However, if you manage to create a background object that looks good with your raw texture mapped to it, then it is possible to convert that to a skybox.

If you want that morrowind weather conditions type sky you are definitely going to be better off having a plain coloured sky with the sun in it and then generating the clouds on the fly rather than using photos.

I saw the sky images generated by terragen and they are very realistic. Its not such an hard work applying the math to do the clouds. It could even be done in a background thread that updates the sky every second without delaying a game too much.

Im almost shure Morrowind uses pre-rendered sky images and color palette animations. Morrowind only renders the sky part of the background not the sides. This is because of the cell loading system they used to make a continous world, so its not difficult for them. Daggerfall the previous game used to render both the sky and the sides of the background with mountains and stuff as well as using a similar cell loading system.

Using internet background photos with skyboxes probably requires a little tweeking with photoshop but im shure with the right filters it can be done easly.