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