Handle soft particles when loading graphics quality preset, #604

When applying the currently configured graphics quality preset
(it's set in the `com_machineSpec` CVar and applied with the
`execMachineSpec` command, or by using the menu), now soft particles
are disabled for all quality presets except for ultra, because this
feature has a noticeable impact on performance with some (slower) GPUs.
This commit is contained in:
Daniel Gibson 2024-08-16 00:25:34 +02:00
parent be2b788c67
commit 2f9e52a804
2 changed files with 4 additions and 1 deletions

View file

@ -1414,6 +1414,7 @@ bool OSX_GetCPUIdentification( int& cpuId, bool& oldArchitecture );
void Com_ExecMachineSpec_f( const idCmdArgs &args ) {
// DG: add an optional "nores" argument for "don't change the resolution" (r_mode)
bool nores = args.Argc() > 1 && idStr::Icmp( args.Argv(1), "nores" ) == 0;
cvarSystem->SetCVarInteger( "r_useSoftParticles", 0, CVAR_ARCHIVE ); // DG: disable soft particles for all but ultra
if ( com_machineSpec.GetInteger() == 3 ) { // ultra
//cvarSystem->SetCVarInteger( "image_anisotropy", 1, CVAR_ARCHIVE ); DG: redundant, set again below
cvarSystem->SetCVarInteger( "image_lodbias", 0, CVAR_ARCHIVE );
@ -1436,6 +1437,7 @@ void Com_ExecMachineSpec_f( const idCmdArgs &args ) {
cvarSystem->SetCVarInteger( "r_mode", 5, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "image_useNormalCompression", 0, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "r_multiSamples", 0, CVAR_ARCHIVE );
cvarSystem->SetCVarInteger( "r_useSoftParticles", 1, CVAR_ARCHIVE ); // DG: enable soft particles for ultra preset
} else if ( com_machineSpec.GetInteger() == 2 ) { // high
cvarSystem->SetCVarString( "image_filter", "GL_LINEAR_MIPMAP_LINEAR", CVAR_ARCHIVE );
//cvarSystem->SetCVarInteger( "image_anisotropy", 1, CVAR_ARCHIVE ); DG: redundant, set again below

View file

@ -1674,7 +1674,8 @@ static CVarOption videoOptionsImmediately[] = {
D3::ImGuiHooks::ShowWarningOverlay( "Capturing the Depth Buffer was disabled.\nEnabled it because soft particles need it!" );
}
}
AddCVarOptionTooltips( cvar );
const char* descr = "! Can slow down rendering !\nSoften particle transitions when player walks through them or they cross solid geometry. Needs r_enableDepthCapture.";
AddCVarOptionTooltips( cvar, descr );
} ),
CVarOption( "Advanced Options" ),