From c3de4a5c3b66d5163ee66642a291993eb90a23f7 Mon Sep 17 00:00:00 2001 From: Alibek Omarov Date: Sat, 2 Nov 2024 02:18:43 +0300 Subject: [PATCH] ref: gl: add fullbright textures to the list with VBO renderer --- ref/gl/gl_rsurf.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/ref/gl/gl_rsurf.c b/ref/gl/gl_rsurf.c index e0e89ecd..714f20f9 100644 --- a/ref/gl/gl_rsurf.c +++ b/ref/gl/gl_rsurf.c @@ -3194,9 +3194,15 @@ qboolean R_AddSurfToVBO( msurface_t *surf, qboolean buildlightmap ) buildlightmap &= !r_fullbright->value && !!WORLDMODEL->lightdata; - // draw details in regular way - if( r_vbo_detail.value == 0 && surf->texinfo ) - R_RenderDetailsForSurface( surf, surf->texinfo->texture ); + if( surf->texinfo != NULL ) + { + // fullbright textures are rare, no sense to build VBO for them + R_RenderFullbrightForSurface( surf, surf->texinfo->texture ); + + // draw details in regular way + if( r_vbo_detail.value ) + R_RenderDetailsForSurface( surf, surf->texinfo->texture ); + } if( buildlightmap && R_CheckLightMap( surf )) {