mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 02:55:36 -05:00
92 lines
1.7 KiB
Text
92 lines
1.7 KiB
Text
|
struct v2f {
|
||
|
vec4 pos;
|
||
|
vec4 color;
|
||
|
};
|
||
|
struct appdata_base {
|
||
|
vec4 vertex;
|
||
|
vec3 normal;
|
||
|
vec4 texcoord;
|
||
|
};
|
||
|
mat3 xll_constructMat3 (
|
||
|
in mat4 m
|
||
|
)
|
||
|
{
|
||
|
vec3 tmpvar_1;
|
||
|
tmpvar_1 = m[0].xyz;
|
||
|
vec3 tmpvar_2;
|
||
|
tmpvar_2 = m[1].xyz;
|
||
|
vec3 tmpvar_3;
|
||
|
tmpvar_3 = m[2].xyz;
|
||
|
mat3 tmpvar_4;
|
||
|
vec3 tmpvar_5;
|
||
|
tmpvar_5 = tmpvar_1;
|
||
|
tmpvar_4[0] = tmpvar_5;
|
||
|
vec3 tmpvar_6;
|
||
|
tmpvar_6 = tmpvar_2;
|
||
|
tmpvar_4[1] = tmpvar_6;
|
||
|
vec3 tmpvar_7;
|
||
|
tmpvar_7 = tmpvar_3;
|
||
|
tmpvar_4[2] = tmpvar_7;
|
||
|
return tmpvar_4;
|
||
|
}
|
||
|
|
||
|
v2f vert (
|
||
|
in appdata_base v
|
||
|
)
|
||
|
{
|
||
|
vec3 normal;
|
||
|
v2f o;
|
||
|
vec4 tmpvar_1;
|
||
|
tmpvar_1 = (gl_ModelViewProjectionMatrix * v.vertex);
|
||
|
o.pos = tmpvar_1;
|
||
|
mat3 tmpvar_2;
|
||
|
tmpvar_2 = (xll_constructMat3 (gl_ModelViewMatrixInverseTranspose));
|
||
|
vec3 tmpvar_3;
|
||
|
tmpvar_3 = (tmpvar_2 * v.normal);
|
||
|
normal = tmpvar_3;
|
||
|
vec4 tmpvar_4;
|
||
|
tmpvar_4.w = 1.0;
|
||
|
tmpvar_4.xyz = ((normal * 0.5) + 0.5).xyz;
|
||
|
vec4 tmpvar_5;
|
||
|
tmpvar_5 = tmpvar_4;
|
||
|
o.color = tmpvar_5;
|
||
|
return o;
|
||
|
}
|
||
|
|
||
|
void main ()
|
||
|
{
|
||
|
appdata_base xlt_v;
|
||
|
v2f xl_retval;
|
||
|
vec4 tmpvar_1;
|
||
|
tmpvar_1 = gl_Vertex.xyzw;
|
||
|
vec4 tmpvar_2;
|
||
|
tmpvar_2 = tmpvar_1;
|
||
|
xlt_v.vertex = tmpvar_2;
|
||
|
vec3 tmpvar_3;
|
||
|
tmpvar_3 = gl_Normal.xyz;
|
||
|
vec3 tmpvar_4;
|
||
|
tmpvar_4 = tmpvar_3;
|
||
|
xlt_v.normal = tmpvar_4;
|
||
|
vec4 tmpvar_5;
|
||
|
tmpvar_5 = gl_MultiTexCoord0.xyzw;
|
||
|
vec4 tmpvar_6;
|
||
|
tmpvar_6 = tmpvar_5;
|
||
|
xlt_v.texcoord = tmpvar_6;
|
||
|
v2f tmpvar_7;
|
||
|
tmpvar_7 = vert (xlt_v);
|
||
|
v2f tmpvar_8;
|
||
|
tmpvar_8 = tmpvar_7;
|
||
|
xl_retval = tmpvar_8;
|
||
|
vec4 tmpvar_9;
|
||
|
tmpvar_9 = xl_retval.pos.xyzw;
|
||
|
vec4 tmpvar_10;
|
||
|
tmpvar_10 = tmpvar_9;
|
||
|
gl_Position = tmpvar_10;
|
||
|
vec4 tmpvar_11;
|
||
|
tmpvar_11 = xl_retval.color.xyzw;
|
||
|
vec4 tmpvar_12;
|
||
|
tmpvar_12 = tmpvar_11;
|
||
|
gl_FrontColor = tmpvar_12;
|
||
|
}
|
||
|
|