mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-12 09:11:18 -05:00
26 lines
1.3 KiB
Text
26 lines
1.3 KiB
Text
vec2 xll_vecTSel (bvec2 a, vec2 b, vec2 c) {
|
|
return vec2 (a.x ? b.x : c.x, a.y ? b.y : c.y);
|
|
}
|
|
vec3 xll_vecTSel (bvec3 a, vec3 b, vec3 c) {
|
|
return vec3 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z);
|
|
}
|
|
vec4 xll_vecTSel (bvec4 a, vec4 b, vec4 c) {
|
|
return vec4 (a.x ? b.x : c.x, a.y ? b.y : c.y, a.z ? b.z : c.z, a.w ? b.w : c.w);
|
|
}
|
|
mediump vec4 xlat_main( in highp vec4 uv );
|
|
mediump vec4 xlat_main( in highp vec4 uv ) {
|
|
highp vec4 a;
|
|
a = vec4( 0.000000);
|
|
a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000));
|
|
a += xll_vecTSel (greaterThan( uv, vec4( 0.500000, 0.500000, 0.500000, 0.500000)), vec4( 1.00000, 2.00000, 3.00000, 4.00000), vec4( 5.00000, 6.00000, 7.00000, 8.00000));
|
|
a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000));
|
|
a += xll_vecTSel (greaterThan( uv, vec4( 0.500000 )), vec4( 1), vec4( 2));
|
|
a += xll_vecTSel (bvec4( fract( uv ) ), vec4( 1.00000, 1.00000, 1.00000, 1.00000), vec4( 2.00000, 2.00000, 2.00000, 2.00000));
|
|
return a;
|
|
}
|
|
varying highp vec4 xlv_TEXCOORD0;
|
|
void main() {
|
|
mediump vec4 xl_retval;
|
|
xl_retval = xlat_main( vec4(xlv_TEXCOORD0));
|
|
gl_FragData[0] = vec4( xl_retval);
|
|
}
|