; WWMI ALPHA-2 INI

; Mod State -------------------------

[Constants]
global $required_wwmi_version = 0.70
global $object_guid = 153393
global $mesh_vertex_count = 33286
global $shapekey_vertex_count = 28815
global $mod_id = -1000
global $mod_enabled = 0
global $object_detected = 0

[Present]
if $object_detected
	if $mod_enabled
		post $object_detected = 0
	else
		if $mod_id == -1000
			run = CommandListRegisterMod
		endif
	endif
endif

[CommandListRegisterMod]
$\WWMIv1\required_wwmi_version = $required_wwmi_version
$\WWMIv1\object_guid = $object_guid
Resource\WWMIv1\ModName = ref ResourceModName
Resource\WWMIv1\ModAuthor = ref ResourceModAuthor
Resource\WWMIv1\ModDesc = ref ResourceModDesc
Resource\WWMIv1\ModLink = ref ResourceModLink
Resource\WWMIv1\ModLogo = ref ResourceModLogo
run = CommandList\WWMIv1\RegisterMod
$mod_id = $\WWMIv1\mod_id
if $mod_id >= 0
	$mod_enabled = 1
endif

; Resources: Mod Info -------------------------

[ResourceModName]
type = Buffer
data = "Unnamed Mod"

[ResourceModAuthor]
type = Buffer
data = "Unknown Author"

[ResourceModDesc]
; type = Buffer
; data = "Empty Mod Description"

[ResourceModLink]
; type = Buffer
; data = "Empty Mod Link"

[ResourceModLogo]
; filename = Textures/Logo.dds

; Shading: Draw Call Stacks Processing -------------------------

[CommandListTriggerResourceOverrides]
CheckTextureOverride = ps-t0
CheckTextureOverride = ps-t1
CheckTextureOverride = ps-t2
CheckTextureOverride = ps-t3
CheckTextureOverride = ps-t4
CheckTextureOverride = ps-t5
CheckTextureOverride = ps-t6
CheckTextureOverride = ps-t7

[CommandListOverrideSharedResources]
ResourceBypassVB0 = ref vb0
ib = ResourceIndexBuffer
vb0 = ResourcePositionBuffer
vb1 = ResourceVectorBuffer
vb2 = ResourceTexcoordBuffer
vb3 = ResourceColorBuffer
vb4 = ResourceBlendBuffer

[CommandListCleanupSharedResources]
vb0 = ref ResourceBypassVB0

[TextureOverrideComponent0]
hash = 4a2b2eca
match_first_index = 0
match_index_count = 10371
$object_detected = 1
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	; Draw Component 0
	drawindexed = 10371, 0, 0
	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent1]
hash = 4a2b2eca
match_first_index = 10371
match_index_count = 16908
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	; Draw Component 1
	drawindexed = 16908, 10371, 0
	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent2]
hash = 4a2b2eca
match_first_index = 27279
match_index_count = 11352
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	; Draw Component 2
	drawindexed = 11352, 27279, 0
	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent3]
hash = 4a2b2eca
match_first_index = 38631
match_index_count = 64707
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	; Draw Component 3.001
	drawindexed = 5781, 38631, 0
	; Draw Component 3.002
	drawindexed = 56061, 44412, 0
	; Draw Component 3.004
	drawindexed = 18966, 100473, 0
	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent4]
hash = 4a2b2eca
match_first_index = 103338
match_index_count = 47712
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	; Draw Component 4.002
	drawindexed = 14559, 119439, 0
	; Draw Component 4.003
	drawindexed = 12084, 133998, 0
	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent5]
hash = 4a2b2eca
match_first_index = 151050
match_index_count = 2136
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	; Draw Component 5
	drawindexed = 2136, 146082, 0
	run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent6]
hash = 4a2b2eca
match_first_index = 153186
match_index_count = 207
if $mod_enabled
	handling = skip
	run = CommandListTriggerResourceOverrides
	run = CommandListOverrideSharedResources
	; Draw Component 6.002
	drawindexed = 207, 148218, 0
	run = CommandListCleanupSharedResources
