On Nov 30, 9:05 pm, Richard Jones <[email protected]> wrote:
> On Wed, Dec 1, 2010 at 6:15 AM, Jonathan Hartley <[email protected]> wrote:
> > The advantage of using PyOpenGL is that it is generally friendlier &
> > more Pythonic than pyglet's OpenGL bindings
>
> This is certainly true.
>
> > - it performs error
> > checking, making error diagnosis much easier.
>
> By default pyglet performs a gl error check after every call.
>
> > However, this suggests a brilliant compromise: Use PyOpenGL for all
> > your OpenGL calls to begin with. This will be easiest to code and get
> > working. Then, if and when you want to optimise for performance,
> > replace just the half-dozen OpenGL calls inside your innermost render
> > loop with the pyglet bindings. This will give you the max performance,
> > while still allowing you to use friendly PyOpenGL for 95% of your
> > work.
>
> This approach is a little dangerous as it could introduce obscure bugs
> where the translation of PyOpenGL to pyglet isn't done entirely
> correctly.
>
> And of course get the maximum performance by compiling your
> OpenGL-using module using cython ;-)
>
> PyOpenGL also has some cython-based accelerators, but I've not looked
> into where they're used.
>
>     Richard


Hey. Thanks for the corrections, much appreciated.

>From your tone I infer I should beware of intermittent and
unrepeatable problems. I'll add some sort of stress test to my suite,
as a smidgeon of insurance. Other ideas welcome. I assume you're not
going so far as to advise not doing it? Doubling my frame rate is not
to be sniffed at.

Cythoning is going well, in half-hour snatches over breakfast and
lunch! Doubled my frame rate with the low-hanging fruit (type tags in
my inner render loop.) Now I'm doing judicious bits of my matrix
class, which should leave me with 100% 'white' source lines in my
inner render loop ('white' as in the colored output of "cython -a".)
Published results soon.

The "1.5 to 3 times slower than pyglet bindings" I mentioned was
measured using PyOpenGL-accelerate, the Cython module for PyOpenGL. I
may have been doing it wrong. For one thing, Mike expects I'll see
better performance using VBOs and uniforms instead of vertex arrays
and modelview transforms. On the other hand, I expect using those will
also provide better performance with pyglet bindings too.

Cheers,

  Jonathan

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