#version 300 es #define gl_FragData _glesFragData layout(location = 0) out mediump vec4 _glesFragData[1]; struct v2f { highp vec4 pos; mediump vec2 uv; }; struct u2v { highp vec4 vertex; mediump vec2 texcoord; }; const mediump vec3[3] ha = vec3[3]( vec3( 1.0, 2.0, 3.0), vec3( 4.0, 5.0, 6.0), vec3( 7.0, 8.0, 9.0)); const highp vec3[3] fa = vec3[3]( vec3( 11.0, 12.0, 13.0), vec3( 14.0, 15.0, 16.0), vec3( 17.0, 18.0, 19.0)); mediump vec4 frag( in v2f i ) { mediump vec3 h = vec3( 0.0); highp vec3 f = vec3( 0.0); highp vec3 p = vec3( i.uv.xy, 1.0); highp int j = 0; for ( ; (j < int((i.uv.x * 3.0))); (j++)) { h += ha[j]; f += fa[j]; f += (p * ha[0]); f += (ha[1] * p); } return vec4( h.xy, f.xy); } in mediump vec2 xlv_TEXCOORD0; void main() { mediump vec4 xl_retval; v2f xlt_i; xlt_i.pos = vec4(0.0); xlt_i.uv = vec2(xlv_TEXCOORD0); xl_retval = frag( xlt_i); gl_FragData[0] = vec4(xl_retval); }