Jump to content

  • Log In with Google      Sign In   
  • Create Account

Anti-alias - 2D games and Opengl


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 AlbertoT   Members   -  Reputation: 100

Like
Likes
Like

Posted 15 October 2001 - 07:12 AM

One of the reason why I still like to develop 2d games is the possibility to use detailed models which unfortunatly count a lot of polygons . Till now I have been using direct draw. One problem is that I must disable the anti-alias option before rendering otherwise I get an " aura " around the perimeter when blitting the sprite on the background . Suppose I texture a quad with a anti-aliased sprite and I use opengl as a normal 3d game, making sure the transparent part of the texture is not drawn. Will I face the same problem? Thanks in advance

Sponsor:

#2 Obelix   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 October 2001 - 11:04 AM

Almost all 3d games use detailed 2d textures on their models but perhaps will it be different some day...

I do not know what anti-alias option you are writing about but the answer is most likely that it will not affect the texture. If you are showing the texture at the same size and it look right do you probably want to disable texture filtering.

#3 ANSI2000   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 October 2001 - 07:09 PM

Yes you can write a 2d basedengine using OGL as long as you set it to Orthographics perspective and you texture your sprites on quads. You will also get rid of that nasty ora you are talking about. The one that get produces bu the outer edges belding to the background color.

In OGL the background color of your sprites will have to be black. All font system use similar texturing on quand to look nice and smooth Look around see what you get out of it...

#4 Scarab0   Members   -  Reputation: 122

Like
Likes
Like

Posted 15 October 2001 - 10:03 PM

quote:
Original post by ANSI2000
In OGL the background color of your sprites will have to be black. All font system use similar texturing on quand to look nice and smooth Look around see what you get out of it...

That''s not true. When you''re using additive blending yes, but for sprites I''d use TGA files with an alpha channel and GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA blending.



#5 MButchers   Members   -  Reputation: 123

Like
Likes
Like

Posted 15 October 2001 - 10:32 PM

Hi there,

To color mask your better of with

glEnable(GL_ALPHA_TEST);
glAlphaFunc(GL_LESS,0.01);

This is a lot faster than using glBlendFunc and
can be used when rendering both opaque and blended
primitives as GL_BLEND doesnt need to be enabled.

Hope it helps

Mark.


#6 AlbertoT   Members   -  Reputation: 100

Like
Likes
Like

Posted 17 October 2001 - 06:16 AM

Thanks all of you, for your answer but I am not sure I made myself understood .
Sorry, but English is not my mother language.
In other words.
If I render an anti-aliased human figure, using Poser 4 the quality of the bitmap is excellent.
If I blit the bitmap, using direct draw , the quality of the sprite is poor.
I own two direct x game programming books.
They suggest to disable the anti-alias option when rendering the bitmap.
The quality of the sprite improves but of course it is still worse than the original one.
My question is:
If I use Opengl(textured quads) can I expect to create sprites ) at the same level of quality as the original Poser 4 bitmaps?

#7 MButchers   Members   -  Reputation: 123

Like
Likes
Like

Posted 18 October 2001 - 12:45 AM

hi there,

if you dont enable filtering and have a 1:1 ratio with
your quad and texture then you will get ok results,
with no bluring around the edges.

just a tip - if your only using 2d set up the viewing
matrix with gluOrtho2D and use glVertex2i(x,y) or
glVertex2iv(@Pos) for rendering..

Hope it helps

Mark




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS