struct VertexAttributes {
    float3 position;
    float3 normal;
    float4 tangent;
};

RWStructuredBuffer<VertexAttributes> rw_buffer : register(u5);
StructuredBuffer<VertexAttributes> base : register(t50);
StructuredBuffer<VertexAttributes> Thicc : register(t51);
StructuredBuffer<VertexAttributes> Chest : register(t52);
StructuredBuffer<VertexAttributes> OG : register(t53);

Texture1D<float4> IniParams : register(t120);
#define key IniParams[88].x
#define key1 IniParams[89].x

[numthreads(1, 1, 1)]
void main(uint3 threadID : SV_DispatchThreadID)
{
    uint i = threadID.x;

    float k1 = max(0, key);
    float k2 = max(0, -key);
    float k3 = key1;

    float3 skp1 = (base[i].position - Thicc[i].position) * k1;
    float3 skn1 = (base[i].normal - Thicc[i].normal) * k1;
    float4 skt1 = (base[i].tangent - Thicc[i].tangent) * k1;

    float3 skp3 = (base[i].position - OG[i].position) * k2;
    float3 skn3 = (base[i].normal - OG[i].normal) * k2;
    float4 skt3 = (base[i].tangent - OG[i].tangent) * k2;

    float3 skp2 = (base[i].position - Chest[i].position) * k3;
    float3 skn2 = (base[i].normal - Chest[i].normal) * k3;
    float4 skt2 = (base[i].tangent - Chest[i].tangent) * k3;

    rw_buffer[i].position = base[i].position - skp1 - skp3 - skp2;
    rw_buffer[i].normal = base[i].normal - skn1 - skn3 - skn2;
    rw_buffer[i].tangent = base[i].tangent - skt1 - skt3 - skt2;
}
