Alan Phipps

HI Guys,

I am currently creating a skybox for my game and I need help with the BasicEffect settings .

Right now my skybox looks like a cube with a texture on each internal face. I would like the inside of the cube to appear like it is one continual texture, not showing the corners and edges.

I will be creating a skybox with a custom effect later, but right now I would like to use a basiceffect. Can you tell me what basiceffect settings I should configure to create this effect.

thanks in advance.


Re: XNA Framework SkyBox Effect using a BasicEffect

Catalin Zima

First, are your textures created to be in a skybox (i.e. six textures, which tile together nicely).

If they are, then what exactly is your problem Do you have colored lines which apear at the edges (problem with UV texture wrapping settings) Or maybe your box seems like a box, even though the textures tile nicely. If this is the case, you will need to always center the skybox around the camera, and draw it first, without writing to the depth buffer.

Hope something I said helps

Re: XNA Framework SkyBox Effect using a BasicEffect

Michael Morton

You need to disable lighting, zbuffer, zwrite, etc


and set the sampler to clamp the uv's


Re: XNA Framework SkyBox Effect using a BasicEffect

Alan Phipps

Thanks Michael, I had to set the options that you gave and

thanks Catalin, I had to centre the skybox around my camera.

all fixed now.


Re: XNA Framework SkyBox Effect using a BasicEffect


Hello, adding to the qestion. I have seen some games using 3D skybox, like CS:S. It has certain 3D models in the skybox so you can get closer to it. Unlike the traditional skybox that is stationary, you get the sense that you are moving closer to the background.

How does it work in general Is it like you can move inside skybox with limited range or something Thanks.

Re: XNA Framework SkyBox Effect using a BasicEffect

Alan Phipps

If I understand your question, then in your game code, when you update the camera position, you should update the position of the skybox as well, for example, If your camera moved 5 pixels in the positive X direction, then your sky box should also move 5 pixels in the positive X direction.

Any models in your game should not move. This will give the apearance of being able to move towards a model but the skybox will always appear stationary.

One problem that arises with this system is:

If you have a game area whose dimensions are, for example 1024x1024, where a player can only move within this area. When a player moves to one side, the skybox must be big enough so that it does not interfere with the opposite edge of the game area. Making the skybox three times as big as the game area, so that when the player stands in the centre of the game area, there is a buffer zone equal to the size of the game area on each side.

Distance fog is also useful with this problem.