• Advertisement
Sign in to follow this  

Floating point errors?

This topic is 3912 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

Im getting gaps everywhere in my application as shown below. is this due to floating point errors or somthing? Image Hosted by ImageShack.us

Share this post


Link to post
Share on other sites
Advertisement
Looks like you have a border color set, which in most cases is useless.
So set the border size to 0(it's the sixth parameter in glTexImage2D).

Share this post


Link to post
Share on other sites
lc_overlord, the border is there no matter what you set the border-parameter to. It's just a matter of either using the default border color, or explicitely specifying it in the data passed to glTexImage.

These kind of borders usually show up when you're not careful enough with wrap modes. GL_CLAMP for example clamps the texture coordinates to the range [0, 1]. But at texture coordinates 0 and 1, the border color is sampled also! Either specify GL_REPEAT, since it looks like you really want to repeat the texture. Or, set the wrap mode to GL_CLAMP_TO_EDGE to clamp it to the center of the outermost texels in the texture instead.

edit: Just noticed the borders in the sky box also. Use GL_REPEAT for the ground and GL_CLAMP_TO_EDGE for the sky box.

Share this post


Link to post
Share on other sites
hmm i guess your right, i found another problem though.
I did some tests and the only way i could replicate all the artifacts on the picture(disregarding the white blob which is full of them) is if i gave every quad their own set of texture coordinates between (0,0) and (1,1) with GL_CLAMP set and linear filtering.
This is not exactly the best way to do it, the texture coordinates can be above 1 and below 0 (they will just repeat) so use that with GL_REPEAT and some trilinear mipmapping and it will look so much nicer.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement