mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-11 16:51:32 -05:00
91 lines
1.8 KiB
Text
91 lines
1.8 KiB
Text
struct v2f {
|
|
vec4 pos;
|
|
vec2 uv;
|
|
};
|
|
uniform mat4 _RotationMatrix;
|
|
uniform sampler2D _MainTex;
|
|
uniform vec4 _CenterRadius;
|
|
vec2 MultiplyUV (
|
|
in mat4 mat_1,
|
|
in vec2 inUV_2
|
|
)
|
|
{
|
|
vec4 temp_3;
|
|
vec4 tmpvar_4;
|
|
tmpvar_4.zw = vec2(0.0, 0.0);
|
|
tmpvar_4.x = inUV_2.x;
|
|
tmpvar_4.y = inUV_2.y;
|
|
vec4 tmpvar_5;
|
|
tmpvar_5 = tmpvar_4;
|
|
temp_3 = tmpvar_5;
|
|
vec4 tmpvar_6;
|
|
tmpvar_6 = (mat_1 * temp_3);
|
|
temp_3 = tmpvar_6;
|
|
return temp_3.xy;
|
|
}
|
|
|
|
vec4 frag (
|
|
in v2f i_7
|
|
)
|
|
{
|
|
float t_8;
|
|
vec2 tmp_9;
|
|
vec2 distortedOffset_10;
|
|
vec2 offset_11;
|
|
vec2 tmpvar_12;
|
|
tmpvar_12 = i_7.uv;
|
|
offset_11 = tmpvar_12;
|
|
vec2 tmpvar_13;
|
|
tmpvar_13 = MultiplyUV (_RotationMatrix, offset_11.xy);
|
|
vec2 tmpvar_14;
|
|
tmpvar_14 = tmpvar_13;
|
|
distortedOffset_10 = tmpvar_14;
|
|
vec2 tmpvar_15;
|
|
tmpvar_15 = (offset_11 / _CenterRadius.zw);
|
|
tmp_9 = tmpvar_15;
|
|
float tmpvar_16;
|
|
tmpvar_16 = length (tmp_9);
|
|
float tmpvar_17;
|
|
tmpvar_17 = min (1.0, tmpvar_16);
|
|
float tmpvar_18;
|
|
tmpvar_18 = tmpvar_17;
|
|
t_8 = tmpvar_18;
|
|
vec2 tmpvar_19;
|
|
tmpvar_19 = vec2(t_8);
|
|
vec2 tmpvar_20;
|
|
tmpvar_20 = mix (distortedOffset_10, offset_11, tmpvar_19);
|
|
vec2 tmpvar_21;
|
|
tmpvar_21 = tmpvar_20;
|
|
offset_11 = tmpvar_21;
|
|
vec2 tmpvar_22;
|
|
tmpvar_22 = (offset_11 + _CenterRadius.xy);
|
|
offset_11 = tmpvar_22;
|
|
vec4 tmpvar_23;
|
|
tmpvar_23 = texture2D (_MainTex, offset_11);
|
|
return tmpvar_23;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
v2f xlt_i_24;
|
|
vec4 xl_retval_25;
|
|
vec4 tmpvar_26;
|
|
tmpvar_26 = vec4(0.0, 0.0, 0.0, 0.0);
|
|
xlt_i_24.pos = tmpvar_26;
|
|
vec2 tmpvar_27;
|
|
tmpvar_27 = gl_TexCoord[0].xy;
|
|
vec2 tmpvar_28;
|
|
tmpvar_28 = tmpvar_27;
|
|
xlt_i_24.uv = tmpvar_28;
|
|
vec4 tmpvar_29;
|
|
tmpvar_29 = frag (xlt_i_24);
|
|
vec4 tmpvar_30;
|
|
tmpvar_30 = tmpvar_29;
|
|
xl_retval_25 = tmpvar_30;
|
|
vec4 tmpvar_31;
|
|
tmpvar_31 = xl_retval_25.xyzw;
|
|
vec4 tmpvar_32;
|
|
tmpvar_32 = tmpvar_31;
|
|
gl_FragData[0] = tmpvar_32;
|
|
}
|
|
|