mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-12-04 21:31:11 -05:00
88 lines
1.7 KiB
Text
88 lines
1.7 KiB
Text
|
struct SurfaceOutput {
|
||
|
vec3 Albedo;
|
||
|
vec3 Normal;
|
||
|
vec3 Emission;
|
||
|
float Specular;
|
||
|
float Gloss;
|
||
|
float Alpha;
|
||
|
};
|
||
|
struct Input {
|
||
|
vec3 worldRefl;
|
||
|
};
|
||
|
struct v2f_surf {
|
||
|
vec4 pos;
|
||
|
vec3 normal;
|
||
|
};
|
||
|
uniform samplerCube _Cube;
|
||
|
void surf (
|
||
|
in Input IN_1,
|
||
|
inout SurfaceOutput o_2
|
||
|
)
|
||
|
{
|
||
|
vec4 tmpvar_3;
|
||
|
tmpvar_3 = textureCube (_Cube, IN_1.worldRefl);
|
||
|
vec3 tmpvar_4;
|
||
|
tmpvar_4 = tmpvar_3.xyz;
|
||
|
o_2.Albedo = tmpvar_4;
|
||
|
}
|
||
|
|
||
|
vec4 frag_surf (
|
||
|
in v2f_surf IN_5
|
||
|
)
|
||
|
{
|
||
|
vec4 res_6;
|
||
|
Input surfIN_7;
|
||
|
SurfaceOutput o_8;
|
||
|
vec3 tmpvar_9;
|
||
|
tmpvar_9 = vec3(0.0, 0.0, 0.0);
|
||
|
o_8.Albedo = tmpvar_9;
|
||
|
vec3 tmpvar_10;
|
||
|
tmpvar_10 = vec3(0.0, 0.0, 0.0);
|
||
|
o_8.Emission = tmpvar_10;
|
||
|
float tmpvar_11;
|
||
|
tmpvar_11 = 0.0;
|
||
|
o_8.Specular = tmpvar_11;
|
||
|
float tmpvar_12;
|
||
|
tmpvar_12 = 0.0;
|
||
|
o_8.Alpha = tmpvar_12;
|
||
|
float tmpvar_13;
|
||
|
tmpvar_13 = 0.0;
|
||
|
o_8.Gloss = tmpvar_13;
|
||
|
vec3 tmpvar_14;
|
||
|
tmpvar_14 = IN_5.normal;
|
||
|
o_8.Normal = tmpvar_14;
|
||
|
surf (surfIN_7, o_8);
|
||
|
vec3 tmpvar_15;
|
||
|
tmpvar_15 = ((o_8.Normal * vec3(0.5, 0.5, -0.5)) + 0.5);
|
||
|
res_6.xyz = tmpvar_15.xyz.xyz;
|
||
|
float tmpvar_16;
|
||
|
tmpvar_16 = o_8.Specular;
|
||
|
res_6.w = vec4(tmpvar_16).w;
|
||
|
return res_6;
|
||
|
}
|
||
|
|
||
|
void main ()
|
||
|
{
|
||
|
v2f_surf xlt_IN_17;
|
||
|
vec4 xl_retval_18;
|
||
|
vec4 tmpvar_19;
|
||
|
tmpvar_19 = vec4(0.0, 0.0, 0.0, 0.0);
|
||
|
xlt_IN_17.pos = tmpvar_19;
|
||
|
vec3 tmpvar_20;
|
||
|
tmpvar_20 = gl_TexCoord[0].xyz;
|
||
|
vec3 tmpvar_21;
|
||
|
tmpvar_21 = tmpvar_20;
|
||
|
xlt_IN_17.normal = tmpvar_21;
|
||
|
vec4 tmpvar_22;
|
||
|
tmpvar_22 = frag_surf (xlt_IN_17);
|
||
|
vec4 tmpvar_23;
|
||
|
tmpvar_23 = tmpvar_22;
|
||
|
xl_retval_18 = tmpvar_23;
|
||
|
vec4 tmpvar_24;
|
||
|
tmpvar_24 = xl_retval_18.xyzw;
|
||
|
vec4 tmpvar_25;
|
||
|
tmpvar_25 = tmpvar_24;
|
||
|
gl_FragData[0] = tmpvar_25;
|
||
|
}
|
||
|
|