mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-02 20:36:50 -05:00
91 lines
1.7 KiB
Text
91 lines
1.7 KiB
Text
struct v2f {
|
|
vec4 pos;
|
|
vec2 uv;
|
|
};
|
|
uniform mat4 _RotationMatrix;
|
|
uniform sampler2D _MainTex;
|
|
uniform vec4 _CenterRadius;
|
|
vec2 MultiplyUV (
|
|
in mat4 mat,
|
|
in vec2 inUV
|
|
)
|
|
{
|
|
vec4 temp;
|
|
vec4 tmpvar_1;
|
|
tmpvar_1.zw = vec2(0.0, 0.0);
|
|
tmpvar_1.x = inUV.x;
|
|
tmpvar_1.y = inUV.y;
|
|
vec4 tmpvar_2;
|
|
tmpvar_2 = tmpvar_1;
|
|
temp = tmpvar_2;
|
|
vec4 tmpvar_3;
|
|
tmpvar_3 = (mat * temp);
|
|
temp = tmpvar_3;
|
|
return temp.xy;
|
|
}
|
|
|
|
vec4 frag (
|
|
in v2f i
|
|
)
|
|
{
|
|
float t;
|
|
vec2 tmp;
|
|
vec2 distortedOffset;
|
|
vec2 offset;
|
|
vec2 tmpvar_1;
|
|
tmpvar_1 = i.uv;
|
|
offset = tmpvar_1;
|
|
vec2 tmpvar_2;
|
|
tmpvar_2 = MultiplyUV (_RotationMatrix, offset.xy);
|
|
vec2 tmpvar_3;
|
|
tmpvar_3 = tmpvar_2;
|
|
distortedOffset = tmpvar_3;
|
|
vec2 tmpvar_4;
|
|
tmpvar_4 = (offset / _CenterRadius.zw);
|
|
tmp = tmpvar_4;
|
|
float tmpvar_5;
|
|
tmpvar_5 = length (tmp);
|
|
float tmpvar_6;
|
|
tmpvar_6 = min (1.0, tmpvar_5);
|
|
float tmpvar_7;
|
|
tmpvar_7 = tmpvar_6;
|
|
t = tmpvar_7;
|
|
vec2 tmpvar_8;
|
|
tmpvar_8 = vec2(t);
|
|
vec2 tmpvar_9;
|
|
tmpvar_9 = mix (distortedOffset, offset, tmpvar_8);
|
|
vec2 tmpvar_10;
|
|
tmpvar_10 = tmpvar_9;
|
|
offset = tmpvar_10;
|
|
vec2 tmpvar_11;
|
|
tmpvar_11 = (offset + _CenterRadius.xy);
|
|
offset = tmpvar_11;
|
|
vec4 tmpvar_12;
|
|
tmpvar_12 = texture2D (_MainTex, offset);
|
|
return tmpvar_12;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
v2f xlt_i;
|
|
vec4 xl_retval;
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = vec4(0.0, 0.0, 0.0, 0.0);
|
|
xlt_i.pos = tmpvar_1;
|
|
vec2 tmpvar_2;
|
|
tmpvar_2 = gl_TexCoord[0].xy;
|
|
vec2 tmpvar_3;
|
|
tmpvar_3 = tmpvar_2;
|
|
xlt_i.uv = tmpvar_3;
|
|
vec4 tmpvar_4;
|
|
tmpvar_4 = frag (xlt_i);
|
|
vec4 tmpvar_5;
|
|
tmpvar_5 = tmpvar_4;
|
|
xl_retval = tmpvar_5;
|
|
vec4 tmpvar_6;
|
|
tmpvar_6 = xl_retval.xyzw;
|
|
vec4 tmpvar_7;
|
|
tmpvar_7 = tmpvar_6;
|
|
gl_FragData[0] = tmpvar_7;
|
|
}
|
|
|