bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Specular1-ir.txt
2014-02-10 23:06:13 -08:00

102 lines
2 KiB
Text

struct SurfaceOutput {
vec3 Albedo;
vec3 Normal;
vec3 Emission;
float Specular;
float Gloss;
float Alpha;
};
struct Input {
vec2 uv_MainTex;
};
struct v2f_surf {
vec4 pos;
vec3 normal;
};
uniform vec4 _Color;
uniform sampler2D _MainTex;
uniform float _Shininess;
void surf (
in Input IN_1,
inout SurfaceOutput o_2
)
{
vec4 tex_3;
vec4 tmpvar_4;
tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex);
vec4 tmpvar_5;
tmpvar_5 = tmpvar_4;
tex_3 = tmpvar_5;
vec3 tmpvar_6;
tmpvar_6 = (tex_3.xyz * _Color.xyz);
o_2.Albedo = tmpvar_6;
float tmpvar_7;
tmpvar_7 = tex_3.w;
o_2.Gloss = tmpvar_7;
float tmpvar_8;
tmpvar_8 = (tex_3.w * _Color.w);
o_2.Alpha = tmpvar_8;
float tmpvar_9;
tmpvar_9 = _Shininess;
o_2.Specular = tmpvar_9;
}
vec4 frag_surf (
in v2f_surf IN_10
)
{
vec4 res_11;
Input surfIN_12;
SurfaceOutput o_13;
vec3 tmpvar_14;
tmpvar_14 = vec3(0.0, 0.0, 0.0);
o_13.Albedo = tmpvar_14;
vec3 tmpvar_15;
tmpvar_15 = vec3(0.0, 0.0, 0.0);
o_13.Emission = tmpvar_15;
float tmpvar_16;
tmpvar_16 = 0.0;
o_13.Specular = tmpvar_16;
float tmpvar_17;
tmpvar_17 = 0.0;
o_13.Alpha = tmpvar_17;
float tmpvar_18;
tmpvar_18 = 0.0;
o_13.Gloss = tmpvar_18;
vec3 tmpvar_19;
tmpvar_19 = IN_10.normal;
o_13.Normal = tmpvar_19;
surf (surfIN_12, o_13);
vec3 tmpvar_20;
tmpvar_20 = ((o_13.Normal * vec3(0.5, 0.5, -0.5)) + 0.5);
res_11.xyz = tmpvar_20.xyz.xyz;
float tmpvar_21;
tmpvar_21 = o_13.Specular;
res_11.w = vec4(tmpvar_21).w;
return res_11;
}
void main ()
{
v2f_surf xlt_IN_22;
vec4 xl_retval_23;
vec4 tmpvar_24;
tmpvar_24 = vec4(0.0, 0.0, 0.0, 0.0);
xlt_IN_22.pos = tmpvar_24;
vec3 tmpvar_25;
tmpvar_25 = gl_TexCoord[0].xyz;
vec3 tmpvar_26;
tmpvar_26 = tmpvar_25;
xlt_IN_22.normal = tmpvar_26;
vec4 tmpvar_27;
tmpvar_27 = frag_surf (xlt_IN_22);
vec4 tmpvar_28;
tmpvar_28 = tmpvar_27;
xl_retval_23 = tmpvar_28;
vec4 tmpvar_29;
tmpvar_29 = xl_retval_23.xyzw;
vec4 tmpvar_30;
tmpvar_30 = tmpvar_29;
gl_FragData[0] = tmpvar_30;
}