Re: Difficulty with the shaders tutorial

Derakon <[email protected]>
Newsgroups gmane.comp.python.opengl.user
Message-ID <CA+Qo5j7oky6252v+bM8VPLRH4Lurqf70oSe0dh8VzBpc5bbSUw@mail.gmail.com>
On further investigation, those functions weren't available because I
didn't have an OpenGL context yet. My bad. Moving the set-up to later
on in the program (the first paint call) instead gives these errors:

RuntimeError: ('Shader compile failure (0): 0(3) : error C7533: global
variable gl_ModelViewProjectionMatrix is deprecated after version
120\n0(3) : error C7533: global variable gl_Vertex is deprecated after
version 120\n', ['#version 330\n            void main() {\n
    gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;\n
  }'], GL_VERTEX_SHADER)

Feel free to correct me, but it looks like this means that the
tutorial is using deprecated concepts? GL_VERSION is 3.3.0 and
GL_SHADER_VERSION is "3.30 NVIDIA via Cg compiler", for what it's
worth.

-Chris

On Thu, Feb 16, 2012 at 10:05 AM, Derakon <[email protected]> wrote:
> 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

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
PyOpenGL Homepage
http://pyopengl.sourceforge.net
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.