; Merged Mod: .\chongshuyiMod000\chongshuyi.ini, .\chongshuyiMod001\chongshuyi.ini, .\chongshuyiMod002\chongshuyi.ini, .\chongshuyiMod003\chongshuyi.ini, .\chongshuyiMod004\chongshuyi.ini, .\chongshuyiMod005\chongshuyi.ini, .\chongshuyiMod006\chongshuyi.ini, .\chongshuyiMod007\chongshuyi.ini

; Constants ---------------------------

[Constants]
global $speed = 2
global $frameStart= 0
global $frameEnd = 7
global $swapvar = 0
global $swapvarAux = 0
global $auxTime = 0

[Present]
if ($swapvarAux + (1/$speed)) < $frameEnd
    $swapvarAux = $swapvarAux + (1/$speed)
else
    $swapvarAux = $frameStart
endif
$swapvar=$swapvarAux//1
; Overrides ---------------------------

[TextureOverridechongshuyiPosition]
hash = 8be58c4e
run = CommandListchongshuyiPosition
$active = 1

[TextureOverridechongshuyiBlend]
hash = 1e91eb91
run = CommandListchongshuyiBlend

[TextureOverridechongshuyiTexcoord]
hash = 258fb17a
run = CommandListchongshuyiTexcoord

[TextureOverridechongshuyiVertexLimitRaise]
hash = 4fa73416

[TextureOverridechongshuyiIB]
hash = 875fadf9
run = CommandListchongshuyiIB

[TextureOverridechongshuyiHead]
hash = 875fadf9
match_first_index = 0
run = CommandListchongshuyiHead
$CharacterIB = 1
ResourceRefHeadDiffuse = reference ps-t1
ResourceRefHeadLightMap = reference ps-t2
$CharacterIB = 1
ResourceRefHeadDiffuse = reference ps-t1
ResourceRefHeadLightMap = reference ps-t2

; CommandList -------------------------

[CommandListchongshuyiPosition]
if $swapvar == 0
	vb0 = ResourcechongshuyiPosition.0
else if $swapvar == 1
	vb0 = ResourcechongshuyiPosition.1
else if $swapvar == 2
	vb0 = ResourcechongshuyiPosition.2
else if $swapvar == 3
	vb0 = ResourcechongshuyiPosition.3
else if $swapvar == 4
	vb0 = ResourcechongshuyiPosition.4
else if $swapvar == 5
	vb0 = ResourcechongshuyiPosition.5
else if $swapvar == 6
	vb0 = ResourcechongshuyiPosition.6
else if $swapvar == 7
	vb0 = ResourcechongshuyiPosition.7
endif

[CommandListchongshuyiBlend]
if $swapvar == 0
	vb1 = ResourcechongshuyiBlend.0
	handling = skip
	draw = 57794,0
else if $swapvar == 1
	vb1 = ResourcechongshuyiBlend.1
	handling = skip
	draw = 57794,0
else if $swapvar == 2
	vb1 = ResourcechongshuyiBlend.2
	handling = skip
	draw = 57794,0
else if $swapvar == 3
	vb1 = ResourcechongshuyiBlend.3
	handling = skip
	draw = 57794,0
else if $swapvar == 4
	vb1 = ResourcechongshuyiBlend.4
	handling = skip
	draw = 57794,0
else if $swapvar == 5
	vb1 = ResourcechongshuyiBlend.5
	handling = skip
	draw = 57794,0
else if $swapvar == 6
	vb1 = ResourcechongshuyiBlend.6
	handling = skip
	draw = 57794,0
else if $swapvar == 7
	vb1 = ResourcechongshuyiBlend.7
	handling = skip
	draw = 57794,0
endif

[CommandListchongshuyiTexcoord]
if $swapvar == 0
	vb1 = ResourcechongshuyiTexcoord.0
else if $swapvar == 1
	vb1 = ResourcechongshuyiTexcoord.1
else if $swapvar == 2
	vb1 = ResourcechongshuyiTexcoord.2
else if $swapvar == 3
	vb1 = ResourcechongshuyiTexcoord.3
else if $swapvar == 4
	vb1 = ResourcechongshuyiTexcoord.4
else if $swapvar == 5
	vb1 = ResourcechongshuyiTexcoord.5
else if $swapvar == 6
	vb1 = ResourcechongshuyiTexcoord.6
