Weird ghosting effect in textures with some transparency.

Hi,
I am writing a game, which has some nice
bitmaps of a dashboard over which I display readouts,text etc

Some of the panels have transparent regions,
denoted by rgb (0,0,0), through which I expect to see my main scene.

I have created a 2 colour mask of the dashboard, and this is drawn first ( depth sorting is switched off ),using

glBlendFunc(GL_DST_COLOR,GL_ZERO);

I then draw the color version of the dashboard, using:

glBlendFunc(GL_ONE, GL_ONE);

My problem is that, I can see the edges of my textures, even though I am using colour zero along that edge.
http://www.dodgyposse.com/neil/ghost.jpg

Illustrates what is going on.

Both textures are drawn with exactly the same
coordinates, and depth sorting is switched off when they are drawn.

dd

Try setting the texture wrap parameters to GL_CLAMP_TO_EDGE_EXT

Do you mean:

glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_CLAMP_TO_EDGE_EXT);

glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_WRAP_T,GL_CLAMP_TO_EDGE_EXT);

If so, I tried to compile and it didn’t recognise GL_CLAMP_TO_EDGE_EXT

I’ll investigate further.

dd

I think you’ll need the extension header since it’s an extension
http://www.nvidia.com/dev_content/nvopenglspecs/GL_EXT_texture_edge_clamp.txt

On a sidenote:
You can also simply use an rgba texture for the overlay where alpha=1 for the visible areas, alpha=0 for the transparent areas and render in a single pass with
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);

Ok,
I have tried a few things out and the code is still drawing these ghost lines.

I don’t know about using CLAMP_TO_EDGE_EXT
as that is an opengl 1.2 extension, and my compiler does’t seem to know about it. ( VC++ 5.0)

Where would I go, to get this extension?

I remember reading something about texture borders…could that be it?

dd

Like I said, your compiler doesn’t recognize this constant because you’re not including the OGL extensions header (!)

And yes, this extension prevents sampling from the texture border.

Read:
http://www.opengl.org/developers/faqs/technical/extensions.htm#exte0090

[This message has been edited by richardve (edited 02-27-2002).]

Oh, and in that extra header, it’s called GL_CLAMP_TO_EDGE (without the _EXT)

Apologies…I misunderstood…I thought
that because my card didn’t have it, it meant that it couldn’t support it at all…

I’ll download those headers and give it a go.

Thanks for your patience!

dd

bugger! Those links to the headers are not responding…

Anyone out there know where I can get

glext.h
wglext.h
glxext.h

other than the oss.sgi website?

dd

coming via email …

BTW - how’s maverick coming on? I’ve been watching it’s progress for ages now

[This message has been edited by Shag (edited 02-27-2002).]

Maverick is coming along well…

We are beta testing it and trying to remove the obvious bugs.

This release will be smaller than the last one(!), and will have higher quality textures, as I have ditched bmp’s and am reading them as jpegs from a zip file.

The AI is improved, the mission engine is improved, the skyboxes are better, the planets look better, there are more ships,
the user interface is now skinnable, there is an mp3 music manager, and basically the whole thing is just better

Me…??? I’m knackered!

The fact that the download is smaller, may mean we get more interest…

At last reckoning, it will be a 7-8 meg download, and I am aiming to have the new version up there by march 2002.

The website is www.dodgyposse.com and there are some screenshots up there for those of you who haven’t seen it before.

del

Thanks for the headers!