endif

; Shading: Textures -------------------------

[ResourceTexture0]
filename = Textures/Components-0 t=1a09bbb5.dds

[TextureOverrideTexture0]
hash = 1a09bbb5
match_priority = 0
this = ResourceTexture0

[ResourceTexture1]
filename = Textures/Components-0 t=7404e947.dds

[TextureOverrideTexture1]
hash = 7404e947
match_priority = 0
this = ResourceTexture1

[ResourceTexture2]
filename = Textures/Components-0-1-2-3-4 t=64dd4ce0.dds

[TextureOverrideTexture2]
hash = 64dd4ce0
match_priority = 0
this = ResourceTexture2

[ResourceTexture3]
filename = Textures/Components-0-1-2-3-4-5-6 t=9f6eaf2e.dds

[TextureOverrideTexture3]
hash = 9f6eaf2e
match_priority = 0
this = ResourceTexture3

[ResourceTexture4]
filename = Textures/Components-0-1-2-3-4-6 t=3cd03f60.dds

[TextureOverrideTexture4]
hash = 3cd03f60
match_priority = 0
this = ResourceTexture4

[ResourceTexture5]
filename = Textures/Components-0-2-5 t=28708ab8.dds

[TextureOverrideTexture5]
hash = 28708ab8
match_priority = 0
this = ResourceTexture5

[ResourceTexture6]
filename = Textures/Components-0-2-5 t=8383cbbf.dds

[TextureOverrideTexture6]
hash = 8383cbbf
match_priority = 0
this = ResourceTexture6

[ResourceTexture7]
filename = Textures/Components-1 t=7c460f02.dds

[TextureOverrideTexture7]
hash = 7c460f02
match_priority = 0
this = ResourceTexture7

[ResourceTexture8]
filename = Textures/Components-1 t=d755a4a9.dds

[TextureOverrideTexture8]
hash = d755a4a9
match_priority = 0
this = ResourceTexture8

[ResourceTexture9]
filename = Textures/Components-2 t=804d32e9.dds

[TextureOverrideTexture9]
hash = 804d32e9
match_priority = 0
this = ResourceTexture9

[ResourceTexture10]
filename = Textures/Components-3 t=2adec21b.dds

[TextureOverrideTexture10]
hash = 2adec21b
match_priority = 0
this = ResourceTexture10

[ResourceTexture11]
filename = Textures/Components-3 t=2b7eb01d.dds

[TextureOverrideTexture11]
hash = 2b7eb01d
match_priority = 0
this = ResourceTexture11

[ResourceTexture12]
filename = Textures/Components-3 t=37bed36b.dds

[TextureOverrideTexture12]
hash = 718456ac
match_priority = 0
this = ResourceTexture12

[ResourceTexture13]
filename = Textures/Components-3-4 t=5019e88f.dds

[TextureOverrideTexture13]
hash = 5019e88f
match_priority = 0
this = ResourceTexture13

[ResourceTexture14]
filename = Textures/Components-4 t=52c9b804.dds

[TextureOverrideTexture14]
hash = d7756134
match_priority = 0
this = ResourceTexture14

[ResourceTexture15]
filename = Textures/Components-4 t=91754701.dds

[TextureOverrideTexture15]
hash = 91754701
match_priority = 0
this = ResourceTexture15

[ResourceTexture16]
filename = Textures/Components-4 t=e6d4c134.dds

[TextureOverrideTexture16]
hash = e6d4c134
match_priority = 0
this = ResourceTexture16

[ResourceTexture17]
filename = Textures/Components-5 t=49a71537.dds

[TextureOverrideTexture17]
hash = 49a71537
match_priority = 0
this = ResourceTexture17

; Skinning: Shape Keys Override -------------------------

[TextureOverrideShapeKeyOffsets]
hash = d8d2286b
match_priority = 0
override_byte_stride = 24
override_vertex_count = $mesh_vertex_count

[TextureOverrideShapeKeyScale]
hash = f2a0c0fa
match_priority = 0
override_byte_stride = 4
override_vertex_count = $mesh_vertex_count