else if $swapvar == 7
	vb1 = ResourcechongshuyiTexcoord.7
endif

[CommandListchongshuyiIB]
if $swapvar == 0
	handling = skip
	drawindexed = auto
else if $swapvar == 1
	handling = skip
	drawindexed = auto
else if $swapvar == 2
	handling = skip
	drawindexed = auto
else if $swapvar == 3
	handling = skip
	drawindexed = auto
else if $swapvar == 4
	handling = skip
	drawindexed = auto
else if $swapvar == 5
	handling = skip
	drawindexed = auto
else if $swapvar == 6
	handling = skip
	drawindexed = auto
else if $swapvar == 7
	handling = skip
	drawindexed = auto
endif

[CommandListchongshuyiHead]
if $swapvar >= $frameStart && $swapvar <= $frameEnd
	ps-t0 = ResourcechongshuyiHeadDiffuse.0
	ps-t1 = ResourcechongshuyiHeadLightMap.0
	ps-t2 = ResourcechongshuyiHeadShadow.0

endif
if $swapvar == 0
	ib = ResourcechongshuyiHeadIB.0
else if $swapvar == 1
	ib = ResourcechongshuyiHeadIB.1
else if $swapvar == 2
	ib = ResourcechongshuyiHeadIB.2
else if $swapvar == 3
	ib = ResourcechongshuyiHeadIB.3
else if $swapvar == 4
	ib = ResourcechongshuyiHeadIB.4
else if $swapvar == 5
	ib = ResourcechongshuyiHeadIB.5
else if $swapvar == 6
	ib = ResourcechongshuyiHeadIB.6
else if $swapvar == 7
	ib = ResourcechongshuyiHeadIB.7
endif

; Resources ---------------------------

[ResourcechongshuyiPosition.0]
type = Buffer
stride = 40
filename = .\chongshuyiMod000\chongshuyiPosition.buf

[ResourcechongshuyiBlend.0]
type = Buffer
stride = 32
filename = .\chongshuyiMod000\chongshuyiBlend.buf

[ResourcechongshuyiTexcoord.0]
type = Buffer
stride = 12
filename = .\chongshuyiMod000\chongshuyiTexcoord.buf

[ResourcechongshuyiHeadIB.0]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = .\chongshuyiMod000\chongshuyiHead.ib

[ResourcechongshuyiHeadDiffuse.0]
filename = .\chongshuyiMod000\chongshuyiHeadDiffuse.dds

[ResourcechongshuyiHeadLightMap.0]
filename = .\chongshuyiMod000\chongshuyiHeadLightMap.dds

[ResourcechongshuyiHeadShadow.0]
filename = .\chongshuyiMod000\chongshuyiHeadShadow.dds

[ResourcechongshuyiPosition.1]
type = Buffer
stride = 40
filename = .\chongshuyiMod001\chongshuyiPosition.buf

[ResourcechongshuyiBlend.1]
type = Buffer
stride = 32
filename = .\chongshuyiMod001\chongshuyiBlend.buf

[ResourcechongshuyiTexcoord.1]
type = Buffer
stride = 12
filename = .\chongshuyiMod001\chongshuyiTexcoord.buf

[ResourcechongshuyiHeadIB.1]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = .\chongshuyiMod001\chongshuyiHead.ib



[ResourcechongshuyiHeadShadow.1]
filename = .\chongshuyiMod001\chongshuyiHeadShadow.dds

[ResourcechongshuyiPosition.2]
type = Buffer
stride = 40
filename = .\chongshuyiMod002\chongshuyiPosition.buf

[ResourcechongshuyiBlend.2]
type = Buffer
stride = 32
filename = .\chongshuyiMod002\chongshuyiBlend.buf

[ResourcechongshuyiTexcoord.2]
type = Buffer
stride = 12
filename = .\chongshuyiMod002\chongshuyiTexcoord.buf

[ResourcechongshuyiHeadIB.2]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = .\chongshuyiMod002\chongshuyiHead.ib



[ResourcechongshuyiHeadShadow.2]
filename = .\chongshuyiMod002\chongshuyiHeadShadow.dds

[ResourcechongshuyiPosition.3]
type = Buffer
stride = 40
filename = .\chongshuyiMod003\chongshuyiPosition.buf

