mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
98 lines
1.9 KiB
Text
98 lines
1.9 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;
|
||
|
vec3 tmpvar_6;
|
||
|
tmpvar_6 = vec3(0.5, 0.5, 0.5);
|
||
|
o_2.Albedo = tmpvar_6;
|
||
|
vec4 tmpvar_7;
|
||
|
tmpvar_7 = texture2D (_MainTex, uv_3);
|
||
|
vec3 tmpvar_8;
|
||
|
tmpvar_8 = (tmpvar_7.xyz * 0.5);
|
||
|
o_2.Emission = tmpvar_8;
|
||
|
}
|
||
|
|
||
|
vec4 frag_surf (
|
||
|
in v2f_surf IN_9
|
||
|
)
|
||
|
{
|
||
|
vec4 res_10;
|
||
|
Input surfIN_11;
|
||
|
SurfaceOutput o_12;
|
||
|
vec3 tmpvar_13;
|
||
|
tmpvar_13 = vec3(0.0, 0.0, 0.0);
|
||
|
o_12.Albedo = tmpvar_13;
|
||
|
vec3 tmpvar_14;
|
||
|
tmpvar_14 = vec3(0.0, 0.0, 0.0);
|
||
|
o_12.Emission = tmpvar_14;
|
||
|
float tmpvar_15;
|
||
|
tmpvar_15 = 0.0;
|
||
|
o_12.Specular = tmpvar_15;
|
||
|
float tmpvar_16;
|
||
|
tmpvar_16 = 0.0;
|
||
|
o_12.Alpha = tmpvar_16;
|
||
|
float tmpvar_17;
|
||
|
tmpvar_17 = 0.0;
|
||
|
o_12.Gloss = tmpvar_17;
|
||
|
vec3 tmpvar_18;
|
||
|
tmpvar_18 = IN_9.normal;
|
||
|
o_12.Normal = tmpvar_18;
|
||
|
surf (surfIN_11, o_12);
|
||
|
vec3 tmpvar_19;
|
||
|
tmpvar_19 = ((o_12.Normal * vec3(0.5, 0.5, -0.5)) + 0.5);
|
||
|
res_10.xyz = tmpvar_19.xyz.xyz;
|
||
|
float tmpvar_20;
|
||
|
tmpvar_20 = o_12.Specular;
|
||
|
res_10.w = vec4(tmpvar_20).w;
|
||
|
return res_10;
|
||
|
}
|
||
|
|
||
|
void main ()
|
||
|
{
|
||
|
v2f_surf xlt_IN_21;
|
||
|
vec4 xl_retval_22;
|
||
|
vec4 tmpvar_23;
|
||
|
tmpvar_23 = vec4(0.0, 0.0, 0.0, 0.0);
|
||
|
xlt_IN_21.pos = tmpvar_23;
|
||
|
vec3 tmpvar_24;
|
||
|
tmpvar_24 = gl_TexCoord[0].xyz;
|
||
|
vec3 tmpvar_25;
|
||
|
tmpvar_25 = tmpvar_24;
|
||
|
xlt_IN_21.normal = tmpvar_25;
|
||
|
vec4 tmpvar_26;
|
||
|
tmpvar_26 = frag_surf (xlt_IN_21);
|
||
|
vec4 tmpvar_27;
|
||
|
tmpvar_27 = tmpvar_26;
|
||
|
xl_retval_22 = tmpvar_27;
|
||
|
vec4 tmpvar_28;
|
||
|
tmpvar_28 = xl_retval_22.xyzw;
|
||
|
vec4 tmpvar_29;
|
||
|
tmpvar_29 = tmpvar_28;
|
||
|
gl_FragData[0] = tmpvar_29;
|
||
|
}
|
||
|
|