mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-01 11:56:58 -05:00
109 lines
2 KiB
Text
109 lines
2 KiB
Text
|
struct SurfaceOutput {
|
||
|
vec3 Albedo;
|
||
|
vec3 Normal;
|
||
|
vec3 Emission;
|
||
|
float Specular;
|
||
|
float Gloss;
|
||
|
float Alpha;
|
||
|
};
|
||
|
struct Input {
|
||
|
vec2 uv_MainTex;
|
||
|
vec4 color;
|
||
|
};
|
||
|
struct v2f_surf {
|
||
|
vec4 pos;
|
||
|
vec2 hip_pack0;
|
||
|
vec4 lop_color;
|
||
|
};
|
||
|
uniform sampler2D _MainTex;
|
||
|
uniform float _Cutoff;
|
||
|
void xll_clip (
|
||
|
in float x_1
|
||
|
)
|
||
|
{
|
||
|
if ((x_1 < 0.0)) {
|
||
|
discard;
|
||
|
};
|
||
|
}
|
||
|
|
||
|
void surf (
|
||
|
in Input IN_2,
|
||
|
inout SurfaceOutput o_3
|
||
|
)
|
||
|
{
|
||
|
vec4 c_4;
|
||
|
vec4 tmpvar_5;
|
||
|
tmpvar_5 = texture2D (_MainTex, IN_2.uv_MainTex);
|
||
|
vec4 tmpvar_6;
|
||
|
tmpvar_6 = (tmpvar_5 * IN_2.color);
|
||
|
c_4 = tmpvar_6;
|
||
|
vec3 tmpvar_7;
|
||
|
tmpvar_7 = c_4.xyz;
|
||
|
o_3.Albedo = tmpvar_7;
|
||
|
float tmpvar_8;
|
||
|
tmpvar_8 = c_4.w;
|
||
|
o_3.Alpha = tmpvar_8;
|
||
|
}
|
||
|
|
||
|
vec4 frag_surf (
|
||
|
in v2f_surf IN_9
|
||
|
)
|
||
|
{
|
||
|
SurfaceOutput o_10;
|
||
|
Input surfIN_11;
|
||
|
vec2 tmpvar_12;
|
||
|
tmpvar_12 = IN_9.hip_pack0.xy;
|
||
|
surfIN_11.uv_MainTex = tmpvar_12;
|
||
|
vec4 tmpvar_13;
|
||
|
tmpvar_13 = IN_9.lop_color;
|
||
|
surfIN_11.color = tmpvar_13;
|
||
|
vec3 tmpvar_14;
|
||
|
tmpvar_14 = vec3(0.0, 0.0, 0.0);
|
||
|
o_10.Albedo = tmpvar_14;
|
||
|
vec3 tmpvar_15;
|
||
|
tmpvar_15 = vec3(0.0, 0.0, 0.0);
|
||
|
o_10.Emission = tmpvar_15;
|
||
|
float tmpvar_16;
|
||
|
tmpvar_16 = 0.0;
|
||
|
o_10.Specular = tmpvar_16;
|
||
|
float tmpvar_17;
|
||
|
tmpvar_17 = 0.0;
|
||
|
o_10.Alpha = tmpvar_17;
|
||
|
float tmpvar_18;
|
||
|
tmpvar_18 = 0.0;
|
||
|
o_10.Gloss = tmpvar_18;
|
||
|
surf (surfIN_11, o_10);
|
||
|
xll_clip ((o_10.Alpha - _Cutoff));
|
||
|
return vec4(0.0, 0.0, 0.0, 0.0);
|
||
|
}
|
||
|
|
||
|
void main ()
|
||
|
{
|
||
|
v2f_surf xlt_IN_19;
|
||
|
vec4 xl_retval_20;
|
||
|
vec4 tmpvar_21;
|
||
|
tmpvar_21 = vec4(0.0, 0.0, 0.0, 0.0);
|
||
|
xlt_IN_19.pos = tmpvar_21;
|
||
|
vec2 tmpvar_22;
|
||
|
tmpvar_22 = gl_TexCoord[1].xy;
|
||
|
vec2 tmpvar_23;
|
||
|
tmpvar_23 = tmpvar_22;
|
||
|
xlt_IN_19.hip_pack0 = tmpvar_23;
|
||
|
vec4 tmpvar_24;
|
||
|
tmpvar_24 = gl_Color.xyzw;
|
||
|
vec4 tmpvar_25;
|
||
|
tmpvar_25 = tmpvar_24;
|
||
|
xlt_IN_19.lop_color = tmpvar_25;
|
||
|
vec4 tmpvar_26;
|
||
|
tmpvar_26 = frag_surf (xlt_IN_19);
|
||
|
vec4 tmpvar_27;
|
||
|
tmpvar_27 = tmpvar_26;
|
||
|
xl_retval_20 = tmpvar_27;
|
||
|
vec4 tmpvar_28;
|
||
|
tmpvar_28 = xl_retval_20.xyzw;
|
||
|
vec4 tmpvar_29;
|
||
|
tmpvar_29 = tmpvar_28;
|
||
|
gl_FragData[0] = tmpvar_29;
|
||
|
}
|
||
|
|