Speed up bakeLightGrids by turning off vsync temporarily

This commit is contained in:
Robert Beckebans 2023-03-08 18:37:52 +01:00
parent aa0610fc99
commit e664ac1665
2 changed files with 9 additions and 0 deletions

View file

@ -34,6 +34,8 @@ Changelog:
* Tweaked some lights in the hangar
* LightEditor: Draw volume of selected light and move it with arrow keys
## .plan - March 05, 2023

View file

@ -1166,6 +1166,10 @@ CONSOLE_COMMAND( bakeLightGrids, "Bake irradiance/vis light grid data", NULL )
}
}
// turn vsync off for faster capturing of the probes
int oldVsync = r_swapInterval.GetInteger();
r_swapInterval.SetInteger( 0 );
idLib::Printf( "----------------------------------\n" );
idLib::Printf( "Processing %i light probes in %i areas for %i bounces\n", totalProcessedProbes, totalProcessedAreas, bounces );
//common->Printf( "ETA %5.1f minutes\n\n", ( totalEnd - totalStart ) / ( 1000.0f * 60 ) );
@ -1465,5 +1469,8 @@ CONSOLE_COMMAND( bakeLightGrids, "Bake irradiance/vis light grid data", NULL )
idLib::Printf( "----------------------------------\n" );
idLib::Printf( "Processed %i light probes in %i areas\n", totalProcessedProbes, totalProcessedAreas );
common->Printf( "Baked light grid irradiance in %5.1f minutes\n\n", ( totalEnd - totalStart ) / ( 1000.0f * 60 ) );
// restore vsync setting
r_swapInterval.SetInteger( oldVsync );
}