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->normals_array = meshcache.anorm;
|
||||||
mesh->snormals_array = meshcache.anorms;
|
mesh->snormals_array = meshcache.anorms;
|
||||||
mesh->tnormals_array = meshcache.anormt;
|
mesh->tnormals_array = meshcache.anormt;
|
||||||
*vbop = meshcache.vbop;
|
if (vbop)
|
||||||
|
*vbop = meshcache.vbop;
|
||||||
|
|
||||||
#ifdef SKELETALMODELS
|
#ifdef SKELETALMODELS
|
||||||
if (meshcache.usebonepose)
|
if (meshcache.usebonepose)
|
||||||
|
@ -1539,7 +1540,9 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, vbo_t **vbop, galiasinfo_t *inf, in
|
||||||
|
|
||||||
#ifdef SKELETALMODELS
|
#ifdef SKELETALMODELS
|
||||||
meshcache.usebonepose = NULL;
|
meshcache.usebonepose = NULL;
|
||||||
*vbop = meshcache.vbop = NULL;
|
meshcache.vbop = NULL;
|
||||||
|
if (vbop)
|
||||||
|
*vbop = NULL;
|
||||||
if (inf->ofs_skel_xyz && !inf->ofs_skel_weight)
|
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.
|
//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->snormals_array = (vec3_t*)((char*)inf + inf->ofs_skel_svect);
|
||||||
mesh->tnormals_array = (vec3_t*)((char*)inf + inf->ofs_skel_tvect);
|
mesh->tnormals_array = (vec3_t*)((char*)inf + inf->ofs_skel_tvect);
|
||||||
|
|
||||||
meshcache.vbo.indicies = inf->vboindicies;
|
if (vbop)
|
||||||
meshcache.vbo.indexcount = inf->numindexes;
|
{
|
||||||
meshcache.vbo.vertcount = inf->numverts;
|
meshcache.vbo.indicies = inf->vboindicies;
|
||||||
meshcache.vbo.texcoord = inf->vbotexcoords;
|
meshcache.vbo.indexcount = inf->numindexes;
|
||||||
meshcache.vbo.coord = inf->vbo_skel_verts;
|
meshcache.vbo.vertcount = inf->numverts;
|
||||||
memset(&meshcache.vbo.coord2, 0, sizeof(meshcache.vbo.coord2));
|
meshcache.vbo.texcoord = inf->vbotexcoords;
|
||||||
meshcache.vbo.normals = inf->vbo_skel_normals;
|
meshcache.vbo.coord = inf->vbo_skel_verts;
|
||||||
meshcache.vbo.svector = inf->vbo_skel_svector;
|
memset(&meshcache.vbo.coord2, 0, sizeof(meshcache.vbo.coord2));
|
||||||
meshcache.vbo.tvector = inf->vbo_skel_tvector;
|
meshcache.vbo.normals = inf->vbo_skel_normals;
|
||||||
meshcache.vbo.bonenums = inf->vbo_skel_bonenum;
|
meshcache.vbo.svector = inf->vbo_skel_svector;
|
||||||
meshcache.vbo.boneweights = inf->vbo_skel_bweight;
|
meshcache.vbo.tvector = inf->vbo_skel_tvector;
|
||||||
if (meshcache.vbo.indicies.dummy)
|
meshcache.vbo.bonenums = inf->vbo_skel_bonenum;
|
||||||
*vbop = meshcache.vbop = &meshcache.vbo;
|
meshcache.vbo.boneweights = inf->vbo_skel_bweight;
|
||||||
|
if (meshcache.vbo.indicies.dummy)
|
||||||
|
*vbop = meshcache.vbop = &meshcache.vbo;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (inf->numbones)
|
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);
|
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;
|
*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.anorm = mesh->normals_array;
|
||||||
meshcache.anorms = mesh->snormals_array;
|
meshcache.anorms = mesh->snormals_array;
|
||||||
meshcache.anormt = mesh->tnormals_array;
|
meshcache.anormt = mesh->tnormals_array;
|
||||||
meshcache.vbop = *vbop;
|
if (vbop)
|
||||||
|
meshcache.vbop = *vbop;
|
||||||
|
|
||||||
#ifdef SKELETALMODELS
|
#ifdef SKELETALMODELS
|
||||||
if (meshcache.usebonepose)
|
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);
|
GenerateVertexBlends(shaderstate.curshader);
|
||||||
else if (shaderstate.curshader->numdeforms)
|
else if (shaderstate.curshader->numdeforms)
|
||||||
GenerateVertexDeforms(shaderstate.curshader);
|
GenerateVertexDeforms(shaderstate.curshader);
|
||||||
|
|
Loading…
Reference in a new issue