;;;;;;;;;;;;;;;;;;;;;;; DARKSTARSWORD'S UNITY 5 TEMPLATE ;;;;;;;;;;;;;;;;;;;;;;;

[Include]
; This file is generated automatically by the autofix scripts:
include = unity_generated.ini

[Present]
; Clear custom resources on the present call to ensure we don't use stale data:
post Resource_UnityPerCameraRare = null
post Resource_CameraDepthTexture = null
post Resource_UnityPerCamera = null
post Resource_UnityPerDraw = null
post Resource_UnityPerFrame = null

; Custom resource declarations
[Resource_UnityPerCameraRare]
max_copies_per_frame = 1

[Resource_CameraDepthTexture]
max_copies_per_frame = 1

[Resource_UnityPerCamera]
max_copies_per_frame = 1

[Resource_UnityPerDraw]
max_copies_per_frame = 1

[Resource_UnityPerFrame]
max_copies_per_frame = 1

[Resource_Inverse_MVP]
type = Buffer
format = R32G32B32A32_FLOAT
array = 4

[Resource_Inverse_VP]
type = Buffer
format = R32G32B32A32_FLOAT
array = 4

[Resource_Inverse_MVP_CB]
[Resource_Inverse_VP_CB]

; Copy the FOV from the directional lighting shader to the point/spot/physical lighting shader:
[ShaderOverrideDirectional]
Hash = b78925705424e647
Resource_UnityPerCameraRare = vs-cb1
[ShaderOverrideDirectional53]
Hash = bfae1ae6908d87a2
Resource_UnityPerCameraRare = vs-cb1
[ShaderOverrideDirectional53_9x]
Hash = f51c2a7085326040
Resource_UnityPerCameraRare = vs-cb1
[ShaderOverrideDirectional54]
Hash = f1dfaa0a76663bf9
Resource_UnityPerCameraRare = vs-cb1
[ShaderOverrideDirectional54_9x]
Hash = bc1b4298b3713fce
Resource_UnityPerCameraRare = vs-cb1
[ShaderOverrideDirectional55]
Hash = 28a7271021d7155a
Resource_UnityPerCameraRare = vs-cb1
[ShaderOverrideDirectional56]
Hash = 2917d6a2498642c6
Resource_UnityPerCameraRare = vs-cb1


[ShaderOverridePhysica_Smoke]
Hash = c1c9fb42cea5ff73
vs-cb13 = Resource_UnityPerCameraRare

[ShaderOverridePhysica_Markers]
Hash = dcb3a021d5a028dc
vs-cb13 = Resource_UnityPerCameraRare


[ShaderOverridePhysical50]
Hash = ca5cfc8e4d8b1ce5
vs-cb13 = Resource_UnityPerCameraRare
[ShaderOverridePhysical52]
Hash = 69294277cca1bade
vs-cb13 = Resource_UnityPerCameraRare
[ShaderOverridePhysical54]
Hash = 99341a34a001a3d1
vs-cb13 = Resource_UnityPerCameraRare
[ShaderOverridePrePass54]
Hash = 94a6d6474c5424ae
vs-cb13 = Resource_UnityPerCameraRare
[ShaderOverridePrePass55]
Hash = 4a87a6742ed6d7a9
vs-cb13 = Resource_UnityPerCameraRare
[ShaderOverridePhysical56]
Hash = 4c9936f7f1d28f6e
vs-cb13 = Resource_UnityPerCameraRare
[ShaderOverridePhysical56Subnautica]
Hash = 65640cd671a89091
vs-cb13 = Resource_UnityPerCameraRare

[CustomShader_Inverse_Unity_MVP]
max_executions_per_frame = 1
cs = ShaderFixes/inverse_unity_mvp.hlsl
cs-cb11 = Resource_UnityPerDraw
cs-u0 = Resource_Inverse_MVP
cs-u1 = Resource_Inverse_VP
Dispatch = 1, 1, 1
post cs-cb11 = null
post cs-u0 = null
post cs-u1 = null
post Resource_Inverse_MVP_CB = copy Resource_Inverse_MVP
post Resource_Inverse_VP_CB = copy Resource_Inverse_VP

[CustomShader_Inverse_Unity_VP]
max_executions_per_frame = 1
cs = ShaderFixes/inverse_unity_vp.hlsl
cs-cb11 = Resource_UnityPerFrame
cs-u0 = Resource_Inverse_VP
Dispatch = 1, 1, 1
post cs-cb11 = null
post cs-u0 = null
post Resource_Inverse_VP_CB = copy Resource_Inverse_VP

; Reset the per frame copy / execution limits every time a depth buffer is
; cleared to fix games that render additional off-screen scenes.
[CommandListResetPerFrameLimits]
; The full namespace is specified here for compatibility with 3DMigoto 1.3.10
; This bug will be fixed in 1.3.11, after which this will be reverted.
reset_per_frame_limits = CustomShader\ShaderFixes\unity.ini\_Inverse_Unity_MVP
reset_per_frame_limits = CustomShader\ShaderFixes\unity.ini\_Inverse_Unity_VP
reset_per_frame_limits = Resource\ShaderFixes\unity.ini\_UnityPerCameraRare
reset_per_frame_limits = Resource\ShaderFixes\unity.ini\_UnityPerCamera
reset_per_frame_limits = Resource\ShaderFixes\unity.ini\_UnityPerDraw
reset_per_frame_limits = Resource\ShaderFixes\unity.ini\_UnityPerFrame
reset_per_frame_limits = Resource\ShaderFixes\unity.ini\_CameraDepthTexture
[ClearRenderTargetView]
; LiSBtS needs this reset from RTV clear or reflections are messed up:
run = CommandListResetPerFrameLimits
;[ClearDepthStencilView]
; This screws up glow in LiSBtS:
;run = CommandListResetPerFrameLimits
