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

Re: [pygame] (pyopengl) GLSL fragment shader with arrays uniform cause sporadic screen blinking



My laptop also has a 945gm so I can't test this until I get to my desktop (although glsl shaders will work on os x with a 945gm, intel only supports arb shaders in windows opengl). 

The http://bpaste.net/show/13617/ is not the same because the glsl compiler will usually compile out (make inactive) all of your uniforms since you aren't referencing them in the shader. I often find this very annoying for testing.  I've often had problems with arrays in glsl, and never got them to work correctly in os x. You could try using a 1D texture lookup if the arrays are the problem. 

I don't really understand what you are trying to do in your pixel shader, you could get rid of all of the else's and just put gl_FragColor at the end of main and it would have the same effect. Your loop just changes the final uv, so in effect you don't even need a for loop because your code will always just make the end color by using imax-1. Everything else gets overwritten.

Devon

On Fri, Feb 11, 2011 at 12:37 PM, amdlintuxo <amdlintuxos@xxxxxxxxx> wrote:
Hi all.

Strange sporadic screen blinking when using array uniform variables in
fragment shader.
Unfortunately i have only one HW config to test this(maybe the problem
is in my HW)

The strange is:
The problem occurs with shader
http://bpaste.net/show/13616/
even if i pass empty arrays into it (imax = 0), so actually shader
should do any distortion work.

And the problem DOES NOT occur with shader
http://bpaste.net/show/13617/

So it has to be something in my shader, but i was thought that code
http://bpaste.net/show/13617/ is the same as (http://bpaste.net/show/
13616/
+ if imax = 0)
But why screen blinking occurs? Actually without uniform arrays, by
passing only simple uniform shader works great.

Full code is here:
http://bpaste.net/show/13615/

Could some one test the full code or provide the idea what can cause
sporadic screen blinking.
Looking forwards for you support, i have nothing left to try to
resolve this problem, struggling third day, no luck. Maybe this
blinking is my HW config problem.