Talk About Network

Google





Graphics > OpenGL 3D API > 2d Tiles have u...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 15 Topic 4896 of 5061
Post > Topic >>

2d Tiles have unwanted edges

by grayaii <grayaii@[EMAIL PROTECTED] > Aug 31, 2008 at 04:10 AM

Hi,

I have a single "master" png file that contains a bunch of 32x32 tiles
that I then use to texture GL_QUADS as my tiles, but when I render
them, I'm getting an unwanted edge to all my tiles. The png file has
transparency, which I believe is the source of my troubles.

I'm binding the texture to the GL_QUADS like so:
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR);

And I'm rendering them like this:
GL.glEnable(GL.GL_BLEND);
GL.glEnable(GL.GL_ALPHA_TEST);
GL.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA);

I tried different combinations ofglTexEnvf (like below), but the don't
work. I still get an edge.
GL.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE,
GL.GL_MODULATE);
GL.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE,
GL.GL_REPLACE);
GL.glTexEnvf(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, GL.GL_DECAL);

I want to render the tiles *exactly* how they are displayed in the png
file.  I suspect the solution lies with playing around with
glBlendFunc, but I can't find one that works!
Any ideas?
 




 15 Posts in Topic:
2d Tiles have unwanted edges
grayaii <grayaii@[EMAI  2008-08-31 04:10:08 
Re: 2d Tiles have unwanted edges
John Tsiombikas <nucle  2008-08-31 14:28:35 
Re: 2d Tiles have unwanted edges
Wolfgang Draxinger <wd  2008-09-01 02:45:48 
Re: 2d Tiles have unwanted edges
John Tsiombikas <nucle  2008-09-01 19:22:45 
Re: 2d Tiles have unwanted edges
"jbwest" <jb  2008-09-01 15:08:44 
Re: 2d Tiles have unwanted edges
John Tsiombikas <nucle  2008-09-01 23:15:54 
Re: 2d Tiles have unwanted edges
Wolfgang Draxinger <wd  2008-09-02 12:37:03 
Re: 2d Tiles have unwanted edges
John Tsiombikas <nucle  2008-09-03 05:11:36 
Re: 2d Tiles have unwanted edges
"jbwest" <jb  2008-09-02 19:49:47 
Re: 2d Tiles have unwanted edges
Wolfgang Draxinger <wd  2008-09-01 03:05:09 
Re: 2d Tiles have unwanted edges
anon <anon@[EMAIL PROT  2008-09-01 11:20:16 
Re: 2d Tiles have unwanted edges
Wolfgang Draxinger <wd  2008-09-01 20:17:10 
Re: 2d Tiles have unwanted edges
grayaii <grayaii@[EMAI  2008-09-01 20:29:52 
Re: 2d Tiles have unwanted edges
grayaii <grayaii@[EMAI  2008-09-02 16:00:50 
Re: 2d Tiles have unwanted edges
"jbwest" <jb  2008-09-02 19:53:01 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
localhost-V2008-12-19 Fri Jan 9 12:55:17 PST 2009.