Game Development Community

Image Loss on GUI elements

by Bryce "Cogburn" Weiner · in Torque Game Engine · 06/12/2007 (8:48 pm) · 3 replies

I'm experiencing some odd loss with GUI images and I'm wondering if anyone has any pointers since a website search turned up fruitless (except for one post that suggested that it was a flaky video card).

www.versusthegame.com/cogburn/JPEGBMPCompare.jpg
Top are the images loaded into Photoshop... BMP on the left, JPG on the right.

Below are the same two images in-game. BMP on the left, JPG on the right. The dimensions of the image are the same in-game as in Photoshop.

The problem is the artifacting.

I think there's an accuracy problem somewhere, but in tracing it down to dglDrawBitmapStretchSR I haven't found anything that jumps out at me.

I checked other GuiBitmap controls and they all behave in the same manner.

I've got a few other OpenGL games of the same version of TGE 1.5.2 (for testing purposes :) ) and none are exhibiting the same issue, so I'm going to rule out driver/OpenGL/video card as the culprit.

Any clues?

edit:image

#1
06/13/2007 (7:28 am)
The only time i've seen this is when the bit depth setting were @ 16 instead of 32. But it isn't artifacting like that per say. Although all my images always look better in photoshop then they do in game. You're right though it's something with the bitmap rendering, either during conversion or at draw. I do know however that for buttons, icons or anything that have edge details i want to maintain, i use pngs. Plus you don't have to make a transparent layer mask either.
#2
06/13/2007 (8:19 am)
I am having this issue as well, but for me i have narrowed it down to either the fact that i am using a wide screen monitor or the video card.

first , i test my game on 2 platforms. one is a laptop with a Intel 915 Series video chip set and a wide screen display, the other is a desktop pc with a 17 inch display on a ATI Radeon X1300 Pro video card.

on the the desktop i do not get this with the my hud overlay png, but on the laptop i do. there are disortions/artifacting on some of the lines in the graphic that are not present on the desktop system.

What video card do you have tha thas this problem?
Are you using a widescreen monitor?
#3
06/14/2007 (8:07 pm)
This is on an Nvidia 7900 on a 21" non-widescreen LCD display.

The images themselves are not set to be resized based on the resolution of the canvas. I tested this against a variety of resolutions with the same result.

@Jason: This kind of artifacting is inconsistent with a low bit depth. Were that the case, the artifacting would be identical regardless of the input image format. You do, however, bring up an interesting point. I wonder if this isn't a result of the blending of the JPEG alpha. I'm going to remove that from the engine tonight and see if the artifacting is still present. For what it's worth, I've modified GuiBitmapButton to accept an alpha image in the datablock as opposed to one based on the file name. The space savings using this method as opposed to the old way or PNGs is pretty significant with a lot of similarly shaped GUI elements.