mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
288 lines
5.7 KiB
Text
288 lines
5.7 KiB
Text
|
struct v2f {
|
||
|
vec4 pos;
|
||
|
vec2 uv;
|
||
|
vec2 uvOrig;
|
||
|
};
|
||
|
uniform sampler2D _MainTex;
|
||
|
uniform vec4 _CenterRadius;
|
||
|
uniform float _Angle;
|
||
|
void xll_sincos (
|
||
|
in float x_1,
|
||
|
out float s_2,
|
||
|
out float c_3
|
||
|
)
|
||
|
{
|
||
|
float tmpvar_4;
|
||
|
tmpvar_4 = sin (x_1);
|
||
|
float tmpvar_5;
|
||
|
tmpvar_5 = tmpvar_4;
|
||
|
s_2 = tmpvar_5;
|
||
|
float tmpvar_6;
|
||
|
tmpvar_6 = cos (x_1);
|
||
|
float tmpvar_7;
|
||
|
tmpvar_7 = tmpvar_6;
|
||
|
c_3 = tmpvar_7;
|
||
|
}
|
||
|
|
||
|
void xll_sincos (
|
||
|
in vec2 x_8,
|
||
|
out vec2 s_9,
|
||
|
out vec2 c_10
|
||
|
)
|
||
|
{
|
||
|
vec2 tmpvar_11;
|
||
|
tmpvar_11 = sin (x_8);
|
||
|
vec2 tmpvar_12;
|
||
|
tmpvar_12 = tmpvar_11;
|
||
|
s_9 = tmpvar_12;
|
||
|
vec2 tmpvar_13;
|
||
|
tmpvar_13 = cos (x_8);
|
||
|
vec2 tmpvar_14;
|
||
|
tmpvar_14 = tmpvar_13;
|
||
|
c_10 = tmpvar_14;
|
||
|
}
|
||
|
|
||
|
void xll_sincos (
|
||
|
in vec3 x_15,
|
||
|
out vec3 s_16,
|
||
|
out vec3 c_17
|
||
|
)
|
||
|
{
|
||
|
vec3 tmpvar_18;
|
||
|
tmpvar_18 = sin (x_15);
|
||
|
vec3 tmpvar_19;
|
||
|
tmpvar_19 = tmpvar_18;
|
||
|
s_16 = tmpvar_19;
|
||
|
vec3 tmpvar_20;
|
||
|
tmpvar_20 = cos (x_15);
|
||
|
vec3 tmpvar_21;
|
||
|
tmpvar_21 = tmpvar_20;
|
||
|
c_17 = tmpvar_21;
|
||
|
}
|
||
|
|
||
|
void xll_sincos (
|
||
|
in vec4 x_22,
|
||
|
out vec4 s_23,
|
||
|
out vec4 c_24
|
||
|
)
|
||
|
{
|
||
|
vec4 tmpvar_25;
|
||
|
tmpvar_25 = sin (x_22);
|
||
|
vec4 tmpvar_26;
|
||
|
tmpvar_26 = tmpvar_25;
|
||
|
s_23 = tmpvar_26;
|
||
|
vec4 tmpvar_27;
|
||
|
tmpvar_27 = cos (x_22);
|
||
|
vec4 tmpvar_28;
|
||
|
tmpvar_28 = tmpvar_27;
|
||
|
c_24 = tmpvar_28;
|
||
|
}
|
||
|
|
||
|
void xll_sincos (
|
||
|
in mat2 x_29,
|
||
|
out mat2 s_30,
|
||
|
out mat2 c_31
|
||
|
)
|
||
|
{
|
||
|
vec2 tmpvar_32;
|
||
|
tmpvar_32 = sin (x_29[0]);
|
||
|
vec2 tmpvar_33;
|
||
|
tmpvar_33 = sin (x_29[1]);
|
||
|
mat2 tmpvar_34;
|
||
|
vec2 tmpvar_35;
|
||
|
tmpvar_35 = tmpvar_32;
|
||
|
tmpvar_34[0] = tmpvar_35;
|
||
|
vec2 tmpvar_36;
|
||
|
tmpvar_36 = tmpvar_33;
|
||
|
tmpvar_34[1] = tmpvar_36;
|
||
|
mat2 tmpvar_37;
|
||
|
tmpvar_37 = (tmpvar_34);
|
||
|
s_30 = (tmpvar_37);
|
||
|
vec2 tmpvar_38;
|
||
|
tmpvar_38 = cos (x_29[0]);
|
||
|
vec2 tmpvar_39;
|
||
|
tmpvar_39 = cos (x_29[1]);
|
||
|
mat2 tmpvar_40;
|
||
|
vec2 tmpvar_41;
|
||
|
tmpvar_41 = tmpvar_38;
|
||
|
tmpvar_40[0] = tmpvar_41;
|
||
|
vec2 tmpvar_42;
|
||
|
tmpvar_42 = tmpvar_39;
|
||
|
tmpvar_40[1] = tmpvar_42;
|
||
|
mat2 tmpvar_43;
|
||
|
tmpvar_43 = (tmpvar_40);
|
||
|
c_31 = (tmpvar_43);
|
||
|
}
|
||
|
|
||
|
void xll_sincos (
|
||
|
in mat3 x_44,
|
||
|
out mat3 s_45,
|
||
|
out mat3 c_46
|
||
|
)
|
||
|
{
|
||
|
vec3 tmpvar_47;
|
||
|
tmpvar_47 = sin (x_44[0]);
|
||
|
vec3 tmpvar_48;
|
||
|
tmpvar_48 = sin (x_44[1]);
|
||
|
vec3 tmpvar_49;
|
||
|
tmpvar_49 = sin (x_44[2]);
|
||
|
mat3 tmpvar_50;
|
||
|
vec3 tmpvar_51;
|
||
|
tmpvar_51 = tmpvar_47;
|
||
|
tmpvar_50[0] = tmpvar_51;
|
||
|
vec3 tmpvar_52;
|
||
|
tmpvar_52 = tmpvar_48;
|
||
|
tmpvar_50[1] = tmpvar_52;
|
||
|
vec3 tmpvar_53;
|
||
|
tmpvar_53 = tmpvar_49;
|
||
|
tmpvar_50[2] = tmpvar_53;
|
||
|
mat3 tmpvar_54;
|
||
|
tmpvar_54 = (tmpvar_50);
|
||
|
s_45 = (tmpvar_54);
|
||
|
vec3 tmpvar_55;
|
||
|
tmpvar_55 = cos (x_44[0]);
|
||
|
vec3 tmpvar_56;
|
||
|
tmpvar_56 = cos (x_44[1]);
|
||
|
vec3 tmpvar_57;
|
||
|
tmpvar_57 = cos (x_44[2]);
|
||
|
mat3 tmpvar_58;
|
||
|
vec3 tmpvar_59;
|
||
|
tmpvar_59 = tmpvar_55;
|
||
|
tmpvar_58[0] = tmpvar_59;
|
||
|
vec3 tmpvar_60;
|
||
|
tmpvar_60 = tmpvar_56;
|
||
|
tmpvar_58[1] = tmpvar_60;
|
||
|
vec3 tmpvar_61;
|
||
|
tmpvar_61 = tmpvar_57;
|
||
|
tmpvar_58[2] = tmpvar_61;
|
||
|
mat3 tmpvar_62;
|
||
|
tmpvar_62 = (tmpvar_58);
|
||
|
c_46 = (tmpvar_62);
|
||
|
}
|
||
|
|
||
|
void xll_sincos (
|
||
|
in mat4 x_63,
|
||
|
out mat4 s_64,
|
||
|
out mat4 c_65
|
||
|
)
|
||
|
{
|
||
|
vec4 tmpvar_66;
|
||
|
tmpvar_66 = sin (x_63[0]);
|
||
|
vec4 tmpvar_67;
|
||
|
tmpvar_67 = sin (x_63[1]);
|
||
|
vec4 tmpvar_68;
|
||
|
tmpvar_68 = sin (x_63[2]);
|
||
|
vec4 tmpvar_69;
|
||
|
tmpvar_69 = sin (x_63[3]);
|
||
|
mat4 tmpvar_70;
|
||
|
vec4 tmpvar_71;
|
||
|
tmpvar_71 = tmpvar_66;
|
||
|
tmpvar_70[0] = tmpvar_71;
|
||
|
vec4 tmpvar_72;
|
||
|
tmpvar_72 = tmpvar_67;
|
||
|
tmpvar_70[1] = tmpvar_72;
|
||
|
vec4 tmpvar_73;
|
||
|
tmpvar_73 = tmpvar_68;
|
||
|
tmpvar_70[2] = tmpvar_73;
|
||
|
vec4 tmpvar_74;
|
||
|
tmpvar_74 = tmpvar_69;
|
||
|
tmpvar_70[3] = tmpvar_74;
|
||
|
mat4 tmpvar_75;
|
||
|
tmpvar_75 = (tmpvar_70);
|
||
|
s_64 = (tmpvar_75);
|
||
|
vec4 tmpvar_76;
|
||
|
tmpvar_76 = cos (x_63[0]);
|
||
|
vec4 tmpvar_77;
|
||
|
tmpvar_77 = cos (x_63[1]);
|
||
|
vec4 tmpvar_78;
|
||
|
tmpvar_78 = cos (x_63[2]);
|
||
|
vec4 tmpvar_79;
|
||
|
tmpvar_79 = cos (x_63[3]);
|
||
|
mat4 tmpvar_80;
|
||
|
vec4 tmpvar_81;
|
||
|
tmpvar_81 = tmpvar_76;
|
||
|
tmpvar_80[0] = tmpvar_81;
|
||
|
vec4 tmpvar_82;
|
||
|
tmpvar_82 = tmpvar_77;
|
||
|
tmpvar_80[1] = tmpvar_82;
|
||
|
vec4 tmpvar_83;
|
||
|
tmpvar_83 = tmpvar_78;
|
||
|
tmpvar_80[2] = tmpvar_83;
|
||
|
vec4 tmpvar_84;
|
||
|
tmpvar_84 = tmpvar_79;
|
||
|
tmpvar_80[3] = tmpvar_84;
|
||
|
mat4 tmpvar_85;
|
||
|
tmpvar_85 = (tmpvar_80);
|
||
|
c_65 = (tmpvar_85);
|
||
|
}
|
||
|
|
||
|
vec4 frag (
|
||
|
in v2f i_86
|
||
|
)
|
||
|
{
|
||
|
vec2 uv_87;
|
||
|
float cosLength_88;
|
||
|
float sinLength_89;
|
||
|
float angle_90;
|
||
|
vec2 offset_91;
|
||
|
vec2 tmpvar_92;
|
||
|
tmpvar_92 = i_86.uvOrig;
|
||
|
offset_91 = tmpvar_92;
|
||
|
float tmpvar_93;
|
||
|
tmpvar_93 = length ((offset_91 / _CenterRadius.zw));
|
||
|
float tmpvar_94;
|
||
|
tmpvar_94 = (1.0 - tmpvar_93);
|
||
|
angle_90 = tmpvar_94;
|
||
|
float tmpvar_95;
|
||
|
tmpvar_95 = max (0.0, angle_90);
|
||
|
float tmpvar_96;
|
||
|
tmpvar_96 = tmpvar_95;
|
||
|
angle_90 = tmpvar_96;
|
||
|
float tmpvar_97;
|
||
|
tmpvar_97 = ((angle_90 * angle_90) * _Angle);
|
||
|
angle_90 = tmpvar_97;
|
||
|
xll_sincos (angle_90, sinLength_89, cosLength_88);
|
||
|
float tmpvar_98;
|
||
|
tmpvar_98 = ((cosLength_88 * offset_91.x) - (sinLength_89 * offset_91.y));
|
||
|
uv_87.x = tmpvar_98;
|
||
|
float tmpvar_99;
|
||
|
tmpvar_99 = ((sinLength_89 * offset_91.x) + (cosLength_88 * offset_91.y));
|
||
|
uv_87.y = vec2(tmpvar_99).y;
|
||
|
vec2 tmpvar_100;
|
||
|
tmpvar_100 = (uv_87 + _CenterRadius.xy);
|
||
|
uv_87 = tmpvar_100;
|
||
|
vec4 tmpvar_101;
|
||
|
tmpvar_101 = texture2D (_MainTex, uv_87);
|
||
|
return tmpvar_101;
|
||
|
}
|
||
|
|
||
|
void main ()
|
||
|
{
|
||
|
v2f xlt_i_102;
|
||
|
vec4 xl_retval_103;
|
||
|
vec4 tmpvar_104;
|
||
|
tmpvar_104 = vec4(0.0, 0.0, 0.0, 0.0);
|
||
|
xlt_i_102.pos = tmpvar_104;
|
||
|
vec2 tmpvar_105;
|
||
|
tmpvar_105 = gl_TexCoord[0].xy;
|
||
|
vec2 tmpvar_106;
|
||
|
tmpvar_106 = tmpvar_105;
|
||
|
xlt_i_102.uv = tmpvar_106;
|
||
|
vec2 tmpvar_107;
|
||
|
tmpvar_107 = gl_TexCoord[1].xy;
|
||
|
vec2 tmpvar_108;
|
||
|
tmpvar_108 = tmpvar_107;
|
||
|
xlt_i_102.uvOrig = tmpvar_108;
|
||
|
vec4 tmpvar_109;
|
||
|
tmpvar_109 = frag (xlt_i_102);
|
||
|
vec4 tmpvar_110;
|
||
|
tmpvar_110 = tmpvar_109;
|
||
|
xl_retval_103 = tmpvar_110;
|
||
|
vec4 tmpvar_111;
|
||
|
tmpvar_111 = xl_retval_103.xyzw;
|
||
|
vec4 tmpvar_112;
|
||
|
tmpvar_112 = tmpvar_111;
|
||
|
gl_FragData[0] = tmpvar_112;
|
||
|
}
|
||
|
|