On Apr 10, 7:42 pm, "Alex Holkner" <[EMAIL PROTECTED]> wrote:
> On 4/11/08, Richard Jones <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> >  On Fri, 11 Apr 2008, Michael Halle wrote:
> >  > In looking through the sprite code, I saw that computed vertices get
> >  > rounded off to ints, and then passed in integer form to OpenGL.  This
> >  > process happens even when the sprite is scaled and rotated, where
> >  > vertices would in general not fall on pixel boundaries.
>
> >  > Seems like for small sprites, noticeable distortion or bad packing could
> >  > happen.
>
> > So this is something you've not actually observed?
>
> >  > As far as I know, graphics cards usually use floats internally anyway --
> >  > are there real performance hits in removing the rounding and just
> >  > passing the floats down to OpenGL?
>
> > The rounding is not done for performance.
>
> >  More often than not you'll get artifacts and fuzziness on raster graphics 
> > if
> >  they're not pixel-aligned. The most common artifact is flickering border
> >  where pixels bleed in from adjacent images (in the same texture).
>
> Even without adjacent images, you'll get this flicker as any high
> frequency parts of the texture (lines, for example) pass in and out of
> pixel alignment.
>
> I've been thinking about providing a SubpixelSprite class, which would
> use v2f instead of v2i for coordinates.  The onus on deciding which is
> appropriate (e.g. for scaled/rotated sprites it really isn't a
> problem) is on the developer.

Might this be better done as a mode for the existing sprite class?  I
could see advantages either way.

Thanks.

--Mike


--~--~---------~--~----~------------~-------~--~----~
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