/* fragment shader */
void main(void)
{
highp vec3 color;
highp float tx;
highp float ty;
highp vec3 sptr_k;
highp float fsum_r;
highp float fwsum;
highp float value;
highp float w;
highp float stepvalue = 1.0;
int i = 1;
highp float fstep = 2.0;
tx = 1.0 / 720.0;
ty = 1.0 / 720.0;
fstep = fstep * tx;
color.r = texture2D(sampler2DBase, v_baseTexCoord).r;
fsum_r = 0.0;
fwsum = 0.0;
sptr_k.r = color.r;
fwsum = fsum_r + 0.1; // if deleting it works.
fwsum = 1.0 / fwsum;
color.r = clamp(fsum_r * fwsum, 0.0, 1.0);
color.g = color.r;
color.b = color.r;
gl_FragColor = vec4(color.rgb, 1.0);
}
我的问题:
glGetShaderInfoLog
。fwsum = fsum_r + 0.1;
后,片段着色器可以正常工作。