Archive for the Twisted Pair Category

Compiling Python on Ubuntu / Linux

Posted in Twisted Pair with tags , , , , on 2012/09/25 by Adam Griffiths

I’ve been having problems installing Python on my Ubuntu machine because of errors with setup tools.

During installation you get the following error:

Installing distribute into /home/ting/.pythonbrew/pythons/Python-2.7.3
ERROR: Failed to install setuptools. See /home/ting/.pythonbrew/build.log to see why.
Skip installation of setuptools.

And if you try and use pip / easy_install, you get this:

ImportError: No module named setuptools

It turns out the answer is simple, we’re missing some libraries required to compile it.

sudo apt-get build-dep python2.7

BAM! Pythonbrew works!

Advertisements

PyGLy steps into the future

Posted in Development, PyGLy, Twisted Pair with tags , , , , , on 2012/09/21 by Adam Griffiths

I’ve been working quite heavily on PyGLy for the last few weeks and I’m incredibly pleased to announce that PyGLy is now OpenGL 3 clean!

It took more work than I hoped. Not because of PyGLy (it was already pretty good), but Pyglet’s OpenGL Core (3+) support on OS-X, is well… broken.
I had to integrate a patch written by someone else and patch out 2 of the window event handlers.
The main reason for this is that OpenGL Core on OS-X is limited to 3.2, and is Core only (no legacy compatibility).
These changes can be found in my Github repository.

Pyglet isn’t without it’s problems. It is quite heavy weight in places. There is no support for float or 1D textures.
Other problems are it’s usage of legacy calls. These are scattered throughout the code base and prevent me from using even the Label or VertexList classes.
I would LOVE to help with the development of Pyglet… but I find the code… very confusing.
It’s got a fair amount of abstraction. Tracing even a vertex buffer blows my mind.

Regardless, I hope these issues will be fixed soon.

OpenGL and GLSL support in OS-X

Posted in Twisted Pair with tags , , , , on 2012/08/13 by Adam Griffiths

I had difficulty finding the supported OpenGL and GLSL versions in OS-X.
Using Pyglet, I get errors trying to use versions GLSL 1.30 and above. Printing out the version returns 1.20.

from ctypes import *
from pyglet.gl import *

print "OpenGL version", gl_info.get_version()

plain = string_at(glGetString(GL_SHADING_LANGUAGE_VERSION)).split(' ')[0]
major, minor = map(int, plain.split('.'))
version = major*100 + minor
print "GLSL Version",version

Looking around I found this information.
Mac OS-X OpenGL Support

Legacy would infer the “Fixed Function Pipeline” and Core would be modern OpenGL.
So it seems that legacy OpenGL (normal Pyglet) is stuck with GLSL 1.20 and Core has 1.50.

This code can be found on the Pyglet source repository that enables OpenGL 3 (Core).
Enable OpenGL 3 in Pyglet

But the ouput I get is not correct.

OpenGL version 2.1 ATI-1.0.25
GLSL Version 120

According to this conversation, it appears that Pyglet ignores the OpenGL version on OS-X currently.

PyGLy Progress

Posted in Development, Twisted Pair with tags , , , on 2012/07/06 by Adam Griffiths

Work on PyGLy is progressing well. The code is better designed and cleaner than I’d hoped, so I’m very pleased.

I’m wanting to keep PyGLy thin, so not much more new functionality will be added. New features will go into higher level projects that sit on top.

I tried some NumPy optimisations with BLAS and other libs, but haven’t seen much improvement. Biggest change was running Python with ‘-O’, which got me another 10 FPS.

Dev continues!

Initial release of PyGLy

Posted in Development, Programming, Twisted Pair with tags , , , , on 2012/03/07 by Adam Griffiths

It’s a pretty big day for us, as I’m pushing my labor of love, PyGLy, to GitHub.

PyGLy is a 3D framework developed in pure python.

I’ve been dismayed at the state of game frameworks on Python.

There are a large number of quality 3D engines and frameworks out there. However, there are serious problems with the ‘engines’ out there that have Python bindings.

  • Not truly cross-platform (this is Python FFS!).
  • Not free.
  • Not maintained.
  • No documentation (the worst culprit).
  • Bindings are 2nd class citizens and you still need to code C/C++/Whatever.
  • Don’t work with latest versions of code.

Most engines have bindings created by the community. The problem is these are quickly dumped when the person moves on.

Python only 3D engines seem… well… stagnant.

  • PySoya and PySoy seem to be seething at each other but not really producing much.
  • PyGame is just SDL in disguise.
  • The rest… well they all 404 now.

For the most part, 3D game development on Python is dead.

So, behind the scenes, I’ve been writing my own 3D framework for Python, PyGLy.

“Framework” is an important word there. PyGLy does not force any one methodology on you. PyGLy simply provides functionality to wrap common functionality. Windows, Viewports, Scene Graph Nodes, Cameras. It’s up to you to put them together how you want.

Obviously some things are going to be coupled together. But for the most part, PyGLy just gets out of the way.

At the moment PyGLy is quite small, but it is in active development and already has features that may interest some.

I think the best case for it at the moment is for people wanting to rapidly prototype in 3D but not be abstracted from the rendering process. PyGLy lets you forget about the scene graph and just concentrate on rendering your objects. Rendering is performed via callbacks. You can make any OpenGL call you want in these callbacks.

PyGLy is the foundation of our Python 3D work, so expect it to be actively developed going forward.

The following are some of the things that we’re wanting to add in the future:

  • Shadowing.
  • Scene management (Octree, etc).
  • Cocos2D integration (CCLayer).
  • Separate OpenGL 3+ path.

As we’ve said before, Twisted Pair are true believers of Open Source, so you can find PyGLy on our GitHub repository under a very liberal license.

The re-re-rising

Posted in Twisted Pair with tags on 2012/01/16 by Adam Griffiths

Twisted Pair are back at work full-time.

Shock goes Open Source

Posted in Development, Shock, Twisted Pair with tags , , , , , , on 2011/12/04 by Adam Griffiths

Today marks a historic day for Twisted Pair, as we release the full source code to the Shock C++ Cross-Platform library.

The project files and Socket module are currently missing.

When I get time, I’ll take a day to create the project files for MSVC, Eclipse and XCode.

Look out for PyGLy, our Python graphics library, on GitHub soon.

%d bloggers like this: