; WWMI BETA-8 INI

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

[Constants]
global $required_wwmi_version = 1.00
global $object_guid = 107904
global $mesh_vertex_count = 28936
global $shapekey_vertex_count = 9086
global $shapekey_vertex_offset_batch0 = 0
global $shapekey_vertex_count_batch0 = 9086
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 = "洛瑟菈Mod"

[ResourceModAuthor]
type = Buffer
data = "weiwuxc888"

[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
CheckTextureOverride = ps-t8

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

[CommandListCleanupSharedResources]
vb0 = ref ResourceBypassVB0

[TextureOverrideComponent0]
hash = 24d1e3e3
match_first_index = 0
match_index_count = 75024
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
    ps-t0 = ResourceTexture0
    ps-t1 = ResourceTexture1
    ps-t2 = ResourceTexture2
    ps-t3 = ResourceTexture3
	; Draw Component 0.005
	drawindexed = 110820, 0, 0
    run = CommandListCleanupSharedResources
endif

[TextureOverrideComponent1]
hash = 24d1e3e3
match_first_index = 75024
match_index_count = 32880
$object_detected = 1
if $mod_enabled
    handling = skip
    run = CommandListTriggerResourceOverrides
    run = CommandListOverrideSharedResources
	; Draw Component 1.002
	drawindexed = 20601, 110820, 0
    run = CommandListCleanupSharedResources
endif

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

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

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

[ResourceTexture2]
filename = Textures/Components-0 t=d713b541.jpg

[ResourceTexture3]
filename = Textures/Components-0 t=e179225e.dds


[ResourceTexture4]
filename = Textures/Components-0 t=11fa3f7d.dds

[TextureOverrideTexture4]
hash = 11fa3f7d
match_priority = 0
if $object_detected
    this = ResourceTexture4
endif

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

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

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

[CommandListSetupShapeKeysBatch]
$\WWMIv1\shapekey_checksum_batch0 = 2198
$\WWMIv1\shapekey_vertex_offset_original_batch0 = 0
$\WWMIv1\shapekey_vertex_offset_custom_batch0 = $shapekey_vertex_offset_batch0
cs-t33 = ResourceShapeKeyOffsetBuffer
cs-u5 = ResourceCustomShapeKeyValuesRW
cs-u6 = ResourceShapeKeyCBRW
run = CustomShader\WWMIv1\ShapeKeyBatchOverrider

[CommandListLoadShapeKeysBatch]
$\WWMIv1\shapekey_dispatch_size_y_original_batch0 = 285
$\WWMIv1\shapekey_vertex_count_batch0 = $shapekey_vertex_count_batch0
cs-t0 = ResourceShapeKeyVertexIdBuffer
cs-t1 = ResourceShapeKeyVertexOffsetBuffer
cs-u6 = ResourceShapeKeyCBRW
run = CommandList\WWMIv1\LoadShapeKeysBatch

[TextureOverrideShapeKeyLoaderCallback]
hash = d151940e
match_priority = 0
if $mod_enabled
    if cs == 3381.3333
        handling = skip
        run = CommandListSetupShapeKeysBatch
        run = CommandListLoadShapeKeysBatch
    endif
endif

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

[TextureOverrideShapeKeyMultiplierCallback]
hash = d151940e
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 = 16
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 generated by WWMI Tools Blender addon v1.7.3 and requires WWMI v1.0.0+ to function

; XXMI Launcher GameBanana: https://gamebanana.com/tools/17252
; XXMI Launcher GitHub: https://github.com/SpectrumQT/XXMI-Launcher
; WWMI Package GitHub: https://github.com/SpectrumQT/WWMI-Package
; WWMI Tools GameBanana: https://gamebanana.com/tools/17289
; WWMI Tools GitHub: https://github.com/SpectrumQT/WWMI-Tools
; AGMG Modding Community Discord: https://discord.com/invite/agmg
; SHA256 CHECKSUM: 712760ea9251767c31046487fa67cc661c6ef2e1e38f6f1650894d5d6076c558
