Skip to content

Instantly share code, notes, and snippets.

@PrzemekWolw
Last active January 26, 2025 20:33
Show Gist options
  • Save PrzemekWolw/9dddd642128f79d3f83636bc09b022ca to your computer and use it in GitHub Desktop.
Save PrzemekWolw/9dddd642128f79d3f83636bc09b022ca to your computer and use it in GitHub Desktop.
Additional settings for Persona 3 Reload, HDR, TSR, FXAA, No AA, Shader Precompilation and more

Additional settings for Persona 3 Reload, HDR, TSR, FXAA, No AA, Shader Precompilation and more

This UE4SS script will allow you to adjust sever settings in Persona 3 Reload. It's fully compatible with P3RFix by Lyall.

This allows you to:

  • Enabling 10 bit HDR Display Output
  • Switching between original TAA, no AA, FXAA and TSR
  • Changing streaming pool
  • Adjusting sharpness
  • Adjusting Anisotropic Filtering
  • Lowering quality of shaders
  • Disabling Shadows (speedrun any%)
  • Disabling Eye Adaptation
  • Disabling Screen Space Ambient Occlussion
  • Disabling Bloom
  • Disabling Screen Space Reflections
  • Using SSR in places where it doesn't appear on non RT cards
  • Forcing Ray Tracing on every scene
  • Disabling a lot of PostFX effects
  • Disabling texture streaming
  • Enabling Shader Permutations Precompilation

Known issues:

  • Enabling TSR breaks some viewports, like some special attacks and city map view
  • Enabling shader precompilation causes delays and stutter in loading screens and on scene changes

Installing the thing:

  • Download UE4SS and unpack it to your game installation folder ./P3R/Binaries/Win64 or ./content/P3R/Binaries/WinGDK
  • In the same folder open folder Mods and create there P3R_AdditionalSettings and in a newly created folder create scripts folder
  • In the scripts folder put attached main.lua file
  • In mods folder open mods.txt and add there P3R_AdditionalSettings : 1 line and save the file
