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?


|