Game Development Community

Hud Bitmap Transparency in FullScreen...

by David R. Green · in Torque Game Engine · 08/24/2001 (12:37 am) · 15 replies

An odd one...

My Hud graphics work perfect in Windowed, but in Full-screen the alpha values of 0 (fully transparent) are fully opaque instead.
Any ideas?

Thanks,
David

#1
08/24/2001 (9:46 am)
After carefully examining what is going on, it is a problem right in the V12 and T2 engine itself, at least on my system, anyone else getting this?

Perhaps it can be tracked down and fixed...

The T2 Hud does the same thing:
In fullscreen mode, a solid single-pixel line of medium transparency is added by the engine on the right and bottom sides of the hud graphic. So this throws the look of your graphics off. You can really notice it on the T2 health/compass graphic, which the original image does not have the right/bottom lines in the PNG file.

David
#2
08/24/2001 (9:52 am)
That's been a problem since E3 of 2000. I noticed it when I was playing around on the scout bike.
#3
08/24/2001 (11:42 am)
I'm glad I'm not the only one seeing it then. :-)

Anyone know if this is going to be fixed in V12?
It sure messes up my Hud graphics.

Thanks,
David
#4
08/24/2001 (12:17 pm)
I'll fix it if I can find it.. I must admit, Ive not run the game fullscreen to really see it yet.

Phil.
#5
08/24/2001 (12:23 pm)
Hnmm, doesnt happen on my hud (mainly because I drew the PNG's with a pixel border around.

You must remember to leave at least a single pixel border in the image so that it doesnt do any sub-pixel wrapping or anything. Are you running in OpenGl or directX?

OpenGL has a mode called "clamp" which clamps coordinates, otherwise pixels on the edge of an alpha image get stretched to the edge. I'd recommend always leaving at least a single pixel border (no alpha no colour) around your images. That should work fine fullscreen.

Phil.
#6
08/24/2001 (3:57 pm)
Hi Phil,

Since it occurs only in FullScreen and *not* Windowed, I would suspect an engine bug.

Implementing a border pixel may be a workaround fix for the problem, but it would be nice to actually have the problem repaired (I haven't had a chance to check out the c code to locate it).

I'm usually running in DirectX on my machines here, but T2 in either DX or OGL does it.

Here's a partial screen-cap from T2 showing the extra lines on the right and bottom on the health/compass hud element. If you load up the hud_new_cog png file, you will notice they have used no pixel border and that the lines that do appear on the hud are not part of the png source image.

www.lilchips.com/webdev/t2huderr.jpg
I will try the pixel border to see what occurs and get back to you.

-> "I'd recommend always leaving at least a single pixel border (no alpha no colour) around your images."

No alpha, no colour? How do you make a no colour pixel? :-)

Thanks,
David
#7
08/25/2001 (4:49 am)
Weird. Never noticed that.. Then again it could be because I'm running at 1600x1200... Will look closer..

Owen
#8
08/25/2001 (5:09 am)
Hi David,

Hmm, yes, I see what you mean. When I say "no Colour" I mean 0,0,0 RGB :)) black in other words :))

Ive seen the same kind of edges in my own games :)) but I'll take a look in the source and see if the textures are clamped or wrapped (basically, clamp should be used when you want to make the texture EXACTLY match at an edge, for instance I had to use it on my skyboxes to stop a black line at the edges).

But anyway, let me take a look and I'll see if there's anything obvious, might just be error in the texture coordinates.

Phil.
#9
08/27/2001 (2:10 am)
Hi,

It occurs on any 2d graphics objects in full-screen...
Even the custom mouse cursor I made does it.

Once I get further into development, I'll check the code if noone else gets to it before then.

David
#10
08/28/2001 (9:56 am)
Well...

I tracked the odd little lines down to actually being the [V5] FSAA on my video adapter, not the engine. I have never seen any other game do this though, just T2 and V12. If I turn FSAA off, the lines disappear. It must be something to do with the T2/V12 png alpha system, ghosting on the edges.
Very odd...

David
#11
08/28/2001 (10:45 am)
It happens on a GeForce256 also... and as far as I know I don't use FSAA (Then again I haven't checked recently.
#12
08/28/2001 (11:18 am)
same on my TNT2 and I KNOW that that doesnt do FSAA.. I'm sure its just a clamp edge texture problem.. its fairly easy to fix by having the alpha mask have a pixel space around the edge (from my experience anyhow).

Phil.
#13
08/28/2001 (11:18 am)
i have a similar bug. My transparent hud becomes opaque when i die... when i respawn its transparent again... really strange stuff
#14
08/28/2001 (12:27 pm)
It is odd that the clamp problem would show up only when FSAA [full-scene anti-aliasing] is on.
My Voodoo5 with no FSAA then displays fine, and my Voodoo3 system is always fine. I'll have to check my systems with other adapters (ATI etc.).
I'll also do a test with Phil's extra edge pixel to see what occurs and post back here.

Later eh!
David
#15
08/28/2001 (12:43 pm)
Well, the black/transparent edge pixel method didn't fix it, it just moved the glitchy line over one. :-)

V5 with FSAA does it even on the T2 GUI text in the Shell, so my guess is something odd in the engine how it renders 2d graphics.
It's odd that would get through beta into the release of T2...

David