mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
84 lines
1.6 KiB
Text
84 lines
1.6 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;
|
|
};
|
|
void surf (
|
|
in Input IN_1,
|
|
inout SurfaceOutput o_2
|
|
)
|
|
{
|
|
vec3 tmpvar_3;
|
|
tmpvar_3 = vec3(1.0, 0.0, 0.0);
|
|
o_2.Emission = tmpvar_3;
|
|
}
|
|
|
|
vec4 frag_surf (
|
|
in v2f_surf IN_4
|
|
)
|
|
{
|
|
vec4 res_5;
|
|
Input surfIN_6;
|
|
SurfaceOutput o_7;
|
|
vec3 tmpvar_8;
|
|
tmpvar_8 = vec3(0.0, 0.0, 0.0);
|
|
o_7.Albedo = tmpvar_8;
|
|
vec3 tmpvar_9;
|
|
tmpvar_9 = vec3(0.0, 0.0, 0.0);
|
|
o_7.Emission = tmpvar_9;
|
|
float tmpvar_10;
|
|
tmpvar_10 = 0.0;
|
|
o_7.Specular = tmpvar_10;
|
|
float tmpvar_11;
|
|
tmpvar_11 = 0.0;
|
|
o_7.Alpha = tmpvar_11;
|
|
float tmpvar_12;
|
|
tmpvar_12 = 0.0;
|
|
o_7.Gloss = tmpvar_12;
|
|
vec3 tmpvar_13;
|
|
tmpvar_13 = IN_4.normal;
|
|
o_7.Normal = tmpvar_13;
|
|
surf (surfIN_6, o_7);
|
|
vec3 tmpvar_14;
|
|
tmpvar_14 = ((o_7.Normal * vec3(0.5, 0.5, -0.5)) + 0.5);
|
|
res_5.xyz = tmpvar_14.xyz.xyz;
|
|
float tmpvar_15;
|
|
tmpvar_15 = o_7.Specular;
|
|
res_5.w = vec4(tmpvar_15).w;
|
|
return res_5;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
v2f_surf xlt_IN_16;
|
|
vec4 xl_retval_17;
|
|
vec4 tmpvar_18;
|
|
tmpvar_18 = vec4(0.0, 0.0, 0.0, 0.0);
|
|
xlt_IN_16.pos = tmpvar_18;
|
|
vec3 tmpvar_19;
|
|
tmpvar_19 = gl_TexCoord[0].xyz;
|
|
vec3 tmpvar_20;
|
|
tmpvar_20 = tmpvar_19;
|
|
xlt_IN_16.normal = tmpvar_20;
|
|
vec4 tmpvar_21;
|
|
tmpvar_21 = frag_surf (xlt_IN_16);
|
|
vec4 tmpvar_22;
|
|
tmpvar_22 = tmpvar_21;
|
|
xl_retval_17 = tmpvar_22;
|
|
vec4 tmpvar_23;
|
|
tmpvar_23 = xl_retval_17.xyzw;
|
|
vec4 tmpvar_24;
|
|
tmpvar_24 = tmpvar_23;
|
|
gl_FragData[0] = tmpvar_24;
|
|
}
|
|
|