mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 09:08:22 -05:00
102 lines
2 KiB
Text
102 lines
2 KiB
Text
struct SurfaceOutput {
|
|
vec3 Albedo;
|
|
vec3 Normal;
|
|
vec3 Emission;
|
|
float Specular;
|
|
float Gloss;
|
|
float Alpha;
|
|
};
|
|
struct Input {
|
|
vec2 uv_MainTex;
|
|
vec2 uv_Detail;
|
|
};
|
|
struct v2f_surf {
|
|
vec4 pos;
|
|
vec3 normal;
|
|
};
|
|
uniform sampler2D _MainTex;
|
|
uniform sampler2D _Detail;
|
|
uniform vec4 _Color;
|
|
void surf (
|
|
in Input IN_1,
|
|
inout SurfaceOutput o_2
|
|
)
|
|
{
|
|
vec4 c_3;
|
|
vec4 tmpvar_4;
|
|
tmpvar_4 = texture2D (_MainTex, IN_1.uv_MainTex);
|
|
vec4 tmpvar_5;
|
|
tmpvar_5 = (tmpvar_4 * _Color);
|
|
c_3 = tmpvar_5;
|
|
vec4 tmpvar_6;
|
|
tmpvar_6 = texture2D (_Detail, IN_1.uv_Detail);
|
|
vec3 tmpvar_7;
|
|
tmpvar_7 = (c_3.xyz * (tmpvar_6.xyz * 2.0));
|
|
c_3.xyz = tmpvar_7.xyz.xyz;
|
|
vec3 tmpvar_8;
|
|
tmpvar_8 = c_3.xyz;
|
|
o_2.Albedo = tmpvar_8;
|
|
float tmpvar_9;
|
|
tmpvar_9 = c_3.w;
|
|
o_2.Alpha = 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;
|
|
}
|
|
|