mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 11:05:36 -05:00
84 lines
1.7 KiB
Text
84 lines
1.7 KiB
Text
struct v2f {
|
|
vec4 pos;
|
|
vec2 uv[3];
|
|
};
|
|
uniform sampler2D _MainTex;
|
|
uniform float _Treshold;
|
|
vec4 frag (
|
|
in v2f i_1
|
|
)
|
|
{
|
|
float len_2;
|
|
vec3 diff_3;
|
|
vec3 p3_4;
|
|
vec3 p2_5;
|
|
vec3 p1_6;
|
|
vec4 original_7;
|
|
vec4 tmpvar_8;
|
|
tmpvar_8 = texture2D (_MainTex, i_1.uv[0]);
|
|
vec4 tmpvar_9;
|
|
tmpvar_9 = tmpvar_8;
|
|
original_7 = tmpvar_9;
|
|
vec3 tmpvar_10;
|
|
tmpvar_10 = original_7.xyz;
|
|
p1_6 = tmpvar_10;
|
|
vec4 tmpvar_11;
|
|
tmpvar_11 = texture2D (_MainTex, i_1.uv[1]);
|
|
vec3 tmpvar_12;
|
|
tmpvar_12 = tmpvar_11.xyz;
|
|
p2_5 = tmpvar_12;
|
|
vec4 tmpvar_13;
|
|
tmpvar_13 = texture2D (_MainTex, i_1.uv[2]);
|
|
vec3 tmpvar_14;
|
|
tmpvar_14 = tmpvar_13.xyz;
|
|
p3_4 = tmpvar_14;
|
|
vec3 tmpvar_15;
|
|
tmpvar_15 = (((p1_6 * 2.0) - p2_5) - p3_4);
|
|
diff_3 = tmpvar_15;
|
|
float tmpvar_16;
|
|
tmpvar_16 = dot (diff_3, diff_3);
|
|
float tmpvar_17;
|
|
tmpvar_17 = tmpvar_16;
|
|
len_2 = tmpvar_17;
|
|
if ((len_2 >= _Treshold)) {
|
|
vec3 tmpvar_18;
|
|
tmpvar_18 = vec3(0.0, 0.0, 0.0);
|
|
original_7.xyz = tmpvar_18.xyz.xyz;
|
|
};
|
|
return original_7;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
v2f xlt_i_19;
|
|
vec4 xl_retval_20;
|
|
vec4 tmpvar_21;
|
|
tmpvar_21 = vec4(0.0, 0.0, 0.0, 0.0);
|
|
xlt_i_19.pos = tmpvar_21;
|
|
vec2 tmpvar_22;
|
|
tmpvar_22 = gl_TexCoord[0].xy;
|
|
vec2 tmpvar_23;
|
|
tmpvar_23 = tmpvar_22;
|
|
xlt_i_19.uv[0] = tmpvar_23;
|
|
vec2 tmpvar_24;
|
|
tmpvar_24 = gl_TexCoord[1].xy;
|
|
vec2 tmpvar_25;
|
|
tmpvar_25 = tmpvar_24;
|
|
xlt_i_19.uv[1] = tmpvar_25;
|
|
vec2 tmpvar_26;
|
|
tmpvar_26 = gl_TexCoord[2].xy;
|
|
vec2 tmpvar_27;
|
|
tmpvar_27 = tmpvar_26;
|
|
xlt_i_19.uv[2] = tmpvar_27;
|
|
vec4 tmpvar_28;
|
|
tmpvar_28 = frag (xlt_i_19);
|
|
vec4 tmpvar_29;
|
|
tmpvar_29 = tmpvar_28;
|
|
xl_retval_20 = tmpvar_29;
|
|
vec4 tmpvar_30;
|
|
tmpvar_30 = xl_retval_20.xyzw;
|
|
vec4 tmpvar_31;
|
|
tmpvar_31 = tmpvar_30;
|
|
gl_FragData[0] = tmpvar_31;
|
|
}
|
|
|