mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-04 21:31:11 -05:00
95 lines
1.8 KiB
Text
95 lines
1.8 KiB
Text
|
struct SurfaceOutput {
|
||
|
vec3 Albedo;
|
||
|
vec3 Normal;
|
||
|
vec3 Emission;
|
||
|
float Specular;
|
||
|
float Gloss;
|
||
|
float Alpha;
|
||
|
};
|
||
|
struct Input {
|
||
|
vec4 screenPos;
|
||
|
};
|
||
|
struct v2f_surf {
|
||
|
vec4 pos;
|
||
|
vec3 normal;
|
||
|
};
|
||
|
uniform sampler2D _MainTex;
|
||
|
void surf (
|
||
|
in Input IN_1,
|
||
|
inout SurfaceOutput o_2
|
||
|
)
|
||
|
{
|
||
|
vec2 uv_3;
|
||
|
vec2 tmpvar_4;
|
||
|
tmpvar_4 = (IN_1.screenPos.xy / IN_1.screenPos.w);
|
||
|
uv_3 = tmpvar_4;
|
||
|
vec2 tmpvar_5;
|
||
|
tmpvar_5 = (uv_3 * vec2(2.0, 1.0));
|
||
|
uv_3 = tmpvar_5;
|
||
|
vec4 tmpvar_6;
|
||
|
tmpvar_6 = texture2D (_MainTex, uv_3);
|
||
|
vec3 tmpvar_7;
|
||
|
tmpvar_7 = tmpvar_6.xyz;
|
||
|
o_2.Albedo = tmpvar_7;
|
||
|
}
|
||
|
|
||
|
vec4 frag_surf (
|
||
|
in v2f_surf IN_8
|
||
|
)
|
||
|
{
|
||
|
vec4 res_9;
|
||
|
Input surfIN_10;
|
||
|
SurfaceOutput o_11;
|
||
|
vec3 tmpvar_12;
|
||
|
tmpvar_12 = vec3(0.0, 0.0, 0.0);
|
||
|
o_11.Albedo = tmpvar_12;
|
||
|
vec3 tmpvar_13;
|
||
|
tmpvar_13 = vec3(0.0, 0.0, 0.0);
|
||
|
o_11.Emission = tmpvar_13;
|
||
|
float tmpvar_14;
|
||
|
tmpvar_14 = 0.0;
|
||
|
o_11.Specular = tmpvar_14;
|
||
|
float tmpvar_15;
|
||
|
tmpvar_15 = 0.0;
|
||
|
o_11.Alpha = tmpvar_15;
|
||
|
float tmpvar_16;
|
||
|
tmpvar_16 = 0.0;
|
||
|
o_11.Gloss = tmpvar_16;
|
||
|
vec3 tmpvar_17;
|
||
|
tmpvar_17 = IN_8.normal;
|
||
|
o_11.Normal = tmpvar_17;
|
||
|
surf (surfIN_10, o_11);
|
||
|
vec3 tmpvar_18;
|
||
|
tmpvar_18 = ((o_11.Normal * vec3(0.5, 0.5, -0.5)) + 0.5);
|
||
|
res_9.xyz = tmpvar_18.xyz.xyz;
|
||
|
float tmpvar_19;
|
||
|
tmpvar_19 = o_11.Specular;
|
||
|
res_9.w = vec4(tmpvar_19).w;
|
||
|
return res_9;
|
||
|
}
|
||
|
|
||
|
void main ()
|
||
|
{
|
||
|
v2f_surf xlt_IN_20;
|
||
|
vec4 xl_retval_21;
|
||
|
vec4 tmpvar_22;
|
||
|
tmpvar_22 = vec4(0.0, 0.0, 0.0, 0.0);
|
||
|
xlt_IN_20.pos = tmpvar_22;
|
||
|
vec3 tmpvar_23;
|
||
|
tmpvar_23 = gl_TexCoord[0].xyz;
|
||
|
vec3 tmpvar_24;
|
||
|
tmpvar_24 = tmpvar_23;
|
||
|
xlt_IN_20.normal = tmpvar_24;
|
||
|
vec4 tmpvar_25;
|
||
|
tmpvar_25 = frag_surf (xlt_IN_20);
|
||
|
vec4 tmpvar_26;
|
||
|
tmpvar_26 = tmpvar_25;
|
||
|
xl_retval_21 = tmpvar_26;
|
||
|
vec4 tmpvar_27;
|
||
|
tmpvar_27 = xl_retval_21.xyzw;
|
||
|
vec4 tmpvar_28;
|
||
|
tmpvar_28 = tmpvar_27;
|
||
|
gl_FragData[0] = tmpvar_28;
|
||
|
}
|
||
|
|