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

[pygame] Data transferring from main python program to GLSL shader not happens in my case



Greetings all.

Yesterday i am starting to probe how shaders works. I have aim to
write shockwave effect using shader. I was using both tutorials to
understand how it works:
1) http://www.pygame.org/wiki/GLSL_ARB_Example?parent=GLSLExample
2) http://pyopengl.sourceforge.net/context/tutorials/shader_3.xhtml

Looks like i am stuck with data transferring from main python program
to shader.
Here is code http://bpaste.net/show/13321/
Be aware that running of this code return blank screen (black
background with black square)

It has to be something wrong in my call:
gl.glUniform1f(gl.glGetUniformLocation(program, 'end_fog'), 200)
gl.glUniform4f(gl.glGetUniformLocation(program, 'fog_color'),
1,1,1,1)
because if i manually set these values(checked with fog_color) inside
shader, then it works (at least the color of square is not black
anymore).

Looking forward for you help. Also wanted to say great thanks for
great stuff (pyopengl, pygame, python) which all makes my child-dream
comes true.


Cheers, Alex