From 2f9e52a8047c9e41801439b8ccd5a7b6db6c97d0 Mon Sep 17 00:00:00 2001 From: Daniel Gibson Date: Fri, 16 Aug 2024 00:25:34 +0200 Subject: [PATCH] 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. --- neo/framework/Common.cpp | 2 ++ neo/framework/Dhewm3SettingsMenu.cpp | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/neo/framework/Common.cpp b/neo/framework/Common.cpp index 89f75f11..95d11fb2 100644 --- a/neo/framework/Common.cpp +++ b/neo/framework/Common.cpp @@ -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 diff --git a/neo/framework/Dhewm3SettingsMenu.cpp b/neo/framework/Dhewm3SettingsMenu.cpp index ac2e373b..66d654a4 100644 --- a/neo/framework/Dhewm3SettingsMenu.cpp +++ b/neo/framework/Dhewm3SettingsMenu.cpp @@ -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" ),