; ------------------------------------------------------------------------------
; READ THIS before editing!
;
; These device profiles are hierarchical! Changes to the base XSX device 
; profile will also affect all derived device profiles (unless those values are 
; overridden)
;
; Please don't duplicate values across multiple device profiles unnecessarily
;
; Hierarchy:
;    
; XSX_Anaconda_120                                       XSX_Lockhart_120                           
;     |                                                        |
; XSX_Anaconda_60                                        XSX_Lockhart_60
;     |                                                        |
; XSX_Anaconda_30                                        XSX_Lockhart_30
;     |                                                        |
; XSX_Anaconda                                           XSX_Lockhart
;     |                                                        |
;     ----------------------------------------------------------
;                             |
;                            XSX         
;
; Notes: 
; - XSX is the device profile for the base game, with all shared settings
; - XSX_Anaconda and XSX_Lockhart device profiles are for the variants
; - *_30 device profiles are for the 30 Hz 'pretty' preset device profiles
; - *_60 device profiles are for the 60 Hz 'balanced' preset device profiles
; - *_120 device profiles are for the 120 Hz 'fast' preset device profiles
; ------------------------------------------------------------------------------

[DeviceProfiles]
+DeviceProfileNameAndTypes=XSX_Anaconda_30,XSX
+DeviceProfileNameAndTypes=XSX_Anaconda_60,XSX
+DeviceProfileNameAndTypes=XSX_Anaconda_120,XSX
+DeviceProfileNameAndTypes=XSX_Lockhart_30,XSX
+DeviceProfileNameAndTypes=XSX_Lockhart_60,XSX
+DeviceProfileNameAndTypes=XSX_Lockhart_120,XSX
 
; ------------------------------------------------------------------------------
; Base XSX device profile
; ------------------------------------------------------------------------------
[XSX DeviceProfile]
BaseProfileName=
TextureLODGroups=(Group=TEXTUREGROUP_World,OptionalMaxLODSize=1024,MinLODSize=1,MaxLODSize=2048,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_WorldNormalMap,MinLODSize=1,MaxLODSize=1024,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_WorldSpecular,MinLODSize=1,MaxLODSize=1024,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Character,OptionalMaxLODSize=1024,MinLODSize=1,MaxLODSize=2048,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_CharacterNormalMap,MinLODSize=1,MaxLODSize=1024,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_CharacterSpecular,MinLODSize=1,MaxLODSize=1024,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Weapon,OptionalMaxLODSize=1024,MinLODSize=1,MaxLODSize=2048,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_WeaponNormalMap,MinLODSize=1,MaxLODSize=1024,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_WeaponSpecular,MinLODSize=1,MaxLODSize=1024,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Vehicle,OptionalMaxLODSize=1024,MinLODSize=1,MaxLODSize=2048,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_VehicleNormalMap,MinLODSize=1,MaxLODSize=1024,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_VehicleSpecular,MinLODSize=1,MaxLODSize=1024,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Cinematic,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Effects,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=linear,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_EffectsNotFiltered,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Skybox,OptionalMaxLODSize=2048,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_UI,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_NoMipmaps)
+TextureLODGroups=(Group=TEXTUREGROUP_Lightmap,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Shadowmap,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,NumStreamedMips=3,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_RenderTarget,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_MobileFlattened,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Terrain_Heightmap,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Terrain_Weightmap,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Bokeh,MinLODSize=1,MaxLODSize=256,LODBias=0,MinMagFilter=linear,MipFilter=linear,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Pixels2D,MinLODSize=1,MaxLODSize=4096,LODBias=0,MinMagFilter=point,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)

; Scalability Groups
+CVars=sg.ViewDistanceQuality=3
+CVars=sg.AntiAliasingQuality=3
+CVars=sg.ShadowQuality=3
+CVars=sg.PostProcessQuality=3
+CVars=sg.TextureQuality=3
+CVars=sg.EffectsQuality=3

; Don't need to wait very long for texture streaming to catch up
CommonLoadingScreen.HoldLoadingScreenAdditionalSecs=0.5

+CVars=r.TemporalAA.R11G11B10History=1

; Epic quality materials - Others discarded at cook
+CVars=r.MaterialQualityLevel=3

