OpenGL2: Use CPU vertex animation if too few vertex attributes
OpenGL ES has a minimum of 8 vertex attributes while desktop OpenGL has a minimum of 16. Vertex animation uses attributes 10 to 12.
This commit is contained in:
1 parent
b25a3c6e4d
commit
98b9008c0d
5 files changed
+53
-11
No files matched your search
@@ -282,9 +282,10 @@ R_AddMD3Surfaces
|
||||
*/
|
||||
void R_AddMD3Surfaces( trRefEntity_t *ent ) {
|
||||
int i;
|
||||
mdvModel_t *model = NULL;
|
||||
mdvSurface_t *surface = NULL;
|
||||
shader_t *shader = NULL;
|
||||
mdvModel_t *model;
|
||||
mdvSurface_t *surface;
|
||||
void *drawSurf;
|
||||
shader_t *shader;
|
||||
int cull;
|
||||
int lod;
|
||||
int fogNum;
|
||||
@@ -382,6 +383,12 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
|
||||
shader = tr.shaders[ surface->shaderIndexes[ ent->e.skinNum % surface->numShaderIndexes ] ];
|
||||
}
|
||||
|
||||
if ( model->numVaoSurfaces > 0 ) {
|
||||
drawSurf = &model->vaoSurfaces[i];
|
||||
} else {
|
||||
drawSurf = surface;
|
||||
}
|
||||
|
||||
// we will add shadows even if the main object isn't visible in the view
|
||||
|
||||
// stencil shadows can't do personal models unless I polyhedron clip
|
||||
@@ -390,7 +397,7 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
|
||||
&& fogNum == 0
|
||||
&& !(ent->e.renderfx & ( RF_NOSHADOW | RF_DEPTHHACK ) )
|
||||
&& shader->sort == SS_OPAQUE ) {
|
||||
R_AddDrawSurf( (void *)&model->vaoSurfaces[i], tr.shadowShader, 0, qfalse, qfalse, 0 );
|
||||
R_AddDrawSurf( drawSurf, tr.shadowShader, 0, qfalse, qfalse, 0 );
|
||||
}
|
||||
|
||||
// projection shadows work fine with personal models
|
||||
@@ -398,12 +405,12 @@ void R_AddMD3Surfaces( trRefEntity_t *ent ) {
|
||||
&& fogNum == 0
|
||||
&& (ent->e.renderfx & RF_SHADOW_PLANE )
|
||||
&& shader->sort == SS_OPAQUE ) {
|
||||
R_AddDrawSurf( (void *)&model->vaoSurfaces[i], tr.projectionShadowShader, 0, qfalse, qfalse, 0 );
|
||||
R_AddDrawSurf( drawSurf, tr.projectionShadowShader, 0, qfalse, qfalse, 0 );
|
||||
}
|
||||
|
||||
// don't add third_person objects if not viewing through a portal
|
||||
if ( !personalModel ) {
|
||||
R_AddDrawSurf((void *)&model->vaoSurfaces[i], shader, fogNum, qfalse, qfalse, cubemapIndex );
|
||||
R_AddDrawSurf( drawSurf, shader, fogNum, qfalse, qfalse, cubemapIndex );
|
||||
}
|
||||
|
||||
surface++;
|
||||
|
||||
Reference in new issue
Block a user