Category archives: Snaking
Discussions of programming, particularly of programming Python
Hardware Accelerated Video Capture for PyOpenGL
Written by
on
in
Snaking.
The pyopengl-video library is a small hack that lets you pass FrameBufferObjects (FBOs) directly to the local platform video encoding library (or allows you to use your existing video buffer as an FBO, depending on the platform). The purpose of the library is to allow an off-screen renderer to generate h264 in mp4 video previews ...
PyOpenGL 4.0.0a5 -- Significant Changes
Written by
on
in
Snaking.
So now we're starting to cash in on the various changes we've made to PyOpenGL, namely dropping Python 2.7 support and adding the more extensive test suite. The effect of those is that we can create a table-driven dispatch accelerator in OpenGL_accelerate. In plain terms, write a C module that provides the core OpenGL API ...
OpenGL Extrusions (and Tessellation)
Written by
on
in
Snaking.
I've released a new library opengl_extrusions which is a Numpy and Cython library that does 3D extrusions (like the GLE library) and tessellations (one of the things the GLU library does). The motivation being that the GLE library is constrained to compatibility contexts (think "legacy OpenGL"), so it doesn't work under modern core-profile contexts. The ...
OMI Audio extension for glTF
Written by
on
in
Snaking.
Another OMI-based extension, this time for positional audio mixing. Again, Claude-coded, using the OMI/KHR audio extensions for glTF as the base model and then implementing the actual mixing using Numpy. Supports mp3, wav, opus and flac inputs and stereo (headset) outputs. Up on github as omi_audio and on PyPI as omi_audio as well.
This is ...
OMI Physics Extension for glTF
Written by
on
in
Snaking.
I had Claude code up an OMI Physics package using Numpy. It's up on pypi as omi_physics. This follows the OMI extensions to glTF pretty closely to create an engine with the common features you need. It's not trying to be real-world physics, it's just a game engine style simulation.
The core is GL-free, ...
PyVRML97 2.3.4b1
Written by
on
in
Snaking.
Continuing on with the Open Source work. PyVRML97 2.3.4b1 is almost all build and CI process updates. There are a few minor fixes for modern Python's where bool can't be used as a list index and a change for NumPy 2.x array comparison failures. This beta is mostly just so that we can pull it ...
PyOpenGL 4.0.0a1
Written by
on
in
Snaking.
I've been trying to make some time for Open Source projects again. I've been using LLMs for much of the coding because the vast bulk of it at this point is just grunt work. First up is PyOpenGL. The tests the LLM produced turned up a bunch of bugs in the core that have lain ...
Interesting Memory Leak with Python 3.12 for PyOpenGL-accelerate
Written by
on
in
Snaking.
So I'm currently trying to figure out why the PyOpenGL 3.12 test suite is failing. There's a particular test that looks for VBO memory leakage and it looks loosely like this:
for i in range(100):
create_a_vbo_and_delete_it()
calculate_total_process_memory()
assert_no_leak()
which shouldn't ever lose more than a few bytes (limit is set to 200 for this test, ...
Ubuntu 22.04 Python 3.12 pip is broken
Written by
on
in
Snaking.
It seems that we've removed an entry point that pip 22.0 uses from Python 3.12. That means that you need to install pip from get-pip.py on Ubuntu LTS python3.12.
However even with that done and tox supposedly configured to use pip 23.2.1 in its virtualenvs, I still wind up with pip 22.0 in the ...
What is Pythonic Typing for "There exists some plugin that provides an Adapter for X"
Written by
on
in
Snaking.
So starting to think about a PyOpenGL 4.x release, which would be first to drop Python 2.7 support, so the first one where type-hints can be used to declare metadata for type-coercion (vs the current nonstandard type declarations). The first big question that comes up is:
Given an open collection of types {A,B,C,...}
And a ...