@@ -336,6 +336,15 @@ void SetCVARs()
336336 }
337337 }
338338
339+ static std::vector<std::pair<std::string, std::string>> HighVSMQuality = {
340+ {" r.Shadow.Virtual.SMRT.TexelDitherScale" , " 1" },
341+ {" r.Shadow.Virtual.MaxPhysicalPages" , " 4096" },
342+ {" r.Shadow.Virtual.SMRT.RayCountDirectional" , " 8" },
343+ {" r.Shadow.Virtual.SMRT.SamplesPerRayDirectional" , " 4" },
344+ {" r.Shadow.Virtual.SMRT.RayCountLocal" , " 8" },
345+ {" r.Shadow.Virtual.SMRT.SamplesPerRayLocal" , " 4" }
346+ };
347+
339348 cvarSharpen = Unreal::FindCVAR (" r.Tonemapper.Sharpen" , ConsoleObjects);
340349 cvarCA = Unreal::FindCVAR (" r.SceneColorFringeQuality" , ConsoleObjects);
341350 cvarVignette = Unreal::FindCVAR (" r.Tonemapper.Quality" , ConsoleObjects);
@@ -375,6 +384,21 @@ void SetCVARs()
375384 if (cvarVSMEnable && bVirtualShadowmaps && (cvarVSMEnable->GetInt () != 1 )) {
376385 cvarVSMEnable->Set (std::to_wstring (bVirtualShadowmaps).c_str ());
377386 spdlog::info (" CVar: r.Shadow.Virtual.Enable: Set to {}" , cvarVSMEnable->GetInt ());
387+
388+ // Set high quality VSM cvars
389+ for (const auto & cvar : HighVSMQuality) {
390+ auto consoleVariable = Unreal::FindCVAR (cvar.first , ConsoleObjects);
391+ if (consoleVariable) {
392+ // Convert to wstring
393+ std::wstring wValue (cvar.second .begin (), cvar.second .end ());
394+ // Set value
395+ consoleVariable->Set (wValue.c_str ());
396+ spdlog::info (" CVar: VSMs: Set {} to {}" , cvar.first , cvar.second );
397+ }
398+ else {
399+ spdlog::info (" CVar: VSMs: Failed to find {}" , cvar.first );
400+ }
401+ }
378402 }
379403 });
380404 }
0 commit comments