From 055003a1c78341222d3909cea3413de18808a621 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Thu, 2 Jul 2020 13:37:13 +0000 Subject: [PATCH] Don't Mod_BuildTextureVectorsFromNormals if 2D. 5-10% performance improvement This is likely not needed for 2D and there doesn't appear to be any defects, visual or otherwise. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12775 d7cf8633-e32d-0410-b094-e92efae38249 --- model_shared.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/model_shared.c b/model_shared.c index f4f74cd9..86ab5c52 100644 --- a/model_shared.c +++ b/model_shared.c @@ -4705,6 +4705,7 @@ void Mod_Mesh_Finalize(dp_model_t *mod) Mod_Mesh_Validate(mod); Mod_Mesh_ComputeBounds(mod); Mod_Mesh_MakeSortedSurfaces(mod); - Mod_BuildTextureVectorsFromNormals(0, mod->surfmesh.num_vertices, mod->surfmesh.num_triangles, mod->surfmesh.data_vertex3f, mod->surfmesh.data_texcoordtexture2f, mod->surfmesh.data_normal3f, mod->surfmesh.data_element3i, mod->surfmesh.data_svector3f, mod->surfmesh.data_tvector3f, true); + if(!r_refdef.draw2dstage) + Mod_BuildTextureVectorsFromNormals(0, mod->surfmesh.num_vertices, mod->surfmesh.num_triangles, mod->surfmesh.data_vertex3f, mod->surfmesh.data_texcoordtexture2f, mod->surfmesh.data_normal3f, mod->surfmesh.data_element3i, mod->surfmesh.data_svector3f, mod->surfmesh.data_tvector3f, true); Mod_Mesh_UploadDynamicBuffers(mod); } -- 2.39.2