Jump to content

  • Log In with Google      Sign In   
  • Create Account


border texture


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
7 replies to this topic

#1 mentaman   Members   -  Reputation: 99

Like
0Likes
Like

Posted 13 March 2012 - 11:32 AM

Hello, I'm using opengl and load my textures with soil.
When I render my square, it makes a border to the texture.

Here the code of the soil's load:

textur[fNum] = SOIL_load_OGL_texture
(
(char*)fName.c_str(),
SOIL_LOAD_AUTO,
SOIL_CREATE_NEW_ID,
SOIL_FLAG_MIPMAPS | SOIL_FLAG_INVERT_Y
);
thanks.

Sponsor:

#2 Rld_   Members   -  Reputation: 1354

Like
0Likes
Like

Posted 13 March 2012 - 03:14 PM

What does the texture look like? What does it look like on the square? How should it look? Did you define correct UV coordinates?

#3 mentaman   Members   -  Reputation: 99

Like
0Likes
Like

Posted 13 March 2012 - 10:23 PM

The texture doesn't have a border, she looks normal.
And here one of the coordinate's code for example:

glBegin(GL_QUADS); //create polygon
glTexCoord2f((part/maxParts), 0.0f);glVertex2d(x, y);
glTexCoord2f(((part+1.f)/maxParts), 0.0f);glVertex2d(x2, y);
glTexCoord2f(((part+1.f)/maxParts), 1.0f);glVertex2d(x2, ny2);
glTexCoord2f((part/maxParts), 1.0f);glVertex2d(x, ny2);
glEnd();
the variables are float.
I thought maybe it because one of them isn't excatly 1.f
but it happend in the y too, and I checked with 1.f, and still happend.

#4 6itru   Members   -  Reputation: 129

Like
0Likes
Like

Posted 14 March 2012 - 01:00 AM

i had the same ;p
try add something like this after image loading
	glBindTexture(GL_TEXTURE_2D, textur[fNum]);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);


#5 Hodgman   Moderators   -  Reputation: 27774

Like
0Likes
Like

Posted 14 March 2012 - 01:53 AM

So you've got many small images packed next to each other in a single texture? And when you render quads using these sub-images, the edges of the next sub-image bleed into your quad?

#6 mentaman   Members   -  Reputation: 99

Like
-1Likes
Like

Posted 14 March 2012 - 08:39 AM

i had the same ;p
try add something like this after image loading

	glBindTexture(GL_TEXTURE_2D, textur[fNum]);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);
	glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);

Thanks, I had already tried that.
It doesn't work.

So you've got many small images packed next to each other in a single texture? And when you render quads using these sub-images, the edges of the next sub-image bleed into your quad?

I didn't understand what you asked.

#7 Hodgman   Moderators   -  Reputation: 27774

Like
0Likes
Like

Posted 14 March 2012 - 06:00 PM

I didn't understand what you asked.

I was trying to clarify what it is that you're doing, as you've not given us much information or pictures of the problem.

To try again: the (part/maxParts) code implies that you've got several "sub images" inside the same texture, and you're trying to draw quads that use different "sub images". Is your problem that the edges of each sub-image look wrong (they're blended with the next sub-image)?

#8 mentaman   Members   -  Reputation: 99

Like
0Likes
Like

Posted 14 March 2012 - 10:40 PM

Oh, no.
It happend too with images which has only one part.
What information do you need about the picture?
Can it help you if I show you a screenshot?




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS