; WWMI BETA-2 INI

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

[Constants]
global $required_wwmi_version = 1.00
global $object_guid = 9300
global $mesh_vertex_count = 2633
global $shapekey_vertex_count = 0
global $mod_id = -1000
global $state_id = 0
global $mod_enabled = 0
global $object_detected = 0

[Present]
if $object_detected
    if $mod_enabled
        post $object_detected = 0
        run = CommandListUpdateMergedSkeleton
    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

[CommandListUpdateMergedSkeleton]
if $state_id
    $state_id = 0
else
    $state_id = 1
endif
ResourceMergedSkeleton = copy ResourceMergedSkeletonRW
ResourceExtraMergedSkeleton = copy ResourceExtraMergedSkeletonRW

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

[ResourceModName]
type = Buffer
data = "Ultrasized_Suisui"

[ResourceModAuthor]
type = Buffer
data = "WaterWeightMate"

[ResourceModDesc]
type = Buffer
data = "A gargantuan, ultrasized Suisui!"

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

[ResourceModLogo]
; filename = Textures/Logo.dds

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

[TextureOverrideMarkBoneDataCB]
hash = f02baf77
match_priority = 0
filter_index = 3381.7777

[CommandListMergeSkeleton]
$\WWMIv1\custom_mesh_scale = 1.00
cs-cb8 = ref vs-cb4
cs-u6 = ResourceMergedSkeletonRW
run = CustomShader\WWMIv1\SkeletonMerger
cs-cb8 = ref vs-cb3
cs-u6 = ResourceExtraMergedSkeletonRW
run = CustomShader\WWMIv1\SkeletonMerger

[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 = vs-cb3
CheckTextureOverride = vs-cb4

[CommandListOverrideSharedResources]
ResourceBypassVB0 = ref vb0
ib = ResourceIndexBuffer
vb0 = ResourcePositionBuffer
vb1 = ResourceVectorBuffer
vb2 = ResourceTexcoordBuffer
vb3 = ResourceColorBuffer
vb4 = ResourceBlendBuffer
if vs-cb3 == 3381.7777
    vs-cb3 = ResourceExtraMergedSkeleton
endif
if vs-cb4 == 3381.7777
    vs-cb4 = ResourceMergedSkeleton
endif

[CommandListCleanupSharedResources]
vb0 = ref ResourceBypassVB0

[TextureOverrideComponent0]
hash = 6929dc64
match_first_index = 0
match_index_count = 9300
$object_detected = 1
if $mod_enabled
    local $state_id_0
    if $state_id_0 != $state_id
        $state_id_0 = $state_id
        $\WWMIv1\vg_offset = 0
        $\WWMIv1\vg_count = 7
        run = CommandListMergeSkeleton
    endif
    if ResourceMergedSkeleton !== null
        handling = skip
        run = CommandListTriggerResourceOverrides
        run = CommandListOverrideSharedResources
        ; Draw Component 0.001
        drawindexed = 9300, 0, 0
        run = CommandListCleanupSharedResources
    endif
endif

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

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

[TextureOverrideTexture0]
hash = 164df2d5
match_priority = 0
if $object_detected
    this = ResourceTexture0
endif

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

[TextureOverrideTexture1]
hash = 239cabd0
match_priority = 0
if $object_detected
    this = ResourceTexture1
endif

[ResourceTexture2]
filename = Textures/Components-0 t=27c24157.dds

[TextureOverrideTexture2]
hash = 27c24157
match_priority = 0
if $object_detected
    this = ResourceTexture2
endif

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

[TextureOverrideTexture3]
hash = 59276c52
match_priority = 0
if $object_detected
    this = ResourceTexture3
endif

[ResourceTexture4]
filename = Textures/Components-0 t=70503aed.dds

[TextureOverrideTexture4]
hash = 70503aed
match_priority = 0
if $object_detected
    this = ResourceTexture4
endif

[ResourceTexture5]
filename = Textures/Components-0 t=8a276ed0.dds

[TextureOverrideTexture5]
hash = 8a276ed0
match_priority = 0
if $object_detected
    this = ResourceTexture5
endif

[ResourceTexture6]
filename = Textures/Components-0 t=9934ca23.dds

[TextureOverrideTexture6]
hash = 9934ca23
match_priority = 0
if $object_detected
    this = ResourceTexture6
endif



; Resources: Skeleton Override -------------------------

[ResourceMergedSkeleton]

[ResourceMergedSkeletonRW]
type = RWBuffer
format = R32G32B32A32_FLOAT
array = 768

[ResourceExtraMergedSkeleton]

[ResourceExtraMergedSkeletonRW]
type = RWBuffer
format = R32G32B32A32_FLOAT
array = 768

; 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

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

; This mod.ini was automatically 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: 105a8f24841665a9cce9cc2c94f1e1889c59cdb1ddbda38382224463a01109c4
