Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.



This topic is 6029 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Heya After coding a skybox for my litle project, i''ve noticed a rather anoying problem: the sides of the polygons of the cube that forms the box are visible, as in, separated from the rest. they seem to be cloud color, and i have no idea on how to get rid of ''em :/ ideas?

Share this post

Link to post
Share on other sites
Well, if you're using OpenGL for your texturing, have you put a border around the texture?

When you declare your textures, using glTexImage2D, there's a parameter called GLuint border, and it's the sixth in order of definition. It represents the width of a border, in pixels, that should be drawn around the texture. If your declaration looks like this:

glTexImage2D(GL_TEXTURE_2D, 0, 3, 64, 64, 3, GL_RGB, GL_UNSIGNED_BYTE, BitmapBits);

then you'll get a border of three pixels all around the texture, which will be the colour of the polygon without the texture on it. Change your function to look like the following:

glTexImage2D(GL_TEXTURE_2D, 0, 3, 64, 64, 0, GL_RGB, GL_UNSIGNED_BYTE, BitmapBits);

That should work, if your problem is a border.

iNsAn1tY - the place where imagination and the real world merge...
Try http://uk.geocities.com/mentalmantle - DarkVertex Coming Soon!

[edited by - iNsAn1tY on April 17, 2002 7:24:10 PM]

Share this post

Link to post
Share on other sites
One cause might be wrapping around at the edges (it happens on my GeForce2 for some reason). If this is the case, set texture addressing mode to MIRROR and that should get rid of the seams.

Share this post

Link to post
Share on other sites
hhmm... i think the reason is more
like, that every of the 6 faces shares vertices
with other faces, but has a different texture.
One edge of a quad is ON a line (colinear) with
the edge of another quad.
You sometimes see the last
texel-column of texture 1, but not the one
of texture 2, and vice versa, depenging on the
current view angles.

Don't know how to fix this at the moment.
But, if what I said actually causes the problem,
maybe it's worth for you to think about it,
and you find a solution to fix it.

If you get it solved, let me know.

- unshaven

I didn't take into account you said "seems to be cloud color".
I've seen other skybox additional wireframe-like
artifacts, obviously caused by what I just said.
Not sure if it's what your problem is.
However, anyone having such kind of problems with
skyboxes may take a look at this thread, so, information
on this speacial thing could also be useful for those.

[edited by - UnshavenBastard on April 18, 2002 7:55:46 AM]

Share this post

Link to post
Share on other sites
If you don''t want a very highly detailed surrounding environment, skydomes are a very nice alternative to skyboxes. All you need is a nice cloud texture, then create a big sphere, and apply the texture. It creates very nice (and EASY) results. And you don''t have to worry about the sides showing.

Trent (ShiningKnight)
THE Engine

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
You should try to set the texturecoordinates of your skybox a half texel inside the texture, so instead of having an range of [0...1], let them go from [1/512....511/512] for a texture that has a size of 256x256 pixels.


PS: I got this from quake´s source code - its sometimes like a treasure with many many small hints and solutions in it :-)

Share this post

Link to post
Share on other sites

yeah, that should work. it''s so obvious.
why don''t we often see things that are so obvious...

that way, two neighboring pixels of two quads will
always have the reference to the same texel, and thus,
will have the same color, and it will not matter
if the quads don''t exactly fit together (due to floating
point rounding etc), and get a bit closer or less close
to each other.

Thanks for the tip, I can use this, too.

Share this post

Link to post
Share on other sites
Dear all of you, and most especially my anounymous poster!
The solution comes to this (and anounymous poster just almost said it correctly)
instead of using 0.0f and 1.0f in the coordinate values for the cube, i used (1.0f/(TextureResolution*2)) and (1.0f-(1.0f/(TextureResolution*2))).
that made my perfect sky (or should i say, my sky perfect?)

thank you all, have a nice day!

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!