[CommandListSetupShapeKeys]
$\WWMIv1\shapekey_checksum = 1874
cs-t33 = ResourceShapeKeyOffsetBuffer
cs-u5 = ResourceCustomShapeKeyValuesRW
cs-u6 = ResourceShapeKeyCBRW
run = CustomShader\WWMIv1\ShapeKeyOverrider

[CommandListLoadShapeKeys]
$\WWMIv1\shapekey_vertex_count = $shapekey_vertex_count
cs-t0 = ResourceShapeKeyVertexIdBuffer
cs-t1 = ResourceShapeKeyVertexOffsetBuffer
cs-u6 = ResourceShapeKeyCBRW
run = CustomShader\WWMIv1\ShapeKeyLoader

[TextureOverrideShapeKeyLoaderCallback]
hash = d8d2286b
match_priority = 0
if $mod_enabled
	if cs == 3381.3333
		handling = skip
		run = CommandListSetupShapeKeys
		run = CommandListLoadShapeKeys
	endif
endif

[CommandListMultiplyShapeKeys]
$\WWMIv1\custom_vertex_count = $mesh_vertex_count
run = CustomShader\WWMIv1\ShapeKeyMultiplier

[TextureOverrideShapeKeyMultiplierCallback]
hash = d8d2286b
match_priority = 0
if $mod_enabled
	if cs == 3381.4444
		handling = skip
		run = CommandListMultiplyShapeKeys
	endif
endif

; Resources: Shape Keys Override -------------------------

[ResourceShapeKeyCBRW]
type = RWBuffer
format = R32G32B32A32_UINT
array = 66

[ResourceCustomShapeKeyValuesRW]
type = RWBuffer
format = R32G32B32A32_FLOAT
array = 32

; Resources: Buffers -------------------------

[ResourceBypassVB0]

[ResourceIndexBuffer]
type = Buffer
format = DXGI_FORMAT_R32_UINT
stride = 12
filename = Meshes/Index.buf

[ResourcePositionBuffer]
type = Buffer
format = DXGI_FORMAT_R32G32B32_FLOAT
stride = 12
filename = Meshes/Position.buf

[ResourceBlendBuffer]
type = Buffer
format = DXGI_FORMAT_R8_UINT
stride = 8
filename = Meshes/Blend.buf

[ResourceVectorBuffer]
type = Buffer
format = DXGI_FORMAT_R8G8B8A8_SNORM
stride = 8
filename = Meshes/Vector.buf

[ResourceColorBuffer]
type = Buffer
format = DXGI_FORMAT_R8G8B8A8_UNORM
stride = 4
filename = Meshes/Color.buf

[ResourceTexCoordBuffer]
type = Buffer
format = DXGI_FORMAT_R16G16_FLOAT
stride = 16
filename = Meshes/TexCoord.buf

[ResourceShapeKeyOffsetBuffer]
type = Buffer
format = DXGI_FORMAT_R32G32B32A32_UINT
stride = 16
filename = Meshes/ShapeKeyOffset.buf

[ResourceShapeKeyVertexIdBuffer]
type = Buffer
format = DXGI_FORMAT_R32_UINT
stride = 4
filename = Meshes/ShapeKeyVertexId.buf

[ResourceShapeKeyVertexOffsetBuffer]
type = Buffer
format = DXGI_FORMAT_R16_FLOAT
stride = 2
filename = Meshes/ShapeKeyVertexOffset.buf

; Autogenerated -------------------------

; This mod.ini was automatically generated by WWMI Tools Blender addon v0.9.0 and requires WWMI v0.7.0+ to function
; WWMI GameBanana: https://gamebanana.com/tools/17252
; WWMI Tools GameBanana: https://gamebanana.com/tools/17289
; WWMI GitHub: https://github.com/SpectrumQT/WWMI
; WWMI Tools GitHub: https://github.com/SpectrumQT/WWMI_Tools
; AGMG Modding Community Discord: https://discord.com/invite/agmg

; SHA256 CHECKSUM: 1f496da8a804991f3308bc8ae4f4044a3c0530c075f4d497046198b13deae92b
