by reducing my setup to a small testcase i found the culprit by
accident!
consider this code:
import pyglet
class Window(pyglet.window.Window):
def __init__(self):
super(Window, self).__init__(800, 600, resizable=True,
vsync=False )
self.fps = pyglet.clock.ClockDisplay()
pyglet.clock.schedule(lambda dt: None)
atlas1 = pyglet.image.atlas.TextureAtlas(width=2048,
height=2048)
atlas2 = pyglet.image.atlas.TextureAtlas(width=1024,
height=1024)
#atlas2 = pyglet.image.atlas.TextureAtlas(width=2048,
height=2048)
group1 = pyglet.graphics.TextureGroup(atlas1.texture)
group2 = pyglet.graphics.TextureGroup(atlas2.texture)
tile1 = atlas1.add(pyglet.image.load(None,
file=pyglet.resource.file('data/tiles/grass/1.png')))
tile2 = atlas2.add(pyglet.image.load(None,
file=pyglet.resource.file('data/tiles/grass/1.png')))
self.batch = pyglet.graphics.Batch()
vertex_list = []
vertex_list.append(self.batch.add(4, pyglet.gl.GL_QUADS,
group1,
('v2i', [0, 0, 32, 0, 32, 32, 0, 32]),
('t3f', tile1.tex_coords),
('c4B', (255,255,255,255)*4)))
vertex_list.append(self.batch.add(4, pyglet.gl.GL_QUADS,
group2,
('v2i', [32, 0, 64, 0, 64, 32, 32, 32]),
('t3f', tile2.tex_coords),
('c4B', (255,255,255,255)*4)))
def on_draw(self):
pyglet.gl.glClear(pyglet.gl.GL_COLOR_BUFFER_BIT)
self.batch.draw()
self.fps.draw()
window = Window()
pyglet.app.run()
you only need one small 32x32 tile for this to test.
this will run at 500fps for me.
but then when i uncomment the texture atlas line and have another
2048x2048 texture - it drops from 500fps to 40fps!!
all other texture atlas size combinations work - only two times
2048x2048 gives this strange performance drop!
why is that?
it seems that i have to think about rearranging my map objects....
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---