Re: Pixel Art

168 views
Skip to first unread message

Richard Jones

unread,
Jun 3, 2013, 12:10:39 AM6/3/13
to pyglet-users
You can force OpenGL to retain pixelated art using GL_NEAREST texture filtering:



     Richard


On 3 June 2013 13:41, Brian Soulliard <bcsou...@gmail.com> wrote:
Hello,

I'm considering using Pyglet for my next game. The graphics will be made in low-resolution pixel art. When Pyglet scales the graphics, it makes them blurry, which looks terrible. Is there a clean way to scale the graphics without any pixel interpolation?

Thanks,
Brian Soulliard

--
You received this message because you are subscribed to the Google Groups "pyglet-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pyglet-users...@googlegroups.com.
To post to this group, send email to pyglet...@googlegroups.com.
Visit this group at http://groups.google.com/group/pyglet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Nathan

unread,
Jun 9, 2013, 4:54:21 PM6/9/13
to pyglet...@googlegroups.com
Hey, thanks for having this discussion!  I had been trying to figure this exact thing out for some time.  In my case, I just want my entire program to stay pixelated.  I added a post on the discussion you linked to, but for convenience I'll repeat it here:

----------
Thank you for this post!!  For those like me, who are simply making a retro-style game where they want EVERYTHING scaled to be pixelated, the simple quick answer is start your code with:

    from pyglet.gl import *
    glEnable(GL_TEXTURE_2D)
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)

And then all your usage of sprites, etc. from there on out stay nice and pixellated.  No blurring!
--------

Brian, I would guess that making this change globally like I am would affect your animated sprites and bitmap fonts as well.  I don't know for sure though, since I don't use either.

~ Nathan


On Mon, Jun 3, 2013 at 5:46 PM, Brian Soulliard <bcsou...@gmail.com> wrote:
Thanks. I'll try that out. How will that interact with animated sprites? Is there a similar technique for scaling bitmap fonts?


Brian Soulliard

unread,
Jun 9, 2013, 5:05:17 PM6/9/13
to pyglet...@googlegroups.com
Thanks a lot for the tip! I'll give it a shot and let you know how it goes.


--
You received this message because you are subscribed to a topic in the Google Groups "pyglet-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pyglet-users/GUG6a-kpbFg/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to pyglet-users...@googlegroups.com.

anatoly techtonik

unread,
Jun 19, 2013, 3:38:11 AM6/19/13
to pyglet...@googlegroups.com, bcsou...@gmail.com
On Monday, June 10, 2013 12:05:17 AM UTC+3, Brian Soulliard wrote:
Thanks a lot for the tip! I'll give it a shot and let you know how it goes.

Soo.. How it goes? =)
Reply all
Reply to author
Forward
0 new messages