Batching makes a huge difference. As an example, I made a prototype
for a platformer game. I started without using batches, and the
program was running under 60fps after a few sprites already. Batching
them up made a difference right away giving 200fps, which it was the
same as not drawing any sprites at all.

Primitives can be batches just as easily. Read the programmers guide
on the pyglet.org site if you haven't already, and if you have, I
suggest you read it again ;). Specifically the vertex lists and such,
and check out the API on the pyglet.graphics module as well.

On 10 Apr, 21:21, Jack Edge <yellowboun...@gmail.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> So how much benefit does batching things do? Currently I've got a
> working prototype of a program that displays news as bubbles (which will
> be under the GPL when I'm done), but every time it's drawing more than
> about four circles, it starts getting really choppy. To each circle
> there are two additional children, an outline, and a label.
>
> I'm not sure how to draw circles using raw OpenGL polygons (or
> something) at the moment, using someone else's program. Would batching
> stuff together work, and what would I batch together?
>
>
>
> Braindamage wrote:
> > Basically, when you load something to a batch, you add the sprite's
> > information into your video-card memory. The batch itself is a list in
> > the hardware memory that only needs a single software command to be
> > sent to the video-card for it to be drawn. You can do it yourself
> > using OpenGL's display lists; batches just do it all for you in a very
> > very convenient manner.
> > Loading things into video memory requires more communication with the
> > video-card which makes things a lot slower, and migrating between
> > batches requires everything to be reloaded.
>
> > Simply put, and if you require further depth on the subject you'll
> > probably need to read about OpenGL and how video-cards work.
>
> > On 10 Apr, 12:26, Somelauw <somel...@yahoo.com> wrote:
> >> Can someone explain how batches work. I know that sprites which have
> >> been added to a batch, will be drawn faster. But can someone explain
> >> why those sprites will be drawn faster and why you shouldn't migrate
> >> sprites between batches.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
> Comment: Using GnuPG with Mozilla -http://enigmail.mozdev.org
>
> iEYEARECAAYFAknfmzEACgkQNlpSw5BzYdc1EwCgzZg3JS9dhFSdjYecDBj//AMJ
> RaQAoPdbmCX567K7tQYQpBKD/HTRX/H9
> =2a2V
> -----END PGP SIGNATURE-----
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to pyglet-users@googlegroups.com
To unsubscribe from this group, send email to 
pyglet-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to