[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Re: [pyopengl] glActiveTexture(GL_TEXTURE1) cause failure in my code, can't get the reason why



Hi,

Have a look at the output; the minus one indicates an invalid index, invalid because the variable it points to does not exist in the shader.  Although it doesn't on my machine, perhaps trying to pass the uniform to it causes some error. 

The reason "Texture_1" doesn't exist in the shader is that GLSL optimized it out, because it wasn't used.  If you uncomment the mix command in the fragment shader, you'll see that the index goes away (and for me a nice multitextured teapot starts rotating).

Also note: glGetUniformLocation doesn't have very well-defined operation unless the shader is bound.  Perhaps when you print the locations on line 157, you're inadvertently causing an error later.

Ian