mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 02:55:36 -05:00
92 lines
1.8 KiB
Text
92 lines
1.8 KiB
Text
|
struct v2f {
|
||
|
vec4 pos;
|
||
|
vec4 color;
|
||
|
};
|
||
|
struct appdata_base {
|
||
|
vec4 vertex;
|
||
|
vec3 normal;
|
||
|
vec4 texcoord;
|
||
|
};
|
||
|
mat3 xll_constructMat3 (
|
||
|
in mat4 m_1
|
||
|
)
|
||
|
{
|
||
|
vec3 tmpvar_2;
|
||
|
tmpvar_2 = m_1[0].xyz;
|
||
|
vec3 tmpvar_3;
|
||
|
tmpvar_3 = m_1[1].xyz;
|
||
|
vec3 tmpvar_4;
|
||
|
tmpvar_4 = m_1[2].xyz;
|
||
|
mat3 tmpvar_5;
|
||
|
vec3 tmpvar_6;
|
||
|
tmpvar_6 = tmpvar_2;
|
||
|
tmpvar_5[0] = tmpvar_6;
|
||
|
vec3 tmpvar_7;
|
||
|
tmpvar_7 = tmpvar_3;
|
||
|
tmpvar_5[1] = tmpvar_7;
|
||
|
vec3 tmpvar_8;
|
||
|
tmpvar_8 = tmpvar_4;
|
||
|
tmpvar_5[2] = tmpvar_8;
|
||
|
return tmpvar_5;
|
||
|
}
|
||
|
|
||
|
v2f vert (
|
||
|
in appdata_base v_9
|
||
|
)
|
||
|
{
|
||
|
vec3 normal_10;
|
||
|
v2f o_11;
|
||
|
vec4 tmpvar_12;
|
||
|
tmpvar_12 = (gl_ModelViewProjectionMatrix * v_9.vertex);
|
||
|
o_11.pos = tmpvar_12;
|
||
|
mat3 tmpvar_13;
|
||
|
tmpvar_13 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose);
|
||
|
vec3 tmpvar_14;
|
||
|
tmpvar_14 = (tmpvar_13 * v_9.normal);
|
||
|
normal_10 = tmpvar_14;
|
||
|
vec4 tmpvar_15;
|
||
|
tmpvar_15.w = 1.0;
|
||
|
tmpvar_15.xyz = ((normal_10 * 0.5) + 0.5).xyz;
|
||
|
vec4 tmpvar_16;
|
||
|
tmpvar_16 = tmpvar_15;
|
||
|
o_11.color = tmpvar_16;
|
||
|
return o_11;
|
||
|
}
|
||
|
|
||
|
void main ()
|
||
|
{
|
||
|
appdata_base xlt_v_17;
|
||
|
v2f xl_retval_18;
|
||
|
vec4 tmpvar_19;
|
||
|
tmpvar_19 = gl_Vertex.xyzw;
|
||
|
vec4 tmpvar_20;
|
||
|
tmpvar_20 = tmpvar_19;
|
||
|
xlt_v_17.vertex = tmpvar_20;
|
||
|
vec3 tmpvar_21;
|
||
|
tmpvar_21 = gl_Normal.xyz;
|
||
|
vec3 tmpvar_22;
|
||
|
tmpvar_22 = tmpvar_21;
|
||
|
xlt_v_17.normal = tmpvar_22;
|
||
|
vec4 tmpvar_23;
|
||
|
tmpvar_23 = gl_MultiTexCoord0.xyzw;
|
||
|
vec4 tmpvar_24;
|
||
|
tmpvar_24 = tmpvar_23;
|
||
|
xlt_v_17.texcoord = tmpvar_24;
|
||
|
v2f tmpvar_25;
|
||
|
tmpvar_25 = vert (xlt_v_17);
|
||
|
v2f tmpvar_26;
|
||
|
tmpvar_26 = tmpvar_25;
|
||
|
xl_retval_18 = tmpvar_26;
|
||
|
vec4 tmpvar_27;
|
||
|
tmpvar_27 = xl_retval_18.pos.xyzw;
|
||
|
vec4 tmpvar_28;
|
||
|
tmpvar_28 = tmpvar_27;
|
||
|
gl_Position = tmpvar_28;
|
||
|
vec4 tmpvar_29;
|
||
|
tmpvar_29 = xl_retval_18.color.xyzw;
|
||
|
vec4 tmpvar_30;
|
||
|
tmpvar_30 = tmpvar_29;
|
||
|
gl_FrontColor = tmpvar_30;
|
||
|
}
|
||
|
|