mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
102 lines
1.9 KiB
Text
102 lines
1.9 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,
|
|
inout SurfaceOutput o
|
|
)
|
|
{
|
|
vec4 c;
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = texture2D (_MainTex, IN.uv_MainTex);
|
|
vec4 tmpvar_2;
|
|
tmpvar_2 = (tmpvar_1 * _Color);
|
|
c = tmpvar_2;
|
|
vec4 tmpvar_3;
|
|
tmpvar_3 = texture2D (_Detail, IN.uv_Detail);
|
|
vec3 tmpvar_4;
|
|
tmpvar_4 = (c.xyz * (tmpvar_3.xyz * 2.0));
|
|
c.xyz = tmpvar_4.xyz.xyz;
|
|
vec3 tmpvar_5;
|
|
tmpvar_5 = c.xyz;
|
|
o.Albedo = tmpvar_5;
|
|
float tmpvar_6;
|
|
tmpvar_6 = c.w;
|
|
o.Alpha = tmpvar_6;
|
|
}
|
|
|
|
vec4 frag_surf (
|
|
in v2f_surf IN
|
|
)
|
|
{
|
|
vec4 res;
|
|
Input surfIN;
|
|
SurfaceOutput o;
|
|
vec3 tmpvar_1;
|
|
tmpvar_1 = vec3(0.0, 0.0, 0.0);
|
|
o.Albedo = tmpvar_1;
|
|
vec3 tmpvar_2;
|
|
tmpvar_2 = vec3(0.0, 0.0, 0.0);
|
|
o.Emission = tmpvar_2;
|
|
float tmpvar_3;
|
|
tmpvar_3 = 0.0;
|
|
o.Specular = tmpvar_3;
|
|
float tmpvar_4;
|
|
tmpvar_4 = 0.0;
|
|
o.Alpha = tmpvar_4;
|
|
float tmpvar_5;
|
|
tmpvar_5 = 0.0;
|
|
o.Gloss = tmpvar_5;
|
|
vec3 tmpvar_6;
|
|
tmpvar_6 = IN.normal;
|
|
o.Normal = tmpvar_6;
|
|
surf (surfIN, o);
|
|
vec3 tmpvar_7;
|
|
tmpvar_7 = ((o.Normal * vec3(0.5, 0.5, -0.5)) + 0.5);
|
|
res.xyz = tmpvar_7.xyz.xyz;
|
|
float tmpvar_8;
|
|
tmpvar_8 = o.Specular;
|
|
res.w = vec4(tmpvar_8).w;
|
|
return res;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
v2f_surf xlt_IN;
|
|
vec4 xl_retval;
|
|
vec4 tmpvar_1;
|
|
tmpvar_1 = vec4(0.0, 0.0, 0.0, 0.0);
|
|
xlt_IN.pos = tmpvar_1;
|
|
vec3 tmpvar_2;
|
|
tmpvar_2 = gl_TexCoord[0].xyz;
|
|
vec3 tmpvar_3;
|
|
tmpvar_3 = tmpvar_2;
|
|
xlt_IN.normal = tmpvar_3;
|
|
vec4 tmpvar_4;
|
|
tmpvar_4 = frag_surf (xlt_IN);
|
|
vec4 tmpvar_5;
|
|
tmpvar_5 = tmpvar_4;
|
|
xl_retval = tmpvar_5;
|
|
vec4 tmpvar_6;
|
|
tmpvar_6 = xl_retval.xyzw;
|
|
vec4 tmpvar_7;
|
|
tmpvar_7 = tmpvar_6;
|
|
gl_FragData[0] = tmpvar_7;
|
|
}
|
|
|