On 10/7/08, josch <[EMAIL PROTECTED]> wrote:
>
>  okay i did try out other setups but still no luck....
>  when i try to glScalef() a scene that shows up perfectly fine unscaled
>  to any other value than the original size those pesky borders will
>  show up...
>  http://rabenfrost.net/josch/heroes/faulty.png (now hosted on my own
>  server as google seems to complain about free image hoster urls
>  here :/ )
>  i am out of ideas :(
>  maybe ragzouken has a solution but he didnt show up on irc lately
>  maybe alex can point out what i do wrong in the testcase in my post
>  above?
>

When OpenGL draws the edge pixels of each tile, it samples the edge
texel of that tile, and combines it with the adjacent texel ("bilinear
filtering").  Depending on how you're loading your images with pyglet,
you're likely to have just zeroed data (black) outside of the tile
image, which is why you're getting dark borders.

You need to ensure there's enough data for OpenGL to sample, even at
the edges.  You can do this by creating tile images of size 34x34 for
when you intend to draw images at 32x32.  Then use get_region (or
fiddle with the texture coordinates yourself) to draw the part of the
image from 1x1 to 33x33.

Ideally pyglet would be able to automatically "inflate" the borders of
images like this to save you a trip into your image editor; but the
current lack of pixel-level operations on images would make this quite
a pain to implement.

Alex.

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