bgfx/3rdparty/glsl-optimizer/tests/fragment/zun-Self-Illumin_Diffuse-ir.txt
2012-10-07 20:41:18 -07:00

166 lines
3.5 KiB
Text

struct SurfaceOutput {
vec3 Albedo;
vec3 Normal;
vec3 Emission;
float Specular;
float Gloss;
float Alpha;
};
struct Input {
vec2 uv_MainTex;
vec2 uv_Illum;
};
struct v2f_surf {
vec4 pos;
float fog;
vec2 hip_pack0;
vec3 normal;
vec3 lightDir;
vec2 _LightCoord;
};
varying vec4 xlv_FOG;
uniform sampler2D _MainTex;
uniform sampler2D _LightTexture0;
uniform vec4 _LightColor0;
uniform sampler2D _Illum;
uniform vec4 _Color;
void surf (
in Input IN_1,
inout SurfaceOutput o_2
)
{
vec4 c_3;
vec4 tex_4;
vec4 tmpvar_5;
tmpvar_5 = texture2D (_MainTex, IN_1.uv_MainTex);
vec4 tmpvar_6;
tmpvar_6 = tmpvar_5;
tex_4 = tmpvar_6;
vec4 tmpvar_7;
tmpvar_7 = (tex_4 * _Color);
c_3 = tmpvar_7;
vec3 tmpvar_8;
tmpvar_8 = c_3.xyz;
o_2.Albedo = tmpvar_8;
vec4 tmpvar_9;
tmpvar_9 = texture2D (_Illum, IN_1.uv_Illum);
vec3 tmpvar_10;
tmpvar_10 = (c_3.xyz * tmpvar_9.w);
o_2.Emission = tmpvar_10;
float tmpvar_11;
tmpvar_11 = c_3.w;
o_2.Alpha = tmpvar_11;
}
vec4 LightingLambert (
in SurfaceOutput s_12,
in vec3 lightDir_13,
in float atten_14
)
{
vec4 c_15;
float diff_16;
float tmpvar_17;
tmpvar_17 = dot (s_12.Normal, lightDir_13);
float tmpvar_18;
tmpvar_18 = max (0.0, tmpvar_17);
float tmpvar_19;
tmpvar_19 = tmpvar_18;
diff_16 = tmpvar_19;
vec3 tmpvar_20;
tmpvar_20 = ((s_12.Albedo * _LightColor0.xyz) * ((diff_16 * atten_14) * 2.0));
c_15.xyz = tmpvar_20.xyz.xyz;
float tmpvar_21;
tmpvar_21 = s_12.Alpha;
c_15.w = vec4(tmpvar_21).w;
return c_15;
}
vec4 frag_surf (
in v2f_surf IN_22
)
{
vec4 c_23;
vec3 lightDir_24;
SurfaceOutput o_25;
Input surfIN_26;
vec2 tmpvar_27;
tmpvar_27 = IN_22.hip_pack0.xy;
surfIN_26.uv_MainTex = tmpvar_27;
vec3 tmpvar_28;
tmpvar_28 = vec3(0.0, 0.0, 0.0);
o_25.Albedo = tmpvar_28;
vec3 tmpvar_29;
tmpvar_29 = vec3(0.0, 0.0, 0.0);
o_25.Emission = tmpvar_29;
float tmpvar_30;
tmpvar_30 = 0.0;
o_25.Specular = tmpvar_30;
float tmpvar_31;
tmpvar_31 = 0.0;
o_25.Alpha = tmpvar_31;
float tmpvar_32;
tmpvar_32 = 0.0;
o_25.Gloss = tmpvar_32;
vec3 tmpvar_33;
tmpvar_33 = IN_22.normal;
o_25.Normal = tmpvar_33;
surf (surfIN_26, o_25);
vec3 tmpvar_34;
tmpvar_34 = IN_22.lightDir;
lightDir_24 = tmpvar_34;
vec4 tmpvar_35;
tmpvar_35 = texture2D (_LightTexture0, IN_22._LightCoord);
vec4 tmpvar_36;
tmpvar_36 = LightingLambert (o_25, lightDir_24, (tmpvar_35.w * 1.0));
vec4 tmpvar_37;
tmpvar_37 = tmpvar_36;
c_23 = tmpvar_37;
float tmpvar_38;
tmpvar_38 = 0.0;
c_23.w = vec4(tmpvar_38).w;
return c_23;
}
void main ()
{
v2f_surf xlt_IN_39;
vec4 xl_retval_40;
vec4 tmpvar_41;
tmpvar_41 = vec4(0.0, 0.0, 0.0, 0.0);
xlt_IN_39.pos = tmpvar_41;
float tmpvar_42;
tmpvar_42 = xlv_FOG.x;
xlt_IN_39.fog = tmpvar_42;
vec2 tmpvar_43;
tmpvar_43 = gl_TexCoord[0].xy;
vec2 tmpvar_44;
tmpvar_44 = tmpvar_43;
xlt_IN_39.hip_pack0 = tmpvar_44;
vec3 tmpvar_45;
tmpvar_45 = gl_TexCoord[1].xyz;
vec3 tmpvar_46;
tmpvar_46 = tmpvar_45;
xlt_IN_39.normal = tmpvar_46;
vec3 tmpvar_47;
tmpvar_47 = gl_TexCoord[2].xyz;
vec3 tmpvar_48;
tmpvar_48 = tmpvar_47;
xlt_IN_39.lightDir = tmpvar_48;
vec2 tmpvar_49;
tmpvar_49 = gl_TexCoord[3].xy;
vec2 tmpvar_50;
tmpvar_50 = tmpvar_49;
xlt_IN_39._LightCoord = tmpvar_50;
vec4 tmpvar_51;
tmpvar_51 = frag_surf (xlt_IN_39);
vec4 tmpvar_52;
tmpvar_52 = tmpvar_51;
xl_retval_40 = tmpvar_52;
vec4 tmpvar_53;
tmpvar_53 = xl_retval_40.xyzw;
vec4 tmpvar_54;
tmpvar_54 = tmpvar_53;
gl_FragData[0] = tmpvar_54;
}