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

Re: [pygame] Shader Demo



0 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
1 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
2 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
3 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
4 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
5 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
6 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
7 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
8 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
9 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
10 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
11 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
12 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
13 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
14 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
15 Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.
Fragment shader(s) were not successfully compiled before
glLinkProgram() was called.  Link failed.

Doesn't give much more to go on :P

I wonder what is wrong with the shaders/my system that they aren't compiling?

Here is the first generated shader:

        varying vec3 normal,lightdir,lightposnormalized,halfvector,lightVec;
        varying vec3 blah;
        varying float dist;
        uniform sampler2D tex1,tex2,tex3,tex4,tex5,tex6,tex7;
        uniform sampler2D normalmap;
        uniform sampler2DShadow
shadtex1,shadtex2,shadtex3,shadtex4,shadtex5,shadtex6;


        vec4 fog(vec4 color)
        {
            float z = gl_FragCoord.z / gl_FragCoord.w;
            z = clamp((z-2.0)/5.0,0.0,1.0);
            float oneminusz = 1.0 - z;
            color =
vec4((color[0]*oneminusz)+(1.0*z),(color[1]*oneminusz)+(1.0*z),(color[2]*oneminusz)+(1.0*z),1.0);
            return color;
        }
        vec4 cartoon(vec4 color, int steps)
        {
            float grey = (color.r+color.g+color.g)/3.0;
            float steps2 = float(steps);
            float intensity = float(floor(grey*steps2))/steps2;
            color = vec4(intensity*color.rgb,color.a);
            return color;
        }
        vec4 outline(in vec4 color, in float threshhold, in vec4
setcolor, in float normz)
        {
            if (normz < threshhold) {
                return setcolor;
            }
            return color;
        }
        vec4 tex(sampler2D texture, vec2 uv=gl_TexCoord[0].st)
        {
            return texture2D(texture,uv);
        }

        void main()
        {
            vec3 n = normalize(normal);

            //color
            vec4 color = vec4(0.0,0.0,0.0,1.0);

            //clamp color
            color = clamp(color,0.0,1.0);

            //set color
            gl_FragColor = color;
        }

It's all greek to me, I don't see anything obviously wrong.  It could
be a problem with the pyopengl binding on my system, that's my guess.
I can play the latest of the latest games so I definitely have shader
support.