Sign in to follow this  
Asheh

Floating point errors?

Recommended Posts

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this