mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 17:18:12 -05:00
105 lines
2.1 KiB
Text
105 lines
2.1 KiB
Text
|
struct v2f_surf {
|
||
|
vec4 pos;
|
||
|
vec3 normal;
|
||
|
};
|
||
|
struct appdata_full {
|
||
|
vec4 vertex;
|
||
|
vec4 tangent;
|
||
|
vec3 normal;
|
||
|
vec4 texcoord;
|
||
|
vec4 texcoord1;
|
||
|
vec4 color;
|
||
|
};
|
||
|
attribute vec4 TANGENT;
|
||
|
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_surf vert_surf (
|
||
|
in appdata_full v_9
|
||
|
)
|
||
|
{
|
||
|
v2f_surf o_10;
|
||
|
vec4 tmpvar_11;
|
||
|
tmpvar_11 = (gl_ModelViewProjectionMatrix * v_9.vertex);
|
||
|
o_10.pos = tmpvar_11;
|
||
|
mat3 tmpvar_12;
|
||
|
tmpvar_12 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose);
|
||
|
vec3 tmpvar_13;
|
||
|
tmpvar_13 = (tmpvar_12 * v_9.normal);
|
||
|
o_10.normal = tmpvar_13;
|
||
|
return o_10;
|
||
|
}
|
||
|
|
||
|
void main ()
|
||
|
{
|
||
|
appdata_full xlt_v_14;
|
||
|
v2f_surf xl_retval_15;
|
||
|
vec4 tmpvar_16;
|
||
|
tmpvar_16 = gl_Vertex.xyzw;
|
||
|
vec4 tmpvar_17;
|
||
|
tmpvar_17 = tmpvar_16;
|
||
|
xlt_v_14.vertex = tmpvar_17;
|
||
|
vec4 tmpvar_18;
|
||
|
tmpvar_18 = TANGENT.xyzw;
|
||
|
vec4 tmpvar_19;
|
||
|
tmpvar_19 = tmpvar_18;
|
||
|
xlt_v_14.tangent = tmpvar_19;
|
||
|
vec3 tmpvar_20;
|
||
|
tmpvar_20 = gl_Normal.xyz;
|
||
|
vec3 tmpvar_21;
|
||
|
tmpvar_21 = tmpvar_20;
|
||
|
xlt_v_14.normal = tmpvar_21;
|
||
|
vec4 tmpvar_22;
|
||
|
tmpvar_22 = gl_MultiTexCoord0.xyzw;
|
||
|
vec4 tmpvar_23;
|
||
|
tmpvar_23 = tmpvar_22;
|
||
|
xlt_v_14.texcoord = tmpvar_23;
|
||
|
vec4 tmpvar_24;
|
||
|
tmpvar_24 = gl_MultiTexCoord1.xyzw;
|
||
|
vec4 tmpvar_25;
|
||
|
tmpvar_25 = tmpvar_24;
|
||
|
xlt_v_14.texcoord1 = tmpvar_25;
|
||
|
vec4 tmpvar_26;
|
||
|
tmpvar_26 = gl_Color.xyzw;
|
||
|
vec4 tmpvar_27;
|
||
|
tmpvar_27 = tmpvar_26;
|
||
|
xlt_v_14.color = tmpvar_27;
|
||
|
v2f_surf tmpvar_28;
|
||
|
tmpvar_28 = vert_surf (xlt_v_14);
|
||
|
v2f_surf tmpvar_29;
|
||
|
tmpvar_29 = tmpvar_28;
|
||
|
xl_retval_15 = tmpvar_29;
|
||
|
vec4 tmpvar_30;
|
||
|
tmpvar_30 = xl_retval_15.pos.xyzw;
|
||
|
vec4 tmpvar_31;
|
||
|
tmpvar_31 = tmpvar_30;
|
||
|
gl_Position = tmpvar_31;
|
||
|
vec4 tmpvar_32;
|
||
|
tmpvar_32.w = 0.0;
|
||
|
tmpvar_32.xyz = xl_retval_15.normal.xyz;
|
||
|
vec4 tmpvar_33;
|
||
|
tmpvar_33 = tmpvar_32;
|
||
|
gl_TexCoord[0] = tmpvar_33;
|
||
|
}
|
||
|
|