mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
350 lines
6.4 KiB
Text
350 lines
6.4 KiB
Text
varying vec4 xlv_TEXCOORD0;
|
|
float xll_mod (
|
|
in float x_1,
|
|
in float y_2
|
|
)
|
|
{
|
|
float f_3;
|
|
float d_4;
|
|
float tmpvar_5;
|
|
tmpvar_5 = (x_1 / y_2);
|
|
d_4 = tmpvar_5;
|
|
float tmpvar_6;
|
|
tmpvar_6 = abs (d_4);
|
|
float tmpvar_7;
|
|
tmpvar_7 = fract (tmpvar_6);
|
|
float tmpvar_8;
|
|
tmpvar_8 = (tmpvar_7 * y_2);
|
|
f_3 = tmpvar_8;
|
|
float tmpvar_9;
|
|
if ((d_4 >= 0.0)) {
|
|
tmpvar_9 = f_3;
|
|
} else {
|
|
tmpvar_9 = -(f_3);
|
|
};
|
|
return tmpvar_9;
|
|
}
|
|
|
|
vec2 xll_mod (
|
|
in vec2 x_10,
|
|
in vec2 y_11
|
|
)
|
|
{
|
|
vec2 f_12;
|
|
vec2 d_13;
|
|
vec2 tmpvar_14;
|
|
tmpvar_14 = (x_10 / y_11);
|
|
d_13 = tmpvar_14;
|
|
vec2 tmpvar_15;
|
|
tmpvar_15 = abs (d_13);
|
|
vec2 tmpvar_16;
|
|
tmpvar_16 = fract (tmpvar_15);
|
|
vec2 tmpvar_17;
|
|
tmpvar_17 = (tmpvar_16 * y_11);
|
|
f_12 = tmpvar_17;
|
|
float tmpvar_18;
|
|
if ((d_13.x >= 0.0)) {
|
|
tmpvar_18 = f_12.x;
|
|
} else {
|
|
tmpvar_18 = -(f_12.x);
|
|
};
|
|
float tmpvar_19;
|
|
if ((d_13.y >= 0.0)) {
|
|
tmpvar_19 = f_12.y;
|
|
} else {
|
|
tmpvar_19 = -(f_12.y);
|
|
};
|
|
vec2 tmpvar_20;
|
|
tmpvar_20.x = tmpvar_18;
|
|
tmpvar_20.y = tmpvar_19;
|
|
return tmpvar_20;
|
|
}
|
|
|
|
vec3 xll_mod (
|
|
in vec3 x_21,
|
|
in vec3 y_22
|
|
)
|
|
{
|
|
vec3 f_23;
|
|
vec3 d_24;
|
|
vec3 tmpvar_25;
|
|
tmpvar_25 = (x_21 / y_22);
|
|
d_24 = tmpvar_25;
|
|
vec3 tmpvar_26;
|
|
tmpvar_26 = abs (d_24);
|
|
vec3 tmpvar_27;
|
|
tmpvar_27 = fract (tmpvar_26);
|
|
vec3 tmpvar_28;
|
|
tmpvar_28 = (tmpvar_27 * y_22);
|
|
f_23 = tmpvar_28;
|
|
float tmpvar_29;
|
|
if ((d_24.x >= 0.0)) {
|
|
tmpvar_29 = f_23.x;
|
|
} else {
|
|
tmpvar_29 = -(f_23.x);
|
|
};
|
|
float tmpvar_30;
|
|
if ((d_24.y >= 0.0)) {
|
|
tmpvar_30 = f_23.y;
|
|
} else {
|
|
tmpvar_30 = -(f_23.y);
|
|
};
|
|
float tmpvar_31;
|
|
if ((d_24.z >= 0.0)) {
|
|
tmpvar_31 = f_23.z;
|
|
} else {
|
|
tmpvar_31 = -(f_23.z);
|
|
};
|
|
vec3 tmpvar_32;
|
|
tmpvar_32.x = tmpvar_29;
|
|
tmpvar_32.y = tmpvar_30;
|
|
tmpvar_32.z = tmpvar_31;
|
|
return tmpvar_32;
|
|
}
|
|
|
|
vec4 xll_mod (
|
|
in vec4 x_33,
|
|
in vec4 y_34
|
|
)
|
|
{
|
|
vec4 f_35;
|
|
vec4 d_36;
|
|
vec4 tmpvar_37;
|
|
tmpvar_37 = (x_33 / y_34);
|
|
d_36 = tmpvar_37;
|
|
vec4 tmpvar_38;
|
|
tmpvar_38 = abs (d_36);
|
|
vec4 tmpvar_39;
|
|
tmpvar_39 = fract (tmpvar_38);
|
|
vec4 tmpvar_40;
|
|
tmpvar_40 = (tmpvar_39 * y_34);
|
|
f_35 = tmpvar_40;
|
|
float tmpvar_41;
|
|
if ((d_36.x >= 0.0)) {
|
|
tmpvar_41 = f_35.x;
|
|
} else {
|
|
tmpvar_41 = -(f_35.x);
|
|
};
|
|
float tmpvar_42;
|
|
if ((d_36.y >= 0.0)) {
|
|
tmpvar_42 = f_35.y;
|
|
} else {
|
|
tmpvar_42 = -(f_35.y);
|
|
};
|
|
float tmpvar_43;
|
|
if ((d_36.z >= 0.0)) {
|
|
tmpvar_43 = f_35.z;
|
|
} else {
|
|
tmpvar_43 = -(f_35.z);
|
|
};
|
|
float tmpvar_44;
|
|
if ((d_36.w >= 0.0)) {
|
|
tmpvar_44 = f_35.w;
|
|
} else {
|
|
tmpvar_44 = -(f_35.w);
|
|
};
|
|
vec4 tmpvar_45;
|
|
tmpvar_45.x = tmpvar_41;
|
|
tmpvar_45.y = tmpvar_42;
|
|
tmpvar_45.z = tmpvar_43;
|
|
tmpvar_45.w = tmpvar_44;
|
|
return tmpvar_45;
|
|
}
|
|
|
|
float xll_modf (
|
|
in float x_46,
|
|
out int ip_47
|
|
)
|
|
{
|
|
int tmpvar_48;
|
|
tmpvar_48 = int(x_46);
|
|
ip_47 = tmpvar_48;
|
|
return (x_46 - float(ip_47));
|
|
}
|
|
|
|
float xll_modf (
|
|
in float x_49,
|
|
out float ip_50
|
|
)
|
|
{
|
|
int i_51;
|
|
int tmpvar_52;
|
|
tmpvar_52 = int(x_49);
|
|
i_51 = tmpvar_52;
|
|
float tmpvar_53;
|
|
tmpvar_53 = float(i_51);
|
|
ip_50 = tmpvar_53;
|
|
return (x_49 - ip_50);
|
|
}
|
|
|
|
vec2 xll_modf (
|
|
in vec2 x_54,
|
|
out ivec2 ip_55
|
|
)
|
|
{
|
|
ivec2 tmpvar_56;
|
|
tmpvar_56 = ivec2(x_54).xy;
|
|
ivec2 tmpvar_57;
|
|
tmpvar_57 = tmpvar_56;
|
|
ip_55 = tmpvar_57;
|
|
vec2 tmpvar_58;
|
|
tmpvar_58 = vec2(ip_55).xy;
|
|
return (x_54 - tmpvar_58);
|
|
}
|
|
|
|
vec2 xll_modf (
|
|
in vec2 x_59,
|
|
out vec2 ip_60
|
|
)
|
|
{
|
|
ivec2 i_61;
|
|
ivec2 tmpvar_62;
|
|
tmpvar_62 = ivec2(x_59).xy;
|
|
ivec2 tmpvar_63;
|
|
tmpvar_63 = tmpvar_62;
|
|
i_61 = tmpvar_63;
|
|
vec2 tmpvar_64;
|
|
tmpvar_64 = vec2(i_61).xy;
|
|
vec2 tmpvar_65;
|
|
tmpvar_65 = tmpvar_64;
|
|
ip_60 = tmpvar_65;
|
|
return (x_59 - ip_60);
|
|
}
|
|
|
|
vec3 xll_modf (
|
|
in vec3 x_66,
|
|
out ivec3 ip_67
|
|
)
|
|
{
|
|
ivec3 tmpvar_68;
|
|
tmpvar_68 = ivec3(x_66).xyz;
|
|
ivec3 tmpvar_69;
|
|
tmpvar_69 = tmpvar_68;
|
|
ip_67 = tmpvar_69;
|
|
vec3 tmpvar_70;
|
|
tmpvar_70 = vec3(ip_67).xyz;
|
|
return (x_66 - tmpvar_70);
|
|
}
|
|
|
|
vec3 xll_modf (
|
|
in vec3 x_71,
|
|
out vec3 ip_72
|
|
)
|
|
{
|
|
ivec3 i_73;
|
|
ivec3 tmpvar_74;
|
|
tmpvar_74 = ivec3(x_71).xyz;
|
|
ivec3 tmpvar_75;
|
|
tmpvar_75 = tmpvar_74;
|
|
i_73 = tmpvar_75;
|
|
vec3 tmpvar_76;
|
|
tmpvar_76 = vec3(i_73).xyz;
|
|
vec3 tmpvar_77;
|
|
tmpvar_77 = tmpvar_76;
|
|
ip_72 = tmpvar_77;
|
|
return (x_71 - ip_72);
|
|
}
|
|
|
|
vec4 xll_modf (
|
|
in vec4 x_78,
|
|
out ivec4 ip_79
|
|
)
|
|
{
|
|
ivec4 tmpvar_80;
|
|
tmpvar_80 = ivec4(x_78).xyzw;
|
|
ivec4 tmpvar_81;
|
|
tmpvar_81 = tmpvar_80;
|
|
ip_79 = tmpvar_81;
|
|
vec4 tmpvar_82;
|
|
tmpvar_82 = vec4(ip_79).xyzw;
|
|
return (x_78 - tmpvar_82);
|
|
}
|
|
|
|
vec4 xll_modf (
|
|
in vec4 x_83,
|
|
out vec4 ip_84
|
|
)
|
|
{
|
|
ivec4 i_85;
|
|
ivec4 tmpvar_86;
|
|
tmpvar_86 = ivec4(x_83).xyzw;
|
|
ivec4 tmpvar_87;
|
|
tmpvar_87 = tmpvar_86;
|
|
i_85 = tmpvar_87;
|
|
vec4 tmpvar_88;
|
|
tmpvar_88 = vec4(i_85).xyzw;
|
|
vec4 tmpvar_89;
|
|
tmpvar_89 = tmpvar_88;
|
|
ip_84 = tmpvar_89;
|
|
return (x_83 - ip_84);
|
|
}
|
|
|
|
vec4 xlat_main (
|
|
in vec4 uv_90
|
|
)
|
|
{
|
|
vec4 d_91;
|
|
vec4 c_92;
|
|
vec4 tmpvar_93;
|
|
tmpvar_93 = vec4(0.0, 0.0, 0.0, 0.0);
|
|
c_92 = tmpvar_93;
|
|
float tmpvar_94;
|
|
tmpvar_94 = xll_mod (uv_90.x, 2.0);
|
|
float tmpvar_95;
|
|
tmpvar_95 = (c_92.x + tmpvar_94);
|
|
c_92.x = tmpvar_95;
|
|
vec2 tmpvar_96;
|
|
tmpvar_96 = xll_mod (uv_90.xy, vec2(2.0, 2.0));
|
|
vec2 tmpvar_97;
|
|
tmpvar_97 = (c_92.xy + tmpvar_96);
|
|
c_92.xy = tmpvar_97.xy.xy;
|
|
vec3 tmpvar_98;
|
|
tmpvar_98 = xll_mod (uv_90.xyz, vec3(2.0, 2.0, 2.0));
|
|
vec3 tmpvar_99;
|
|
tmpvar_99 = (c_92.xyz + tmpvar_98);
|
|
c_92.xyz = tmpvar_99.xyz.xyz;
|
|
vec4 tmpvar_100;
|
|
tmpvar_100 = xll_mod (uv_90.xyzw, vec4(2.0, 2.0, 2.0, 2.0));
|
|
vec4 tmpvar_101;
|
|
tmpvar_101 = (c_92.xyzw + tmpvar_100);
|
|
c_92 = tmpvar_101.xyzw.xyzw;
|
|
float tmpvar_102;
|
|
tmpvar_102 = xll_modf (uv_90.x, d_91.x);
|
|
float tmpvar_103;
|
|
tmpvar_103 = (c_92.x + tmpvar_102);
|
|
c_92.x = tmpvar_103;
|
|
vec2 tmpvar_104;
|
|
tmpvar_104 = xll_modf (uv_90.xy, d_91.xy);
|
|
vec2 tmpvar_105;
|
|
tmpvar_105 = (c_92.xy + tmpvar_104);
|
|
c_92.xy = tmpvar_105.xy.xy;
|
|
vec3 tmpvar_106;
|
|
tmpvar_106 = xll_modf (uv_90.xyz, d_91.xyz);
|
|
vec3 tmpvar_107;
|
|
tmpvar_107 = (c_92.xyz + tmpvar_106);
|
|
c_92.xyz = tmpvar_107.xyz.xyz;
|
|
vec4 tmpvar_108;
|
|
tmpvar_108 = xll_modf (uv_90.xyzw, d_91.xyzw);
|
|
vec4 tmpvar_109;
|
|
tmpvar_109 = (c_92.xyzw + tmpvar_108);
|
|
c_92 = tmpvar_109.xyzw.xyzw;
|
|
return c_92;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
vec4 xl_retval_110;
|
|
vec4 tmpvar_111;
|
|
tmpvar_111 = xlv_TEXCOORD0.xyzw;
|
|
vec4 tmpvar_112;
|
|
tmpvar_112 = xlat_main (tmpvar_111);
|
|
vec4 tmpvar_113;
|
|
tmpvar_113 = tmpvar_112;
|
|
xl_retval_110 = tmpvar_113;
|
|
vec4 tmpvar_114;
|
|
tmpvar_114 = xl_retval_110.xyzw;
|
|
vec4 tmpvar_115;
|
|
tmpvar_115 = tmpvar_114;
|
|
gl_FragData[0] = tmpvar_115;
|
|
}
|
|
|