On Sat, Nov 29, 2008 at 9:48 AM, val <[EMAIL PROTECTED]> wrote: > > i'm trying to draw into a context that is bigger than my screen. my > final goal is to get pictures of like 4000*3000px, and my screen is at > most 1440*900.
In general OpenGL isn't suitable for this sort of work -- it's designed for real-time (on-screen) compositing. There are some GPU Gems articles around that describe how to composite into massive images by dividing the final image into a series of 1024x1024 "tiles" and rendering each one separately. The final stitching of the tiles must be done in software though (e.g., you could use PIL). > i've found this link ( > http://pyglet.googlecode.com/svn/trunk/examples/fixed_resolution.py ), > but it seems to be meant to achieve the opposite i want (enlarged > texture), and the way it's coded doesn't help me much (although i may > not have well understood it). Not really a relevant example for your problem. > i've found that i can use pyglet.image.Texture to manipulate data that > isn't the window's size, but i'm not sure i understood it well. > > here's my "screenshot" method: > > def save(self,filename): > texture=pyglet.image.Texture.create(1600,1200,rectangle=True) > > src=pyglet.image.get_buffer_manager().get_color_buffer().get_texture().image_data > texture.blit_into(src,0,0,0) > texture.save(filename) > > the problem is that the output picture has the window resolution, not > the texture's one. i need something to stretch up while > 'blit_into-ing', but can't find it in the doc. You can't stretch with blit_into, as it's just a data copy operation. You need to have something you can composite into in order to scale with OpenGL, such as a framebuffer. Since on-screen framebuffers are (more or less) limited to your screen resolution, you'll need a texture framebuffer (FBO with texture attachment). pyglet doesn't have any support for this, you'll need to delve into the OpenGL calls yourself. I believe the cocos2d people use FBOs in this way, there's probably some sample code there. 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 -~----------~----~----~----~------~----~------~--~---
