From a3d438c4be7fa1880b0d9c953356b505afde8797 Mon Sep 17 00:00:00 2001 From: Garux Date: Mon, 26 Feb 2024 22:41:10 +0600 Subject: [PATCH] * adjust -light -trisoup to enable performance hack for games with low verts per lmed surf count (e.g. 64 in Q3): -bsp -meta -mv 999 //get big lmed surfs with max verts count = max trisoup verts (-debugsurfaces to debug) -light -extlmhacksize 1024 -trisoup //gen shaders for external lms and mark as trisoup --- tools/quake3/q3map2/light.cpp | 10 ++++++++++ tools/quake3/q3map2/light_ydnar.cpp | 6 ------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/tools/quake3/q3map2/light.cpp b/tools/quake3/q3map2/light.cpp index 0037a392..3cbf5a77 100644 --- a/tools/quake3/q3map2/light.cpp +++ b/tools/quake3/q3map2/light.cpp @@ -1990,6 +1990,16 @@ static void LightWorld( bool fastAllocate, bool bounceStore ){ /* ydnar: store off lightmaps */ StoreSurfaceLightmaps( fastAllocate, true ); + + /* ydnar: optional force-to-trisoup */ + if( trisoup ){ + for( auto& ds : bspDrawSurfaces ){ + if( ds.surfaceType == MST_PLANAR ){ + ds.surfaceType = MST_TRIANGLE_SOUP; + ds.lightmapNum[ 0 ] = -3; + } + } + } } diff --git a/tools/quake3/q3map2/light_ydnar.cpp b/tools/quake3/q3map2/light_ydnar.cpp index de799ae6..ecb259ef 100644 --- a/tools/quake3/q3map2/light_ydnar.cpp +++ b/tools/quake3/q3map2/light_ydnar.cpp @@ -201,12 +201,6 @@ void SmoothNormals(){ smoothed[ f ] = true; } } - - /* ydnar: optional force-to-trisoup */ - if ( trisoup && ds.surfaceType == MST_PLANAR ) { - ds.surfaceType = MST_TRIANGLE_SOUP; - ds.lightmapNum[ 0 ] = -3; - } } /* bail if no surfaces have a shade angle */