0
votes

In my Vertex Shader, I created :

attribute vec2 a_varytest;              
varying  vec2 v_varytest;

and set the value:

v_varytest=a_varytest;

In my Fragment Shader, I created:

varying  vec2 v_varytest;

The problem is:

When I set the value of attribute "a_varytest" between 0.0 and 1.0 in my main application, the interpolating works fine. But When I set it to 10.0, I get a black scene. It seems Varyings in fragment shader can not bigger than 10.0, or the interpolating won't work.

I test the value of the varying v_varytest. It is always be 2.0. So, It seems when value of a Varying is bigger than 10.0, the interpolating won't happen, and the value is set to 2.0 automatically.

Someone tell me the reason.

1

1 Answers

0
votes

I found the reason, i have:

precision lowp float;                   

in my code, so the precision of float is only 8 bytes.

I commented that line, it works again.