PDA

View Full Version : Bitmap as texture



02-08-2001, 06:50 AM
Hi! Can someone help me, please?

I have to display many textures side by side to form a big image, but the result isn't good. In the edge of each texture appears a shadow. How can I eliminate it?

Thanks,
Henrique

Moz
02-08-2001, 07:01 AM
Looks like a job for texture borders.
Lucky you, that's in the red book : http://helios.scripps.edu/ebt-bin/nph-in..._RESTART_N%25#X (http://helios.scripps.edu/ebt-bin/nph-infosrch/infosrch/SGI_Developer/OpenGL_PG/@ebt-link;pt=17743?target=%25N%15_18810_START_RESTART_N %25#X)

02-08-2001, 07:45 AM
thank you Moz, but I can't access this site.

Michael Steinberg
02-08-2001, 12:23 PM
That is due to bilinear interpolation at the edges of the texture. An easy way of making a fix is to shrink the texture 1 pixel in every 4 directions and duplicate any pixel at the outer rectangle. Then don't give tex coords from the edges but give them moved 1 pixel diagonaly to the opposing corner.

02-09-2001, 03:57 AM
Thanks, folks

I've changed de last parameter of glTexParameteri from GL_LINEAR to GL_NEAREST and it worked.

glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST );

Thank you, again