+CVars=r.StaticMesh.MinLodQualityLevel=3

+CVars=r.Streaming.PoolSize=2048

; Dynamic res/temporal upsampling
+CVars=r.DynamicRes.OperationMode=2
+CVars=r.TemporalAA.Upsampling=1
+CVars=r.DynamicRes.FrameTimeBudget=16.66
+CVars=r.DynamicRes.TargetedGPUHeadRoomPercentage=3.5
+CVars=r.DynamicRes.MaxScreenPercentage=100
+CVars=r.DynamicRes.MinScreenPercentage=50
+CVars=r.SecondaryScreenPercentage.GameViewport=83.33

; Postprocess overrides
; FORT-349350 FORT-353656 disable compute postprocessing to workaround a flickering issue on series X
+CVars=r.PostProcessing.PreferCompute=0
+CVars=r.HZBOcclusion=0
;+CVars=r.AmbientOcclusion.Compute=2
+CVars=r.AmbientOcclusionLevels=1
+CVars=r.AmbientOcclusionMipLevelFactor=10
+CVars=r.BloomQuality=4
+CVars=r.SceneColorFormat=3

; Effects quality overrides (from sg.EffectsQuality=2)
+CVars=r.SSS.Scale=1
+CVars=r.SSS.SampleSet=1
+CVars=r.SSS.Quality=-1
+CVars=r.SSS.HalfRes=1
; Workaround for FORT-354096. Remove this after fixing barrier batching logic in the d3d12 RHI
+CVars=r.SSS.Burley.SubmitCommandsBeforeSetup=1

; Shadow quality overrides (from sg.ShadowQuality=2)
+CVars=r.AOQuality=1
+CVars=r.VolumetricFog.GridPixelSize=16
+CVars=r.VolumetricFog.GridSizeZ=64
+CVars=r.ContactShadows=1
+CVars=r.VolumetricFog=1
+CVars=r.Shadow.MaxNumFarShadowCascades=1
+CVars=r.Shadow.FarShadowStaticMeshLODBias=1

; Virtual heightfield mesh settings
;+CVars=r.VT.RVT.TileCountBias.Group1=5
+CVars=r.VHM.Enable=0

+CVars=grass.densityScale=1.5

;Physics
+CVars=r.PhysicsField.EnableField=true

; Rendertargets
+CVars=r.RenderTargetPoolMin=550
+CVars=r.Shadow.WholeSceneShadowCacheMb=300

; Set virtual texture update rate
+CVars=r.VT.MaxUploadsPerFrame=2

; Workaround for FORT-357614
+CVars=d3d12.SeparateRTV2SRVTranstions=1

; Workaround for depth bounds test always being disabled when PSOs are created using the new API
+CVars=d3d12.UseNewPSOCreationAPI=0

; ------------------------------------------------------------------------------
; Anaconda device profiles
; ------------------------------------------------------------------------------
[XSX_Anaconda DeviceProfile]
; Enable specific rendering features
; Gen5 TAAU. Anaconda only for now (res is more important on Lockhart)
+CVars=r.SSS.Quality=1 ; Quality=0 relies on Gen4 TAA's clamping box
+CVars=r.AntiAliasingMethod=4
+CVars=r.DynamicRes.MaxScreenPercentage=85
+CVars=r.DynamicRes.MinScreenPercentage=40
+CVars=r.SecondaryScreenPercentage.GameViewport=100
+CVars=r.Shadow.MaxCSMResolution=2048
+CVars=r.Shadow.MaxResolution=2048

; ------------------------------------------------------------------------------

[XSX_Anaconda_30 DeviceProfile]
DeviceType=XSX
BaseProfileName=XSX_Anaconda

; Color-coding thresholds / hitch thresholds for 30 Hz
+CVars=t.TargetFrameTimeThreshold=33.9
+CVars=t.UnacceptableFrameTimeThreshold=50
+CVars=t.HitchFrameTimeThreshold=60
+CVars=t.HitchDeadTimeWindow=200.0

; FPS/input latency config
+CVars=Lyra.DeviceProfile.Console.TargetFPS=30
+CVars=Lyra.DeviceProfile.Console.FrameSyncType=2

; ------------------------------------------------------------------------------

[XSX_Anaconda_60 DeviceProfile]
DeviceType=XSX
BaseProfileName=XSX_Anaconda_30

; Disable Lumen at 60 and above
+CVars=sg.GlobalIlluminationQuality=1

; Color-coding thresholds / hitch thresholds for 60 Hz
+CVars=t.TargetFrameTimeThreshold=16.7
+CVars=t.UnacceptableFrameTimeThreshold=25.0
+CVars=t.HitchFrameTimeThreshold=30.0
+CVars=t.HitchDeadTimeWindow=100.0

; FPS/input latency config
+CVars=Lyra.DeviceProfile.Console.TargetFPS=60
+CVars=Lyra.DeviceProfile.Console.FrameSyncType=0

; ------------------------------------------------------------------------------

[XSX_Anaconda_120 DeviceProfile]
DeviceType=XSX
BaseProfileName=XSX_Anaconda_60

; Scalability groups
+CVars=sg.ShadowQuality=2

; Color-coding thresholds / hitch thresholds for 120 Hz
+CVars=t.TargetFrameTimeThreshold=8.4
+CVars=t.UnacceptableFrameTimeThreshold=12.5
+CVars=t.HitchFrameTimeThreshold=30.0
+CVars=t.HitchDeadTimeWindow=100.0

; FPS/input latency config
+CVars=Lyra.DeviceProfile.Console.TargetFPS=120
+CVars=Lyra.DeviceProfile.Console.FrameSyncType=0

; 120FPS
+CVars=r.DynamicRes.FrameTimeBudget=8.33
+CVars=r.VT.MaxUploadsPerFrame=1

; 1440p
+CVars=r.SecondaryScreenPercentage.GameViewport=66.67
+CVars=r.DynamicRes.MaxScreenPercentage=100

; TAAU1
+CVars=r.AntiAliasingMethod=2
+CVars=r.TemporalAA.Quality=1

; Disable some next-gen features
+CVars=r.ContactShadows=0

; Shadows
+CVars=r.Shadow.MaxNumFarShadowCascades=0
+CVars=r.Shadow.MaxCSMResolution=1800
+CVars=r.Shadow.MaxResolution=1800
+CVars=r.DFShadowQuality=2

; View distance/density
+CVars=r.ViewDistanceScale=2.0
+CVars=r.EmitterSpawnRateScale=0.5
+CVars=grass.densityScale=1

; Postprocessing
+CVars=r.Filter.SizeScale=0.8
+CVars=r.FastBlurThreshold=3
+CVars=r.MotionBlurQuality=3
+CVars=r.SceneColorFringeQuality=0

; Other settings
+CVars=r.TranslucencyLightingVolumeDim=48
+CVars=r.TranslucencyVolumeBlur=0
+CVars=r.VolumetricCloud.StepSizeOnZeroConservativeDensity=4


; ------------------------------------------------------------------------------
; Lockhart device profiles
; ------------------------------------------------------------------------------
[XSX_Lockhart DeviceProfile]
; Similar to XboxOne_Scorpio for now
+CVars=sg.ShadowQuality=2

; TAAU1
+CVars=r.AntiAliasingMethod=2
+CVars=r.TemporalAA.Quality=1

+CVars=r.SceneColorFringeQuality=0
+CVars=r.MotionBlurQuality=3
+CVars=r.TranslucencyVolumeBlur=0
+CVars=r.FastBlurThreshold=3
+CVars=r.Filter.SizeScale=0.8
+CVars=r.EmitterSpawnRateScale=0.5
+CVars=r.ParticleLightQuality=1
+CVars=r.SSS.Quality=-1
+CVars=r.SSS.SampleSet=1
+CVars=r.SSR.Quality=2
+CVars=r.TranslucencyLightingVolumeDim=48
+CVars=r.DFShadowQuality=2
+CVars=r.ViewDistanceScale=2.2
+CVars=r.Streaming.PoolSize=1800

; Output 1200p (percentage of 1440p)
+CVars=r.SecondaryScreenPercentage.GameViewport=83.33

; Shadow settings (overriding XB1 SG 2)
+CVars=r.Shadow.MaxCSMResolution=2048
+CVars=r.Shadow.MaxResolution=2048
+CVars=r.Shadow.CachedShadowsCastFromMovablePrimitives=1
+CVars=r.RenderTargetPoolMin=450

