Anti-Aliasing for Protagonists

General chat related to ScummVM, adventure gaming, and so on.

Moderator: ScummVM Team

Post Reply
KevinW
Posts: 26
Joined: Wed Jan 04, 2006 2:40 pm
Location: Bochum, Germany
Contact:

Anti-Aliasing for Protagonists

Post by KevinW »

Hey there,

here's another crazy idea for a feature that I think could enhance the graphics of the old games. Not being a coder myself, I don't know if it's possible.

Would it make any sense to add an anti-alias option for the drawing of the actors in the supported Games? I think it was already done this way by Broken Sword 2 in the original engine, or am I wrong?

All the best,
Kevin
joachimeberhard
ScummVM Team Member
Posts: 377
Joined: Sat Sep 24, 2005 12:25 pm
Location: Austria

Re: Anti-Aliasing for Protagonists

Post by joachimeberhard »

KevinW wrote:Hey there,

here's another crazy idea for a feature that I think could enhance the graphics of the old games. Not being a coder myself, I don't know if it's possible.

Would it make any sense to add an anti-alias option for the drawing of the actors in the supported Games? I think it was already done this way by Broken Sword 2 in the original engine, or am I wrong?

All the best,
Kevin
Try any of the high quality scalers under Graphics mode. :D
OmerMor
Got a warning
Posts: 176
Joined: Thu Nov 17, 2005 9:29 pm
Location: Israel
Contact:

Post by OmerMor »

Kevin, I think what Joachim suggested was different.
The scalers are "dumb" enhancers, in the sense that they act on each picture frame as a non-distinctive array of pixels.
His suggestion (as I understand it) is to use anti-aliasing techniques on the actor themsleves, which could distinguish them from the background image, and enhance their look.
I personally think it has great potential. I hope someone will pick up that glove.
Omer Mor.
User avatar
sev
ScummVM Lead
Posts: 2279
Joined: Wed Sep 21, 2005 1:06 pm
Contact:

Post by sev »

THere will be 2 things: either sprite borders will be jagged or alpha blending should be implemented. Not to say that I'm not aware about any real time scaler which takes alpha channel in account, but may be that's just me. In any case code complexity will be quite high. Kevin, did you try to do it by hand and see if result is really nice.


Eugene
clem
Posts: 2159
Joined: Mon Oct 31, 2005 11:14 am

Post by clem »

also how do you cope with background graphics which obscure the actor? (ie "foreground" graphics)
KevinW
Posts: 26
Joined: Wed Jan 04, 2006 2:40 pm
Location: Bochum, Germany
Contact:

Post by KevinW »

@omermor
Yep, that's what I meant. As I said, as far as I remember, the Broken Sword Engine had alpha-blended characters.

@sev
I haven't tried to do it manually, I was more or less guessing that it could be an improvement. But I maybe I try to figure out when I find the time.
User avatar
gord
Posts: 25
Joined: Tue Feb 21, 2006 10:48 pm

Post by gord »

you can't really achieve true anti-aliasing without down-sampling from a larger quality image, which in this case you don't have. the 'anti-aliasing' in broken sword 2 i believe is just the result of different quality sprite rendering, weather to use an true alpha-channel or a bit-mask channel.

any attempts to create anti-aliasing on bitmap graphics like these, without a larger quality version to work with is likely to just look like a blurred edge, instead of a well defined yet smooth edge. (you get the latter with edge detecting scaling filters like hq2x and to a smaller extent, advance2x)
OmerMor
Got a warning
Posts: 176
Joined: Thu Nov 17, 2005 9:29 pm
Location: Israel
Contact:

Post by OmerMor »

I don't understand why edge detection algorithms which work on a regular bitmap would be more successful at detecting the edges, while the real edge of the sprites is known to us before we render the final image, and can be used in a more sophisticated anti-aliasing algorithm.

I believe that when we are rendering the picture at higher resolution, we should be able to scale up the sprites first, and use alpha-channel in the sprite's edge.
Then we'll scale up the background, and after that we'll mix them together.
Without testing this theory, I believe it should have better visual results than a generic scaler that has no real knowledge about the true edges of the sprites.
User avatar
gord
Posts: 25
Joined: Tue Feb 21, 2006 10:48 pm

Post by gord »

honestly, even if you went and created your own scaler (and believe me, after designing a marching cubes scaler a while back, its no walk in the park) that took into equation bit-masks, it would still only look marginally more defined than the hq range of scalers, the only place where you would see any real difference is when a part of the sprite with colour_a moves next to a part of the background with colour_b. with colour_b being marginally different than colour_a.

is the result of a slightly more well defined edge in a small set of circumstances really worth the effort?
User avatar
gord
Posts: 25
Joined: Tue Feb 21, 2006 10:48 pm

Post by gord »

hopefully to put the subject to death, and because i had 20 mins to waste ;) i created a small program based on the hq-filters. and this was the result. the first image was created by filtering both the sprite (guybrush) and the background independently, and composing them together, the second is a straight screenshot from scummvm with hq3x.

ImageImage

the anti-aliased edges just look less well defined and blurry, mainly because the hq filter uses the pixels around edges to create nice smooth edges, when its done independently it just has the equivalent of one plain colour for the background (transparency)
OmerMor
Got a warning
Posts: 176
Joined: Thu Nov 17, 2005 9:29 pm
Location: Israel
Contact:

Post by OmerMor »

Point well made ... :D
Post Reply