PDA

View Full Version : Strange gap in skybox



3_of_8
28-02-2007, 10:40 PM
I've got a skybox consisting of 6 GL_QUADS.

The quads are arranged in a cube, so the distance is all the same. The texture coordinates are (0,0), (0,1), (1,1), (1,0). Even so there is some kind of gap between the seperate quads. glTexParameteri(GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_EDGE); did not help anything, neither WRAP_T or both.

You can see it on the screenshot.
http://upload6.postimage.org/491401/skybox_break.jpg (http://upload6.postimage.org/491401/photo_hosting.html)

cragwolf
01-03-2007, 03:22 AM
Read this:

http://www.sjbaker.org/steve/omniv/tiling_textures.html

3_of_8
01-03-2007, 09:52 PM
Well, my actual problem was the clamp-thing: First I called glTexParameteri with the wrong parameters. Second I have to call glTexParameteri before sending the texture to the graphics card.

chronozphere
02-03-2007, 09:52 AM
Check your texture sizes. Some video cards demand power of 2 sizes e.g 512x512.
Once i had these gaps too. I found out that my textures were 511x511. The graphics hardware fills the last pixels with zero-data.
I changed the background color (used for clearing the color buffer) and i found out that the gaps had that color too; They were transparent (alpha = 0). :)

Offcourse i'm using D3D, but i still hope this can an answer to your question. ;)



What sizes do you use for your skybox textures??
I want to experiment with skyboxes too, and yours looks great so i'm curious about the texture sizes. :P

3_of_8
02-03-2007, 11:35 AM
Alright, I should have expressed myself a little more clearly: I solved the problem by switching on the clamping and rendering the quads "overlapped".

My textures were 512*512, so they match the criterion of 2^n*2^m. Textures whose measurements are not powers of two are not displayed anyhow, just like I didn't bind them.

And they are 512*512, generated with Terragen, TGA format. The real problem is the size, even compressed they have a size of ~1.2 MB together.

EDIT: I'd suggest NOT to render the landscape as I did. These mountains look good, but they are a little blurry and they disturb the fogging-effect.