PDA

View Full Version : nasty texture seams



blt8
06-19-2003, 08:41 PM
i implemented a warcraft 3 map viewer (tile-based), but i have problems with tiles that are textured via multipass texturing. examples can be seen in this pic:
http://www.bol.ucla.edu/~btang/ack.jpg

i'm not sure where this is coming from. any help will be appreciated. thanks in advance.

dorbie
06-19-2003, 08:51 PM
This is texture clamping edge, use GL_CLAMP_TO_EDGE filtering.

blt8
06-20-2003, 01:26 AM
thanks. i tried that, but that's not it. it only happens on the tiles that are rendered in multipass (some are not, and those are fine).

Nutty
06-20-2003, 01:48 AM
Hmmm.. Are you sure all textures are setup with CLAMP_TO_EDGE clamping?

What hardware, Drivers etc.. are you using? Can you make a sample program that illustrates the problem, so other ppl can test it.

cheers,
Nutty

blt8
06-20-2003, 02:09 AM
i'm sure.

i'm running a geforce 4 4400, latest drivers.

what appears to happening is that parts of the underlying texture is showing. perhaps my blending modes are off? if a texture is the first one to be drawn on the tile, i use

glBlendFunc(GL_ONE, GL_ZERO);

for additional textures on the same tile, i use

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

the textures have alpha.

Nutty
06-20-2003, 04:12 AM
On my current project, the artists used Photoshop to create some alpha'd textures for me, and due to the useless way photoshop works, they didn't alpha the edge of the textures properly. I had to edit them myself. I think this was something to do with the way photoshop scales stuff..

Check in an accurate image program, that your alpha channels are correct right to the edge of the textures.

blt8
06-20-2003, 12:14 PM
what else is there besides photoshop? http://www.opengl.org/discussion_boards/ubb/wink.gif

you may be right about the bad alpha channels. when i adjust the texture coordinates to go a little into the texture, the dark seams become less visible. of course, this screws up the the seamlessness of the intended use of the textures.

Nutty
06-21-2003, 03:20 AM
Paint Shop Pro can be freely downloaded. Its shareware IIRC. Doesn't have the best support for alpha channels though, but it can be done.

V-man
06-21-2003, 07:51 AM
Yes, I have to say that PPPro is pretty stupid.
Even if I open a bmp, tga or any other thing that is 32bpp, when I save as a new file it removes the alpha.

Well, I haven't tried version 8.

Nutty
06-21-2003, 11:09 AM
Or if you want, email the texture to me, and I'll make sure the alpha channel is correct at the edges for you.

dorbie
06-21-2003, 11:53 AM
Why would you draw blended when apparently there's no need. Do you require alpha for other tiles?If all you have is an alpha border then don't even load the alpha channel to texture.

blt8
06-21-2003, 12:13 PM
the bottom-most texture doesn't need alpha since it is going to be covered up in those "alpha spots" anyway. this is an example of a warcraft 3 tileset, and why alpha is needed (compressed to save space):
www.bol.ucla.edu/~btang/LDarkGrass.jpg (http://www.bol.ucla.edu/~btang/LDarkGrass.jpg)

the white parts are supposed to be the alpha parts. essentially, the texturing system works by "layers," so alpha is definitely needed. and if you look closely enough at this image:
www.bol.ucla.edu/~btang/ack2.jpg (http://www.bol.ucla.edu/~btang/ack2.jpg)

you'll notice that alpha textures seem to start drawing a little "into" the polygon from the left. so there appears to be a precision error reading the coordinates of the texture. but, i'm using numbers like 0.25f, 0.375f, etc., so i really don't know.