[ResourcechongshuyiBlend.3]
type = Buffer
stride = 32
filename = .\chongshuyiMod003\chongshuyiBlend.buf

[ResourcechongshuyiTexcoord.3]
type = Buffer
stride = 12
filename = .\chongshuyiMod003\chongshuyiTexcoord.buf

[ResourcechongshuyiHeadIB.3]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = .\chongshuyiMod003\chongshuyiHead.ib



[ResourcechongshuyiHeadShadow.3]
filename = .\chongshuyiMod003\chongshuyiHeadShadow.dds

[ResourcechongshuyiPosition.4]
type = Buffer
stride = 40
filename = .\chongshuyiMod004\chongshuyiPosition.buf

[ResourcechongshuyiBlend.4]
type = Buffer
stride = 32
filename = .\chongshuyiMod004\chongshuyiBlend.buf

[ResourcechongshuyiTexcoord.4]
type = Buffer
stride = 12
filename = .\chongshuyiMod004\chongshuyiTexcoord.buf

[ResourcechongshuyiHeadIB.4]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = .\chongshuyiMod004\chongshuyiHead.ib



[ResourcechongshuyiHeadShadow.4]
filename = .\chongshuyiMod004\chongshuyiHeadShadow.dds

[ResourcechongshuyiPosition.5]
type = Buffer
stride = 40
filename = .\chongshuyiMod005\chongshuyiPosition.buf

[ResourcechongshuyiBlend.5]
type = Buffer
stride = 32
filename = .\chongshuyiMod005\chongshuyiBlend.buf

[ResourcechongshuyiTexcoord.5]
type = Buffer
stride = 12
filename = .\chongshuyiMod005\chongshuyiTexcoord.buf

[ResourcechongshuyiHeadIB.5]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = .\chongshuyiMod005\chongshuyiHead.ib



[ResourcechongshuyiHeadShadow.5]
filename = .\chongshuyiMod005\chongshuyiHeadShadow.dds

[ResourcechongshuyiPosition.6]
type = Buffer
stride = 40
filename = .\chongshuyiMod006\chongshuyiPosition.buf

[ResourcechongshuyiBlend.6]
type = Buffer
stride = 32
filename = .\chongshuyiMod006\chongshuyiBlend.buf

[ResourcechongshuyiTexcoord.6]
type = Buffer
stride = 12
filename = .\chongshuyiMod006\chongshuyiTexcoord.buf

[ResourcechongshuyiHeadIB.6]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = .\chongshuyiMod006\chongshuyiHead.ib



[ResourcechongshuyiHeadShadow.6]
filename = .\chongshuyiMod006\chongshuyiHeadShadow.dds

[ResourcechongshuyiPosition.7]
type = Buffer
stride = 40
filename = .\chongshuyiMod007\chongshuyiPosition.buf

[ResourcechongshuyiBlend.7]
type = Buffer
stride = 32
filename = .\chongshuyiMod007\chongshuyiBlend.buf

[ResourcechongshuyiTexcoord.7]
type = Buffer
stride = 12
filename = .\chongshuyiMod007\chongshuyiTexcoord.buf

[ResourcechongshuyiHeadIB.7]
type = Buffer
format = DXGI_FORMAT_R32_UINT
filename = .\chongshuyiMod007\chongshuyiHead.ib



[ResourcechongshuyiHeadShadow.7]
filename = .\chongshuyiMod007\chongshuyiHeadShadow.dds



; .ini generated by GIMI (Genshin-Impact-Model-Importer) mod merger script
; If you have any issues or find any bugs, please open a ticket at https://github.com/SilentNightSound/GI-Model-Importer/issues or contact SilentNightSound#7430 on discord

; Version 1.0.0 AGMG Tool Developer Version 3 Shader Fixer


; Generated shader fix for 3.0+ GIMI importer characters. Please contact the tool developers at https://discord.gg/agmg if you have any questions.

; Variables -----------------------

[Constants]
global $CharacterIB
;0=none, 1=head, 2=body, 3=dress, 4=extra, etc.

[Present]
post $CharacterIB = 0

[ResourceRefHeadDiffuse]
[ResourceRefHeadLightMap]
[ResourceRefBodyDiffuse]
[ResourceRefBodyLightMap]
[ResourceRefDressDiffuse]
[ResourceRefDressLightMap]
[ResourceRefExtraDiffuse]
[ResourceRefExtraLightMap]

