Thanks, Tristam.  I tried all that, and double-checked my math, but it still
looked a little off.

I was just able to fix it, though.  The problem was in my cocos2d
initialization.  I apologize for not mentioning I was using that library in
my original post.  I started looking at the cocos2d director code after
exhausting the other options, and realized it was scaling the projection
matrix.  I added `do_not_scale=True` to the director instantiation, and the
sprites are now being drawn without any "blurriness".

From: Tristam MacDonald <[email protected]>
> Date: Oct 27, 10:31 pm
> Subject: Pixel perfect sprite rendering
> To: pyglet-users
>
>
> On Wed, Oct 27, 2010 at 11:04 PM, Mike Wyatt
> <[email protected]>wrote:
>
> > I'm rendering a hex map with a batched set of sprites (one per cell).
>  The
> > batch looks pretty good, but on close inspection I can see that the
> pixels
> > are not rendered exactly as the source image.
>
> > Here's a image with the original image and a small cropped view of a few
> > rendered sprites in the hex grid:
> >http://img830.imageshack.us/img830/812/hexes.png
>
> Are you sure you didn't create a multi-sample context and request
> anti-aliasing? That looks a bit like it could be anti-aliasing on the
> polygon edges.
>
> Also make sure that you disable both GL_LINE_SMOOTH and
> GL_POLYGON_SMOOTH,
> just in case something else had enabled them.
>
> > I'm guessing I either need to adjust the modelview transformation or
> change
> > some gl* setting.  I've played around with GL_TEXTURE_MIN_FILTER and
> > GL_TEXTURE_MAG_FILTER and glHint, but haven't had any luck.
>
> For testing, set both your MIN and MAG filters to GL_NEAREST, to
> prevent any
> chance of bilinear interpolation.
>
> How can I fix this?
>
>
>
> If none of the above did the trick, then double check your math - you
> might
> have introduced rounding error somewhere...
>
> --
> Tristam MacDonaldhttp://swiftcoder.wordpress.com/

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to