[gameprogrammer] Re: loading images in OpenGL without blending
- From: Olof Bjarnason <olof.bjarnason@xxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Thu, 23 Jun 2005 21:33:47 +0200
if you want a more pixel accurate render technique using OpenGL, try:
1. changing the glTexParameter() from GL_LINEAR to GL_NEAREST.
2. Are you zooming in/out at all? If not, do not use mipmaps
3. try to draw all quads with EXACTLY the same dimensions as the
corresponding tile.
4. Remember that integer coordinates are located in the CENTER of
pixels under orthonormal projection in opengl.
If I were you, I would begin by making sure I could draw a 2x2 single
colored quad a certain pixel location (try at (0,0) and (638,478) if
you are in 640x480 mode), then you would know if you got your "pixel
correctness". Then it would be easy to extend to a whole tile/quad.
Good luck!
/Olof
On 6/23/05, Robbert de Groot <zekaric@xxxxxxxx> wrote:
> Either include a 'gutter' around the tiles, a technique that is used
> when when mip mapping, or don't use the transitioning/blending. You
> may be able to avoid it a little by insetting the edges of the uv map
> but I wouldn't think so. gutter is about the only sure way to avoid
> the problem.
>
> --- Alan Wolfe <alan.wolfe@xxxxxxxxx> wrote:
>
> > Hey everyone,
> >
> > I'm making a 2d side scroller in opengl and i have several images
> > that
> > are just grids of sprites.
> >
> > With the "blending" that opengl does to smooth out pixelated art,
> > frames tend to blend into eachother a little bit so when i want to
> > draw 1 frame of a character, off to an edge it will have a faint
> > line
> > from the next character over.
> >
> > Does anyone know how to turn off this image blending so that it
> > keeps
> > it more pixel accurate? In this case also i want to keep the
> > pixelated look (:
> >
> > I've checked google, asked on irc etc but so far no luck
> >
> >
> > ---------------------
> > To unsubscribe go to http://gameprogrammer.com/mailinglist.html
> >
> >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
>
> ---------------------
> To unsubscribe go to http://gameprogrammer.com/mailinglist.html
>
>
>
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- References:
- [gameprogrammer] loading images in OpenGL without blending
- From: Alan Wolfe
- [gameprogrammer] Re: loading images in OpenGL without blending
- From: Robbert de Groot
Other related posts:
- » [gameprogrammer] loading images in OpenGL without blending
- » [gameprogrammer] Re: loading images in OpenGL without blending
- » [gameprogrammer] Re: loading images in OpenGL without blending
- [gameprogrammer] loading images in OpenGL without blending
- From: Alan Wolfe
- [gameprogrammer] Re: loading images in OpenGL without blending
- From: Robbert de Groot