mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-12-02 08:31:55 +00:00
27a59a0cbc
vulkan, wasapi, quake injector features added. irc, avplug, cef plugins/drivers reworked/updated/added openal reverb, doppler effects added. 'dir' console command now attempts to view clicked files. lots of warning fixes, should now only be deprecation warnings for most targets (depending on compiler version anyway...). SendEntity finally reworked to use flags properly. effectinfo improved, other smc-targetted fixes. mapcluster stuff now has support for linux. .basebone+.baseframe now exist in ssqc. qcc: -Fqccx supports qccx syntax, including qccx hacks. don't expect these to work in fteqw nor dp though. qcc: rewrote function call handling to use refs rather than defs. this makes struct passing more efficient and makes the __out keyword usable with fields etc. qccgui: can cope a little better with non-unicode files. can now represent most quake chars. qcc: suppressed warnings from *extensions.qc git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5000 fc73d0e0-1445-4013-8a0c-d673dee63da5
68 lines
No EOL
2.1 KiB
C
68 lines
No EOL
2.1 KiB
C
#ifdef SKELETAL
|
|
vec4 skeletaltransform()
|
|
{
|
|
mat3x4 wmat;
|
|
wmat = m_bones[int(v_bone.x)] * v_weight.x;
|
|
wmat += m_bones[int(v_bone.y)] * v_weight.y;
|
|
wmat += m_bones[int(v_bone.z)] * v_weight.z;
|
|
wmat += m_bones[int(v_bone.w)] * v_weight.w;
|
|
return m_modelviewprojection * vec4(vec4(v_position.xyz, 1.0) * wmat, 1.0);
|
|
}
|
|
vec4 skeletaltransform_nst(out vec3 n, out vec3 t, out vec3 b)
|
|
{
|
|
mat3x4 wmat;
|
|
wmat = m_bones[int(v_bone.x)] * v_weight.x;
|
|
wmat += m_bones[int(v_bone.y)] * v_weight.y;
|
|
wmat += m_bones[int(v_bone.z)] * v_weight.z;
|
|
wmat += m_bones[int(v_bone.w)] * v_weight.w;
|
|
n = vec4(v_normal.xyz, 0.0) * wmat;
|
|
t = vec4(v_svector.xyz, 0.0) * wmat;
|
|
b = vec4(v_tvector.xyz, 0.0) * wmat;
|
|
return m_modelviewprojection * vec4(vec4(v_position.xyz, 1.0) * wmat, 1.0);
|
|
}
|
|
vec4 skeletaltransform_wnst(out vec3 w, out vec3 n, out vec3 t, out vec3 b)
|
|
{
|
|
mat3x4 wmat;
|
|
wmat = m_bones[int(v_bone.x)] * v_weight.x;
|
|
wmat += m_bones[int(v_bone.y)] * v_weight.y;
|
|
wmat += m_bones[int(v_bone.z)] * v_weight.z;
|
|
wmat += m_bones[int(v_bone.w)] * v_weight.w;
|
|
n = vec4(v_normal.xyz, 0.0) * wmat;
|
|
t = vec4(v_svector.xyz, 0.0) * wmat;
|
|
b = vec4(v_tvector.xyz, 0.0) * wmat;
|
|
w = vec4(v_position.xyz, 1.0) * wmat;
|
|
return m_modelviewprojection * vec4(w, 1.0);
|
|
}
|
|
vec4 skeletaltransform_n(out vec3 n)
|
|
{
|
|
mat3x4 wmat;
|
|
wmat = m_bones[int(v_bone.x)] * v_weight.x;
|
|
wmat += m_bones[int(v_bone.y)] * v_weight.y;
|
|
wmat += m_bones[int(v_bone.z)] * v_weight.z;
|
|
wmat += m_bones[int(v_bone.w)] * v_weight.w;
|
|
n = vec4(v_normal.xyz, 0.0) * wmat;
|
|
return m_modelviewprojection * vec4(vec4(v_position.xyz, 1.0) * wmat, 1.0);
|
|
}
|
|
#else
|
|
#define skeletaltransform ftetransform
|
|
vec4 skeletaltransform_wnst(out vec3 w, out vec3 n, out vec3 t, out vec3 b)
|
|
{
|
|
n = v_normal;
|
|
t = v_svector;
|
|
b = v_tvector;
|
|
w = v_position.xyz;
|
|
return ftetransform();
|
|
}
|
|
vec4 skeletaltransform_nst(out vec3 n, out vec3 t, out vec3 b)
|
|
{
|
|
n = v_normal;
|
|
t = v_svector;
|
|
b = v_tvector;
|
|
return ftetransform();
|
|
}
|
|
vec4 skeletaltransform_n(out vec3 n)
|
|
{
|
|
n = v_normal;
|
|
return ftetransform();
|
|
}
|
|
#endif |