Anti-alias - 2D games and Opengl
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
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.
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.
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...
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...
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.
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.
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.
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?
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?
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
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
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement