[DeviceProfiles]
+DeviceProfileNameAndTypes=PS4_60,PS4
+DeviceProfileNameAndTypes=PS4_Neo_60,PS4
+DeviceProfileNameAndTypes=PS4_Neo_4k_60,PS4

; ------------------------------------------------------------------------------
; READ THIS before editing!
; These device profiles are hierarchical! Changes to the base PS4 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:
;

;  PS4_Neo_4k_60
;       |
;       |
;       |
;       |
;       |
;       |
; PS4_Neo_60    PS4_Neo_4k
;       |        |
;        ________
;         PS4_Neo             PS4_60
;             |                |               
;              _________________
;                     PS4
;
; Notes: 
; - _Neo profiles apply to PS4 Pro hardware
; - PS4 and PS4_60 apply to base PS4 hardware 
; ------------------------------------------------------------------------------

; ------------------------------------------------------------------------------
; PS4 30FPS device profiles
; ------------------------------------------------------------------------------

[PS4 DeviceProfile]
TextureLODGroups=(Group=TEXTUREGROUP_World,MinLODSize=1,MaxLODSize=2048,LODBias=0,OptionalMaxLODSize=512,DuplicateNonOptionalMips=true,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_WorldNormalMap,MinLODSize=1,MaxLODSize=1024,OptionalMaxLODSize=256,DuplicateNonOptionalMips=true,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_WorldSpecular,MinLODSize=1,MaxLODSize=1024,OptionalMaxLODSize=256,DuplicateNonOptionalMips=true,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Character,MinLODSize=1,MaxLODSize=2048,LODBias=0,OptionalMaxLODSize=512,DuplicateNonOptionalMips=true,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_CharacterNormalMap,MinLODSize=1,MaxLODSize=1024,LODBias=0,OptionalMaxLODSize=512,DuplicateNonOptionalMips=true,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_CharacterSpecular,MinLODSize=1,MaxLODSize=1024,LODBias=0,OptionalMaxLODSize=512,DuplicateNonOptionalMips=true,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Weapon,MinLODSize=1,MaxLODSize=2048,LODBias=0,OptionalMaxLODSize=512,DuplicateNonOptionalMips=true,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_WeaponNormalMap,MinLODSize=1,MaxLODSize=1024,OptionalMaxLODSize=512,DuplicateNonOptionalMips=true,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_WeaponSpecular,MinLODSize=1,MaxLODSize=1024,OptionalMaxLODSize=512,DuplicateNonOptionalMips=true,LODBias=0,MinMagFilter=aniso,MipFilter=point,MipGenSettings=TMGS_SimpleAverage)
+TextureLODGroups=(Group=TEXTUREGROUP_Vehicle,MinLODSize=1,MaxLODSize=2048,LODBias=0,OptionalMaxLODSize=512,DuplicateNonOptionalMips=true,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,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=2
+CVars=sg.AntiAliasingQuality=2
+CVars=sg.ShadowQuality=2
+CVars=sg.PostProcessQuality=2
+CVars=sg.TextureQuality=2
+CVars=sg.EffectsQuality=2
; PS4 Memory Overrides
+CVars=r.Streaming.PoolSize=640
+CVars=r.PS4DefragPoolSize=1700
+CVars=r.screenpercentage=100
; Dynamic res/temporal upsampling
+CVars=r.DynamicRes.OperationMode=2
+CVars=r.TemporalAA.Upsampling=1
+CVars=r.DynamicRes.FrameTimeBudget=33.33
+CVars=r.DynamicRes.TargetedGPUHeadRoomPercentage=5

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

; 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

; Render distance field shadows on an async compute pipe
+CVars=r.DFShadowAsyncCompute=1

+CVars=r.DoInitViewsLightingAfterPrepass=1
+CVars=r.Shadow.MaxNumFarShadowCascades=0
+CVars=r.HeightFieldShadowing=1
+CVars=r.HFShadowQuality=2
;required for async ssao
+CVars=r.AmbientOcclusionLevels=1
+CVars=r.AmbientOcclusionRadiusScale=1.5
; High quality materials - Others discarded at cook
+CVars=r.MaterialQualityLevel=1
+CVars=r.DiscardUnusedQuality=1

; Virtual texture settings
+CVars=r.VT.MaxUploadsPerFrame=1
+CVars=r.VT.PoolSizeScale=0.5
; Disable VirtualHeightfieldMesh
+CVars=r.VHM.Enable=0

+CVars=r.PhysicsField.EnableField=0

[PS4_Neo DeviceProfile]
+CVars=sg.ViewDistanceQuality=3
+CVars=sg.AntiAliasingQuality=3
+CVars=sg.ShadowQuality=2
+CVars=sg.PostProcessQuality=3
+CVars=sg.TextureQuality=2
+CVars=sg.EffectsQuality=3
; PS4 Memory Overrides
+CVars=r.Streaming.PoolSize=840
+CVars=r.PS4DefragPoolSize=2064
; Neo specific shadow quality overrides
+CVars=r.Shadow.WholeSceneShadowCacheMb=80
+CVars=r.Shadow.CachedShadowsCastFromMovablePrimitives=1
+CVars=r.Shadow.MaxNumFarShadowCascades=1
+CVars=r.HeightFieldShadowing=0

; Dynamic res/temporal upsampling
+CVars=r.DynamicRes.OperationMode=2
+CVars=r.TemporalAA.Upsampling=1
+CVars=r.DynamicRes.FrameTimeBudget=33.33
+CVars=r.DynamicRes.TargetedGPUHeadRoomPercentage=5
; High quality materials - Others discarded at cook
+CVars=r.MaterialQualityLevel=1
+CVars=r.DiscardUnusedQuality=1

; Virtual texture settings
+CVars=r.VT.MaxUploadsPerFrame=2

[PS4_Neo_4k DeviceProfile]
DeviceType=PS4
BaseProfileName=PS4_Neo
; Dynamic res/temporal upsampling
;  Re-enable and disable r.PS4MaxBackbufferWidth/r.PS4MaxBackbufferHeight to support
;  a full 4K backbuffer with 2560x1440 secondary screen percentage
;  +CVars=r.SecondaryScreenPercentage.GameViewport=66.66
+CVars=r.DynamicRes.MinScreenPercentage=50.0
+CVars=r.DynamicRes.MaxScreenPercentage=90
+CVars=r.DFShadowQuality=2

; ------------------------------------------------------------------------------
; PS4 60FPS (BR) device profiles
; ------------------------------------------------------------------------------
[PS4_60 DeviceProfile]
DeviceType=PS4
BaseProfileName=PS4
+CVars=sg.ViewDistanceQuality=1
+CVars=sg.ShadowQuality=2
+CVars=r.DFShadowQuality=2
+CVars=r.ViewDistanceScale=1.995
; Shadows setting overrides
+CVars=r.Shadow.DistanceScale=0.6
+CVars=r.Shadow.CSM.MaxCascades=1
+CVars=r.Shadow.MaxCSMResolution=1024
+CVars=r.Shadow.MaxResolution=1024
+CVars=r.Shadow.WholeSceneShadowCacheMb=40
+CVars=r.Shadow.CachedShadowsCastFromMovablePrimitives=0
+CVars=r.Shadow.MaxNumPointShadowCacheUpdatesPerFrame=1
+CVars=r.Shadow.MaxNumSpotShadowCacheUpdatesPerFrame=1
+CVars=r.LightMaxDrawDistanceScale=.5
+CVars=r.DistanceFieldAO=0
; Reduce skylight intensity when disabling DFAO to maintain similar contrast
+CVars=r.SkylightIntensityMultiplier=0.7
+CVars=r.VolumetricFog=0
+CVars=r.ShadowQuality=3
; DoInitViewsLightingAfterPrepass has to be disabled, because otherwise distance field shadowing does not work
; because FDeferredShadingSceneRenderer::ShouldPrepareForDistanceFieldShadows will be called before shadows are initialized
+CVars=r.DoInitViewsLightingAfterPrepass=0 
+CVars=r.SSS.Scale=0
+CVars=r.DepthOfFieldQuality=0
+CVars=r.separateTranslucency=0
+CVars=r.SSS.Scale=0
+CVars=r.SSS.Quality=0
+CVars=r.SSS.SampleSet=0
; Dynamic res/temporal upsampling
+CVars=r.DynamicRes.FrameTimeBudget=16.66
+CVars=r.DynamicRes.TargetedGPUHeadRoomPercentage=3.5
+CVars=r.DynamicRes.MinScreenPercentage=65.0
+CVars=r.ViewTextureMipBias.Min=0
+CVars=r.MotionBlurQuality=0
+CVars=foliage.DensityScale=0.75
+CVars=grass.CullDistanceScale=0.7
+CVars=grass.DensityScale=0.7

; 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

[PS4_Neo_60 DeviceProfile]
DeviceType=PS4
BaseProfileName=PS4_Neo
+CVars=sg.ViewDistanceQuality=2
+CVars=sg.AntiAliasingQuality=2
+CVars=sg.ShadowQuality=2
+CVars=sg.PostProcessQuality=2
+CVars=sg.TextureQuality=2
+CVars=sg.EffectsQuality=2
+CVars=r.SSS.Scale=0
+CVars=r.DepthOfFieldQuality=0
+CVars=r.separateTranslucency=0
+CVars=r.TranslucencyVolumeBlur=0
+CVars=r.ViewDistanceScale=2.505
; Disable orthopgraphic tiling in neo
+CVars=r.SceneCapture.OverrideOrthographicTilingValues=1
+CVars=r.SceneCapture.EnableOrthographicTiling=0
; Dynamic res/temporal upsampling
+CVars=r.DynamicRes.FrameTimeBudget=16.66
+CVars=r.DynamicRes.TargetedGPUHeadRoomPercentage=3.5
+CVars=r.DynamicRes.MinScreenPercentage=65.0
+CVars=r.ViewTextureMipBias.Min=0

; 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

[PS4_Neo_4k_60 DeviceProfile]
DeviceType=PS4
BaseProfileName=PS4_Neo_60
; Dynamic res/temporal upsampling
;  Re-enable and disable r.PS4MaxBackbufferWidth/r.PS4MaxBackbufferHeight to support
;  a full 4K backbuffer with 2560x1440 secondary screen percentage
;  +CVars=r.SecondaryScreenPercentage.GameViewport=66.66
+CVars=r.DynamicRes.MinScreenPercentage=50.0
+CVars=r.DynamicRes.MaxScreenPercentage=90
+CVars=r.DFShadowQuality=2
+CVars=r.MotionBlurQuality=3