; ShaderOverride ---------------------------

[ShaderRegexCharReflection]
shader_model = ps_5_0
run = CommandListReflectionTexture
[ShaderRegexCharReflection.pattern]
discard_n\w+ r\d\.\w+\n
lt r\d\.\w+, l\(0\.010000\), r\d\.\w+\n
and r\d\.\w+, r\d\.\w+, r\d\.\w+\n

[ShaderRegexCharOutline]
shader_model = ps_5_0
run = CommandListOutline
[ShaderRegexCharOutline.pattern]
mov o0\.w, l\(0\)\n
mov o1\.xyz, r0\.xyzx\n
mov o1\.w, l\(0.223606795\)

; CommandList -------------------------

[CommandListReflectionTexture]
if $CharacterIB != 0
    if $CharacterIB == 1
        ps-t0 = copy ResourceRefHeadDiffuse
    else if $CharacterIB == 2
        ps-t0 = copy ResourceRefBodyDiffuse
    else if $CharacterIB == 3
        ps-t0 = copy ResourceRefDressDiffuse
    else if $CharacterIB == 4
        ps-t0 = copy ResourceRefExtraDiffuse    
    endif
drawindexed=auto
$CharacterIB = 0
endif

[CommandListOutline]
if $CharacterIB != 0
    if $CharacterIB == 1
        ps-t1 = copy ResourceRefHeadLightMap
    else if $CharacterIB == 2
        ps-t1 = copy ResourceRefBodyLightMap
    else if $CharacterIB == 3
        ps-t1 = copy ResourceRefDressLightMap
    else if $CharacterIB == 4
        ps-t1 = copy ResourceRefExtraLightMap
    endif
drawindexed=auto
$CharacterIB = 0
endif


; Version 1.0.0 AGMG Tool Developer Version 3 Shader Fixer


; Generated shader fix for 3.0+ GIMI importer characters. Please contact the tool developers at https://discord.gg/agmg if you have any questions.

; Variables -----------------------

[Constants]
global $CharacterIB
;0=none, 1=head, 2=body, 3=dress, 4=extra, etc.

[Present]
post $CharacterIB = 0

[ResourceRefHeadDiffuse]
[ResourceRefHeadLightMap]
[ResourceRefBodyDiffuse]
[ResourceRefBodyLightMap]
[ResourceRefDressDiffuse]
[ResourceRefDressLightMap]
[ResourceRefExtraDiffuse]
[ResourceRefExtraLightMap]

; ShaderOverride ---------------------------

[ShaderRegexCharReflection]
shader_model = ps_5_0
run = CommandListReflectionTexture
[ShaderRegexCharReflection.pattern]
discard_n\w+ r\d\.\w+\n
lt r\d\.\w+, l\(0\.010000\), r\d\.\w+\n
and r\d\.\w+, r\d\.\w+, r\d\.\w+\n

[ShaderRegexCharOutline]
shader_model = ps_5_0
run = CommandListOutline
[ShaderRegexCharOutline.pattern]
mov o0\.w, l\(0\)\n
mov o1\.xyz, r0\.xyzx\n
mov o1\.w, l\(0.223606795\)

; CommandList -------------------------

[CommandListReflectionTexture]
if $CharacterIB != 0
    if $CharacterIB == 1
        ps-t0 = copy ResourceRefHeadDiffuse
    else if $CharacterIB == 2
        ps-t0 = copy ResourceRefBodyDiffuse
    else if $CharacterIB == 3
        ps-t0 = copy ResourceRefDressDiffuse
    else if $CharacterIB == 4
        ps-t0 = copy ResourceRefExtraDiffuse    
    endif
drawindexed=auto
$CharacterIB = 0
endif

[CommandListOutline]
if $CharacterIB != 0
    if $CharacterIB == 1
        ps-t1 = copy ResourceRefHeadLightMap
    else if $CharacterIB == 2
        ps-t1 = copy ResourceRefBodyLightMap
    else if $CharacterIB == 3
        ps-t1 = copy ResourceRefDressLightMap
    else if $CharacterIB == 4
        ps-t1 = copy ResourceRefExtraLightMap
    endif
drawindexed=auto
$CharacterIB = 0
endif
