spacer graphic
spacer graphic
Montage of games AGS Logo
spacer graphic

Welcome, Guest. Please login or register.
09 Feb 2010, 00:40

Voting is now open in the AGS Awards 2009!
Play the games that have been nominated, and then
vote for your favourites in each category!

Home | Help | Search | Games | Wiki | Login | Register


AGS Forums  |  Using AGS  |  Beginners Technical Questions (Moderators: Scummbuddy, Ashen)  |  Topic: antialiasing problem (with screenshots) « previous next »
Pages: [1] Print
Author Topic: antialiasing problem (with screenshots)  (Read 471 times)
tolworthy
Member


« on: 22 Dec 2007, 10:23 »

This picture should explain my problem:


I am using 16 bit color. I realise that 32 bit color is needed for edge antialiasing, but I only need to antialias faces. All my characters have white edges and most of the backgrounds are white, so I don't care if the edges are jaggy. But where the heck are these dark artefacts coming from? There are no dark colors anywhere near the edges of the sprites, and the transparent color is pink. I've even added two pixels of white around the sprite, and the scaled screenshot is pretty close to 100 percent sprite size. But still the dark lines appear! What am I doing wrong?
Logged

tolworthy
Member


« Reply #1 on: 22 Dec 2007, 21:36 »

Eleven hours later...

I see I am not alone in noticing this: over a year ago, Adamski described the same problem.

Adamski is a lot smarter than me (he even has "moderator" in his title) and yet nobody replied to his question. May I conclude that this problem is intractible? Perhaps even (whispered voice) a bug?
« Last Edit: 22 Dec 2007, 21:38 by tolworthy » Logged

Pumaman
Mittician
Administrator

Member


I sense danger.


« Reply #2 on: 22 Dec 2007, 21:53 »

I believe this was traced to the anti-aliasing library anti-aliasing the image against the pink background, which leads to artefacts around the edge of the image. I did try out AASTR2 as suggested in that thread, but it had problems of its own.

Can I just clarify that the "antialiasing" you're talking about is the option in Setup to smooth scaled sprites? If so, then it might be worth trying out AGS 3.0 with the Direct3D driver, which does this in hardware and should not have these effects.
Logged
tolworthy
Member


« Reply #3 on: 22 Dec 2007, 22:13 »

Sorry, yes, I meant smoothing. It's good news if this has been fixed in 3.0 - thanks.  However, It's important to me that my game works in Linux, so I'll have to stick with 2.72 for the foreseeable future.

I guess I'll need to disable smoothing and blur the faces to compensate (so eyes and mouths don't disappear when scaled). Is there a way for me to disable the smoothing option in the standalone setup program so users don't click on it?
Logged

Pumaman
Mittician
Administrator

Member


I sense danger.


« Reply #4 on: 22 Dec 2007, 23:16 »

Currently it's not possible to disable the option. However, I'm trying to remember if this problem was solved, because if the anti-aliasing was always doing this then it would pretty much render the feature useless ... unless most of the time people use sprites with well-defined edges...
Logged
GarageGothic
Member


Play-testing: Several years of testing experience at EAScripting: Custom GUI coding and visual effects.Story design: Dramatic structure, I'm your man.

« Reply #5 on: 22 Dec 2007, 23:28 »

Well, although you can't remove it from the setup, you can override it by setting "game.disable_antialiasing = 1;"  in the game_start script.
Logged
tolworthy
Member


« Reply #6 on: 22 Dec 2007, 23:37 »

if the anti-aliasing was always doing this then it would pretty much render the feature useless ... unless most of the time people use sprites with well-defined edges...

Or mid-range backgrounds? The "dark" edge is often a grey of 50 percent brightness.

Maybe I should redesign my game along the lines of the Cramp Twins)

you can override it by setting "game.disable_antialiasing = 1;"  in the game_start script.

So the user would tick the box but nothing would happen?
Logged

GarageGothic
Member


Play-testing: Several years of testing experience at EAScripting: Custom GUI coding and visual effects.Story design: Dramatic structure, I'm your man.

« Reply #7 on: 22 Dec 2007, 23:45 »

So the user would tick the box but nothing would happen?

Exactly. The game would behave the same whether the box was ticked or not.
Logged
tolworthy
Member


« Reply #8 on: 22 Dec 2007, 23:58 »

Thanks. If I can access the smoothing variable to disable it, then I guess that I could use it to trigger an alert when the game is played? Like "you clicked on X but for technical reasons..."
Logged

GarageGothic
Member


Play-testing: Several years of testing experience at EAScripting: Custom GUI coding and visual effects.Story design: Dramatic structure, I'm your man.

« Reply #9 on: 23 Dec 2007, 00:14 »

Strangely, game.disable_antialiasing doesn't actually read the current state of anti-aliasing. It always returns 0 until you've changed it yourself.

However, you could use File.ReadRawLineBack() to check acsetup.cfg for the line "antialias=1", and - if it exists - display a message about the antialiasing being deactivated for technical reasons. Something like this:

Code:
File *cfgfile = File.Open("acsetup.cfg", eFileRead);
if (cfgfile != null) {
   while (!cfgfile.EOF) {
      String cfgline = cfgfile.ReadRawLineBack();
      if (cfgline.Contains("antialias=1") != -1) {
         Display("You've selected smooth character scaling, but for technical reasons this feature has been disabled.");
         }
      }
   cfgfile.Close();
   }
game.disable_antialiasing = 1;

You could set another variable to finish reading the file as soon as the correct line is found, but since the .cfg is so short and "antialias=1" is often the last line, I didn't bother.
« Last Edit: 23 Dec 2007, 00:26 by GarageGothic » Logged
tolworthy
Member


« Reply #10 on: 23 Dec 2007, 00:26 »

Thanks
Logged

Pages: [1] Print 
AGS Forums  |  Using AGS  |  Beginners Technical Questions (Moderators: Scummbuddy, Ashen)  |  Topic: antialiasing problem (with screenshots) « previous next »
Jump to:  


Login with username, password and session length

Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
Page created in 0.115 seconds with 16 queries.