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:
i’m not sure where this is coming from. any help will be appreciated. thanks in advance.
This is texture clamping edge, use GL_CLAMP_TO_EDGE filtering.
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).
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.
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
for additional textures on the same tile, i use
the textures have alpha.
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.
what else is there besides photoshop?
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.
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.
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.
Or if you want, email the texture to me, and I’ll make sure the alpha channel is correct at the edges for you.
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.
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):
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:
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.