[PyOpenGL-Users] Difficulty with the shaders tutorial
Brought to you by:
mcfletch
From: Derakon <de...@gm...> - 2012-02-16 18:05:43
|
I'm trying to figure out OpenGL 3. Well, really I'm trying to figure out fragment shaders so I can do a false-color filter for my monochrome camera displays, but the fragment shader tutorial is also an OpenGL 3 tutorial, so it's off the deep end I go. I took a look at the shaders tutorial: http://pyopengl.sourceforge.net/context/tutorials/shader_1.xhtml The first problem I run into is literally a context problem: I have no idea what the high-level structure of the tutorial is because it's broken up into chunks of a few lines at a time separated by explanatory text. That'd be fine if the script were repeated without those interruptions at some point, or if the chunks of program were bigger, but as it stands the code part of the tutorial is very hard to read. The second problem I have is also a context problem: OpenGLContext doesn't exist for me. I have a standard Windows Python 2.7 / PyOpenGL / numpy install. Fortunately I have some prior experience with OpenGL and guess that I can work around this by using WX rendering contexts instead. So I adapt the tutorial script to this standalone program: http://pastebin.com/KWwi1Ahi However, when I run this, I get the following error when the first call to shaders.compileShader is made: OpenGL.error.NullFunctionError: Attempt to call an undefined alternate function (glCreateShader, glCreateShaderObjectARB), check for bool(glCreateShader) before calling Amusingly, calling glGetBoolean(glCreateShader) throws *another* error: KeyError: ('Unknown specifier <OpenGL.platform.baseplatform.glCreateShader object at 0x00000000031360F0>', 'Failure in cConverter <OpenGL.converters.SizedOutput object at 0x0000000002E27748>', (<OpenGL.platform.baseplatform.glCreateShader object at 0x00000000031360F0>,), 1, <OpenGL.wrapper.glGetIntegerv object at 0x000000000305D4C8>) -Chris |