mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-10 14:42:13 +00:00
fix juddery flickery lerpy models.
git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4294 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
ebbb9bd149
commit
694f36a615
2 changed files with 25 additions and 18 deletions
|
@ -1508,7 +1508,8 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
|
|||
mesh->normals_array = meshcache.anorm;
|
||||
mesh->snormals_array = meshcache.anorms;
|
||||
mesh->tnormals_array = meshcache.anormt;
|
||||
*vbop = meshcache.vbop;
|
||||
if (vbop)
|
||||
*vbop = meshcache.vbop;
|
||||
|
||||
#ifdef SKELETALMODELS
|
||||
if (meshcache.usebonepose)
|
||||
|
@ -1539,7 +1540,9 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
|
|||
|
||||
#ifdef SKELETALMODELS
|
||||
meshcache.usebonepose = NULL;
|
||||
*vbop = meshcache.vbop = NULL;
|
||||
meshcache.vbop = NULL;
|
||||
if (vbop)
|
||||
*vbop = NULL;
|
||||
if (inf->ofs_skel_xyz && !inf->ofs_skel_weight)
|
||||
{
|
||||
//if we have skeletal xyz info, but no skeletal weights, then its a partial model that cannot possibly be animated.
|
||||
|
@ -1550,19 +1553,22 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
|
|||
mesh->snormals_array = (vec3_t*)((char*)inf + inf->ofs_skel_svect);
|
||||
mesh->tnormals_array = (vec3_t*)((char*)inf + inf->ofs_skel_tvect);
|
||||
|
||||
meshcache.vbo.indicies = inf->vboindicies;
|
||||
meshcache.vbo.indexcount = inf->numindexes;
|
||||
meshcache.vbo.vertcount = inf->numverts;
|
||||
meshcache.vbo.texcoord = inf->vbotexcoords;
|
||||
meshcache.vbo.coord = inf->vbo_skel_verts;
|
||||
memset(&meshcache.vbo.coord2, 0, sizeof(meshcache.vbo.coord2));
|
||||
meshcache.vbo.normals = inf->vbo_skel_normals;
|
||||
meshcache.vbo.svector = inf->vbo_skel_svector;
|
||||
meshcache.vbo.tvector = inf->vbo_skel_tvector;
|
||||
meshcache.vbo.bonenums = inf->vbo_skel_bonenum;
|
||||
meshcache.vbo.boneweights = inf->vbo_skel_bweight;
|
||||
if (meshcache.vbo.indicies.dummy)
|
||||
*vbop = meshcache.vbop = &meshcache.vbo;
|
||||
if (vbop)
|
||||
{
|
||||
meshcache.vbo.indicies = inf->vboindicies;
|
||||
meshcache.vbo.indexcount = inf->numindexes;
|
||||
meshcache.vbo.vertcount = inf->numverts;
|
||||
meshcache.vbo.texcoord = inf->vbotexcoords;
|
||||
meshcache.vbo.coord = inf->vbo_skel_verts;
|
||||
memset(&meshcache.vbo.coord2, 0, sizeof(meshcache.vbo.coord2));
|
||||
meshcache.vbo.normals = inf->vbo_skel_normals;
|
||||
meshcache.vbo.svector = inf->vbo_skel_svector;
|
||||
meshcache.vbo.tvector = inf->vbo_skel_tvector;
|
||||
meshcache.vbo.bonenums = inf->vbo_skel_bonenum;
|
||||
meshcache.vbo.boneweights = inf->vbo_skel_bweight;
|
||||
if (meshcache.vbo.indicies.dummy)
|
||||
*vbop = meshcache.vbop = &meshcache.vbo;
|
||||
}
|
||||
}
|
||||
else if (inf->numbones)
|
||||
{
|
||||
|
@ -1713,7 +1719,7 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
|
|||
mesh->xyz2_array = (vecV_t *)((char *)p2 + p2->ofsverts);
|
||||
}
|
||||
|
||||
if (meshcache.vbo.indicies.dummy)
|
||||
if (vbop && meshcache.vbo.indicies.dummy)
|
||||
*vbop = meshcache.vbop = &meshcache.vbo;
|
||||
}
|
||||
}
|
||||
|
@ -1723,7 +1729,8 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
|
|||
meshcache.anorm = mesh->normals_array;
|
||||
meshcache.anorms = mesh->snormals_array;
|
||||
meshcache.anormt = mesh->tnormals_array;
|
||||
meshcache.vbop = *vbop;
|
||||
if (vbop)
|
||||
meshcache.vbop = *vbop;
|
||||
|
||||
#ifdef SKELETALMODELS
|
||||
if (meshcache.usebonepose)
|
||||
|
|
|
@ -3506,7 +3506,7 @@ static void DrawMeshes(void)
|
|||
}
|
||||
}
|
||||
|
||||
if (shaderstate.sourcevbo->coord2.gl.addr)
|
||||
if (shaderstate.sourcevbo->coord2.gl.addr && (shaderstate.curshader->numdeforms || !shaderstate.curshader->prog))
|
||||
GenerateVertexBlends(shaderstate.curshader);
|
||||
else if (shaderstate.curshader->numdeforms)
|
||||
GenerateVertexDeforms(shaderstate.curshader);
|
||||
|
|
Loading…
Reference in a new issue