; Enable specific rendering features
+CVars=r.ContactShadows=0

; We need to override explicitly here (even though they're defined above) because they're set in the base engine version of the XSX_Lockhart deviceprofile assuming a 4K backbuffer
+CVars=r.DynamicRes.MaxScreenPercentage=100
+CVars=r.DynamicRes.MinScreenPercentage=50

; ------------------------------------------------------------------------------

[XSX_Lockhart_30 DeviceProfile]
DeviceType=XSX
BaseProfileName=XSX_Lockhart

; Color-coding thresholds / hitch thresholds for 30 Hz
+CVars=t.TargetFrameTimeThreshold=33.9
+CVars=t.UnacceptableFrameTimeThreshold=50
+CVars=t.HitchFrameTimeThreshold=60
+CVars=t.HitchDeadTimeWindow=200.0

; FPS/input latency config
+CVars=Lyra.DeviceProfile.Console.TargetFPS=30
+CVars=Lyra.DeviceProfile.Console.FrameSyncType=2

; ------------------------------------------------------------------------------

[XSX_Lockhart_60 DeviceProfile]
DeviceType=XSX
BaseProfileName=XSX_Lockhart_30

; Disable Lumen at 60 and above
+CVars=sg.GlobalIlluminationQuality=1

; Color-coding thresholds / hitch thresholds for 60 Hz
+CVars=t.TargetFrameTimeThreshold=16.7
+CVars=t.UnacceptableFrameTimeThreshold=25.0
+CVars=t.HitchFrameTimeThreshold=30.0
+CVars=t.HitchDeadTimeWindow=100.0

; FPS/input latency config
+CVars=Lyra.DeviceProfile.Console.TargetFPS=60
+CVars=Lyra.DeviceProfile.Console.FrameSyncType=0

; ------------------------------------------------------------------------------

[XSX_Lockhart_120 DeviceProfile]
DeviceType=XSX
BaseProfileName=XSX_Lockhart_60

; Scalability groups
+CVars=sg.ViewDistanceQuality=2
+CVars=sg.PostProcessQuality=2

; Color-coding thresholds / hitch thresholds for 120 Hz
+CVars=t.TargetFrameTimeThreshold=8.4
+CVars=t.UnacceptableFrameTimeThreshold=12.5
+CVars=t.HitchFrameTimeThreshold=30.0
+CVars=t.HitchDeadTimeWindow=100.0

; FPS/input latency config
+CVars=Lyra.DeviceProfile.Console.TargetFPS=120
+CVars=Lyra.DeviceProfile.Console.FrameSyncType=0

; 120FPS
+CVars=xsx.MaxRefreshRate=120
+CVars=r.DynamicRes.FrameTimeBudget=8.33
+CVars=r.VT.MaxUploadsPerFrame=1

; 1080p (percentage of 1440p)
+CVars=r.SecondaryScreenPercentage.GameViewport=75

; Shadows
+CVars=r.Shadow.MaxNumFarShadowCascades=0
+CVars=r.Shadow.MaxResolution=1024
+CVars=r.Shadow.MaxCSMResolution=1024
+CVars=r.distancefieldao=0
; Reduce skylight intensity when disabling DFAO to maintain similar contrast
+CVars=r.SkylightIntensityMultiplier=0.7
+CVars=r.ShadowQuality=3
+CVars=r.Shadow.RadiusThreshold=0.04
+CVars=r.Shadow.MaxNumPointShadowCacheUpdatesPerFrame=1
+CVars=r.Shadow.MaxNumSpotShadowCacheUpdatesPerFrame=1

; Disable next-gen features
+CVars=r.VolumetricFog=0
+CVars=grass.densityScale=1
+CVars=r.ViewDistanceScale=1.5
+CVars=r.SkyLight.RealTimeReflectionCapture=0

; Postprocessing
+CVars=r.Filter.SizeScale=0.8
+CVars=r.FastBlurThreshold=3
+CVars=r.MotionBlurQuality=3
+CVars=r.SceneColorFringeQuality=0
+CVars=r.SSS.Quality=0
