mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-29 02:55:36 -05:00
180 lines
4.2 KiB
Text
180 lines
4.2 KiB
Text
struct v2f_surf {
|
|
vec4 pos;
|
|
vec4 hip_pack0;
|
|
vec3 TtoV0;
|
|
vec3 TtoV1;
|
|
vec3 TtoV2;
|
|
};
|
|
struct appdata_full {
|
|
vec4 vertex;
|
|
vec4 tangent;
|
|
vec3 normal;
|
|
vec4 texcoord;
|
|
vec4 texcoord1;
|
|
vec4 color;
|
|
};
|
|
uniform vec4 _BumpMap_ST;
|
|
uniform vec4 _MainTex_ST;
|
|
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
|
|
)
|
|
{
|
|
mat3 rotation_10;
|
|
vec3 binormal_11;
|
|
v2f_surf o_12;
|
|
vec4 tmpvar_13;
|
|
tmpvar_13 = (gl_ModelViewProjectionMatrix * v_9.vertex);
|
|
o_12.pos = tmpvar_13;
|
|
vec2 tmpvar_14;
|
|
tmpvar_14 = ((v_9.texcoord.xy * _MainTex_ST.xy) + _MainTex_ST.zw);
|
|
o_12.hip_pack0.xy = tmpvar_14.xy.xy;
|
|
vec2 tmpvar_15;
|
|
tmpvar_15 = ((v_9.texcoord.xy * _BumpMap_ST.xy) + _BumpMap_ST.zw);
|
|
o_12.hip_pack0.zw = tmpvar_15.xxxy.zw;
|
|
vec3 tmpvar_16;
|
|
tmpvar_16 = cross (v_9.normal, v_9.tangent.xyz);
|
|
vec3 tmpvar_17;
|
|
tmpvar_17 = (tmpvar_16 * v_9.tangent.w);
|
|
binormal_11 = tmpvar_17;
|
|
mat3 tmpvar_18;
|
|
float tmpvar_19;
|
|
tmpvar_19 = v_9.tangent.x;
|
|
tmpvar_18[0].x = tmpvar_19;
|
|
float tmpvar_20;
|
|
tmpvar_20 = binormal_11.x;
|
|
tmpvar_18[0].y = tmpvar_20;
|
|
float tmpvar_21;
|
|
tmpvar_21 = v_9.normal.x;
|
|
tmpvar_18[0].z = tmpvar_21;
|
|
float tmpvar_22;
|
|
tmpvar_22 = v_9.tangent.y;
|
|
tmpvar_18[1].x = tmpvar_22;
|
|
float tmpvar_23;
|
|
tmpvar_23 = binormal_11.y;
|
|
tmpvar_18[1].y = tmpvar_23;
|
|
float tmpvar_24;
|
|
tmpvar_24 = v_9.normal.y;
|
|
tmpvar_18[1].z = tmpvar_24;
|
|
float tmpvar_25;
|
|
tmpvar_25 = v_9.tangent.z;
|
|
tmpvar_18[2].x = tmpvar_25;
|
|
float tmpvar_26;
|
|
tmpvar_26 = binormal_11.z;
|
|
tmpvar_18[2].y = tmpvar_26;
|
|
float tmpvar_27;
|
|
tmpvar_27 = v_9.normal.z;
|
|
tmpvar_18[2].z = tmpvar_27;
|
|
mat3 tmpvar_28;
|
|
tmpvar_28 = tmpvar_18;
|
|
rotation_10 = tmpvar_28;
|
|
mat3 tmpvar_29;
|
|
tmpvar_29 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose);
|
|
vec3 tmpvar_30;
|
|
tmpvar_30 = (rotation_10 * tmpvar_29[0].xyz);
|
|
o_12.TtoV0 = tmpvar_30;
|
|
mat3 tmpvar_31;
|
|
tmpvar_31 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose);
|
|
vec3 tmpvar_32;
|
|
tmpvar_32 = (rotation_10 * tmpvar_31[1].xyz);
|
|
o_12.TtoV1 = tmpvar_32;
|
|
mat3 tmpvar_33;
|
|
tmpvar_33 = xll_constructMat3 (gl_ModelViewMatrixInverseTranspose);
|
|
vec3 tmpvar_34;
|
|
tmpvar_34 = (rotation_10 * tmpvar_33[2].xyz);
|
|
o_12.TtoV2 = tmpvar_34;
|
|
return o_12;
|
|
}
|
|
|
|
void main ()
|
|
{
|
|
appdata_full xlt_v_35;
|
|
v2f_surf xl_retval_36;
|
|
vec4 tmpvar_37;
|
|
tmpvar_37 = gl_Vertex.xyzw;
|
|
vec4 tmpvar_38;
|
|
tmpvar_38 = tmpvar_37;
|
|
xlt_v_35.vertex = tmpvar_38;
|
|
vec4 tmpvar_39;
|
|
tmpvar_39 = TANGENT.xyzw;
|
|
vec4 tmpvar_40;
|
|
tmpvar_40 = tmpvar_39;
|
|
xlt_v_35.tangent = tmpvar_40;
|
|
vec3 tmpvar_41;
|
|
tmpvar_41 = gl_Normal.xyz;
|
|
vec3 tmpvar_42;
|
|
tmpvar_42 = tmpvar_41;
|
|
xlt_v_35.normal = tmpvar_42;
|
|
vec4 tmpvar_43;
|
|
tmpvar_43 = gl_MultiTexCoord0.xyzw;
|
|
vec4 tmpvar_44;
|
|
tmpvar_44 = tmpvar_43;
|
|
xlt_v_35.texcoord = tmpvar_44;
|
|
vec4 tmpvar_45;
|
|
tmpvar_45 = gl_MultiTexCoord1.xyzw;
|
|
vec4 tmpvar_46;
|
|
tmpvar_46 = tmpvar_45;
|
|
xlt_v_35.texcoord1 = tmpvar_46;
|
|
vec4 tmpvar_47;
|
|
tmpvar_47 = gl_Color.xyzw;
|
|
vec4 tmpvar_48;
|
|
tmpvar_48 = tmpvar_47;
|
|
xlt_v_35.color = tmpvar_48;
|
|
v2f_surf tmpvar_49;
|
|
tmpvar_49 = vert_surf (xlt_v_35);
|
|
v2f_surf tmpvar_50;
|
|
tmpvar_50 = tmpvar_49;
|
|
xl_retval_36 = tmpvar_50;
|
|
vec4 tmpvar_51;
|
|
tmpvar_51 = xl_retval_36.pos.xyzw;
|
|
vec4 tmpvar_52;
|
|
tmpvar_52 = tmpvar_51;
|
|
gl_Position = tmpvar_52;
|
|
vec4 tmpvar_53;
|
|
tmpvar_53 = xl_retval_36.hip_pack0.xyzw;
|
|
vec4 tmpvar_54;
|
|
tmpvar_54 = tmpvar_53;
|
|
gl_TexCoord[0] = tmpvar_54;
|
|
vec4 tmpvar_55;
|
|
tmpvar_55.w = 0.0;
|
|
tmpvar_55.xyz = xl_retval_36.TtoV0.xyz;
|
|
vec4 tmpvar_56;
|
|
tmpvar_56 = tmpvar_55;
|
|
gl_TexCoord[1] = tmpvar_56;
|
|
vec4 tmpvar_57;
|
|
tmpvar_57.w = 0.0;
|
|
tmpvar_57.xyz = xl_retval_36.TtoV1.xyz;
|
|
vec4 tmpvar_58;
|
|
tmpvar_58 = tmpvar_57;
|
|
gl_TexCoord[2] = tmpvar_58;
|
|
vec4 tmpvar_59;
|
|
tmpvar_59.w = 0.0;
|
|
tmpvar_59.xyz = xl_retval_36.TtoV2.xyz;
|
|
vec4 tmpvar_60;
|
|
tmpvar_60 = tmpvar_59;
|
|
gl_TexCoord[3] = tmpvar_60;
|
|
}
|
|
|