local UEHelpers = require("UEHelpers")
local GetKismetSystemLibrary = UEHelpers.GetKismetSystemLibrary
local ksl = GetKismetSystemLibrary()
local engine = FindFirstOf("Engine")
local canExecute = true
local init = false
-- mod settings, change these to your liking
local HDROut = false -- Enable 10bit HDR Output
local antiAliasingMode = 'tsr' -- Supports, "disabled", "fxaa" and "tsr". To use game default TAA set to nil (without the ''). 'tsr' breaks some viewports
local texturesPoolMB = 6144 -- Pool for textures in mb.
local sharpenTonemapper = 0.7 -- A value between 0.5 to 1.0 is recommended. 10.0 is the maximum. To use default settings set to nil (without the '').
local anisotropicFiltering = 16 -- Supports values, 0, 2, 4, 8, 16. Game default is 8. To use default settings set to nil (without the '')
local lowShaderQuality = false -- Low shader quality.
local disableShadows = false -- Disable all shadows, skips story to the end.
local disableEyeAdaptation = false -- Disables eye adaptation/auto exposure.
local disableSSAO = false -- Disables Screen Space Ambient Occlussion.
local disableBloom = false -- Disables bloom.
local disableSSR = false -- Disables Screen Space Reflections.
local hybridReflections = false -- Uses SSR where RT is applicable.
local forceRTeverywhere = true -- Enables Ray Traced Reflections on all levels.
local disableFog = false -- Disables Fog.
local disableDof = false -- Disables Depth of Field.
local disableMotionBlur = false -- Disables Motion Blur.
local disableLensFlare = false -- Disables Lens Flare.
local disableStreaming = true -- Disables textures streaming. Loads all texture assets on level load to reduce CPU overhead with a cost of memory usage.
local enablePSOPrecomp = true -- Enables shader permutations precompilation on game load to avoid #stutterstruggle. Will cause interruptions on level changes.
-- Atlus plz fix your fuckin PC port
-- We are waiting for a hotfix: 22 days
-- from now on do not touch
--- @param cmd string
function ExecCmd(cmd)
if not ksl:IsValid() then
error("KismetSystemLibrary not valid\n")
end
ExecuteInGameThread(function()
ksl:ExecuteConsoleCommand(
engine,
cmd,
nil
)
end)
end
function Init()
if init then
return
end
init = true
LoopAsync(500, function()
if HDROut == true then
ExecCmd("r.AllowHDR 1")
ExecCmd("r.HDR.EnableHDROutput 1")
ExecCmd("r.HDR.Display.OutputDevice 3")
ExecCmd("r.HDR.Display.ColorGamut 4")
ExecCmd("r.HDR.UI.CompositeMode 1")
ExecCmd("r.HDR.UI.Level 1")
end
if antiAliasingMode == 'fxaa' then
ExecCmd("r.DefaultFeature.AntiAliasing 1")
ExecCmd("r.PostProcessAAQuality 4")
elseif antiAliasingMode == 'tsr' then
ExecCmd("r.DefaultFeature.AntiAliasing 2")
ExecCmd("r.PostProcessAAQuality 4")
ExecCmd("r.TemporalAA.Upsampling 1")
ExecCmd("r.TemporalAA.Algorithm 1")
elseif antiAliasingMode == 'disabled' then
ExecCmd("r.DefaultFeature.AntiAliasing 0")
ExecCmd("r.PostProcessAAQuality 0")
end
if texturesPoolMB ~= nil then
local command = 'r.Streaming.PoolSize '..tostring(texturesPoolMB)
ExecCmd(command)
end
if sharpenTonemapper ~= nil then
local command = 'r.Tonemapper.Sharpen '..tostring(sharpenTonemapper)
ExecCmd(command)
end
if anisotropicFiltering ~= nil then
local command = 'r.MaxAnisotropy '..tostring(anisotropicFiltering)
ExecCmd(command)
end
if lowShaderQuality == true then
ExecCmd("r.RefractionQuality 0")
ExecCmd("r.DetailMode 0")
ExecCmd("r.TranslucencyVolumeBlur 0")
ExecCmd("r.MaterialQualityLevel 0")
end
if disableEyeAdaptation == true then
ExecCmd("r.EyeAdaptationQuality 0")
end
if disableSSAO == true then
ExecCmd("r.AmbientOcclusionLevels 0")
end
if forceRTeverywhere == true then
ExecCmd("r.RayTracing.Reflections 1")
end
if hybridReflections == true then
ExecCmd("r.RayTracing.Reflections.Hybrid 1")
end
if disableBloom == true then
ExecCmd("r.BloomQuality 0")
end
if disableSSR == true then
ExecCmd("r.SSR 0")
end
if disableFog == true then
ExecCmd("r.Fog 0")
ExecCmd("r.VolumetricFog 0")
end
if disableDof == true then
ExecCmd("r.DepthOfFieldQuality 0")
end
if disableMotionBlur == true then
ExecCmd("r.MotionBlurQuality 0")
end
if disableLensFlare == true then
ExecCmd("r.LensFlareQuality 0")
end
if disableStreaming == true then
ExecCmd("r.TextureStreaming 0")
end
if disableShadows == true then
ExecCmd("r.ShadowQuality 0")
ExecCmd("r.Shadow.CSM.MaxCascades 0")
ExecCmd("r.Shadow.MaxResolution 0")
ExecCmd("r.Shadow.RadiusThreshold 0")
ExecCmd("r.Shadow.DistanceScale 0")
ExecCmd("r.Shadow.CSM.TransitionScale 0")
end
if enablePSOPrecomp == true then
ExecCmd("r.CreateShadersOnLoad 1")
ExecCmd("niagara.CreateShadersOnLoad 1")
end
return false
end)
end
function ExecuteDelayedFix()
if not canExecute then
return
end
Init()
canExecute = false
local delay = 50
while delay < 500 do
ExecuteWithDelay(delay, function()
if HDROut == true then
ExecCmd("r.AllowHDR 1")
ExecCmd("r.HDR.EnableHDROutput 1")
ExecCmd("r.HDR.Display.OutputDevice 3")
ExecCmd("r.HDR.Display.ColorGamut 4")
ExecCmd("r.HDR.UI.CompositeMode 1")
ExecCmd("r.HDR.UI.Level 1")
end
if antiAliasingMode == 'fxaa' then
ExecCmd("r.DefaultFeature.AntiAliasing 1")
ExecCmd("r.PostProcessAAQuality 4")
elseif antiAliasingMode == 'tsr' then
ExecCmd("r.DefaultFeature.AntiAliasing 2")
ExecCmd("r.PostProcessAAQuality 4")
ExecCmd("r.TemporalAA.Upsampling 1")
ExecCmd("r.TemporalAA.Algorithm 1")
elseif antiAliasingMode == 'disabled' then
ExecCmd("r.DefaultFeature.AntiAliasing 0")
ExecCmd("r.PostProcessAAQuality 0")
end
if texturesPoolMB ~= nil then
local command = 'r.Streaming.PoolSize '..tostring(texturesPoolMB)
ExecCmd(command)
end
if sharpenTonemapper ~= nil then
local command = 'r.Tonemapper.Sharpen '..tostring(sharpenTonemapper)
ExecCmd(command)
end
if anisotropicFiltering ~= nil then
local command = 'r.MaxAnisotropy '..tostring(anisotropicFiltering)
ExecCmd(command)
end
if lowShaderQuality == true then
ExecCmd("r.RefractionQuality 0")
ExecCmd("r.DetailMode 0")
ExecCmd("r.TranslucencyVolumeBlur 0")
ExecCmd("r.MaterialQualityLevel 0")
end
if disableEyeAdaptation == true then
ExecCmd("r.EyeAdaptationQuality 0")
end
if disableSSAO == true then
ExecCmd("r.AmbientOcclusionLevels 0")
end
if forceRTeverywhere == true then
ExecCmd("r.RayTracing.Reflections 1")
end
if hybridReflections == true then
ExecCmd("r.RayTracing.Reflections.Hybrid 1")
end
if disableBloom == true then
ExecCmd("r.BloomQuality 0")
end
if disableSSR == true then
ExecCmd("r.SSR 0")
end
if disableFog == true then
ExecCmd("r.Fog 0")
ExecCmd("r.VolumetricFog 0")
end
if disableDof == true then
ExecCmd("r.DepthOfFieldQuality 0")
end
if disableMotionBlur == true then
ExecCmd("r.MotionBlurQuality 0")
end
if disableLensFlare == true then
ExecCmd("r.LensFlareQuality 0")
end
if disableStreaming == true then
ExecCmd("r.TextureStreaming 0")
end
if disableShadows == true then
ExecCmd("r.ShadowQuality 0")
ExecCmd("r.Shadow.CSM.MaxCascades 0")
ExecCmd("r.Shadow.MaxResolution 0")
ExecCmd("r.Shadow.RadiusThreshold 0")
ExecCmd("r.Shadow.DistanceScale 0")
ExecCmd("r.Shadow.CSM.TransitionScale 0")
end
if enablePSOPrecomp == true then
ExecCmd("r.CreateShadersOnLoad 1")
ExecCmd("niagara.CreateShadersOnLoad 1")
end
canExecute = true
end)
delay = delay * 2
end
end
NotifyOnNewObject("/Script/Engine.Level", function()
ExecuteDelayedFix()
end)
@PrzemekWolw
Copy link
Author

thanks bro, spent a lot of time to search this solution to improve P3R performance on my overheating gaming laptop. Just added some new lines and my videocard W goes brrr: 75W -> ~40W

Good to know that it's useful :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment