// ---- Created with 3Dmigoto v1.3.16 on Thu Feb 19 14:41:00 2026
Texture2D<float4> t1 : register(t1);

Texture2D<float4> t0 : register(t0);

SamplerState s1_s : register(s1);

SamplerState s0_s : register(s0);

cbuffer cb2 : register(b2)
{
  float4 cb2[18];
}

cbuffer cb1 : register(b1)
{
  float4 cb1[1];
}

cbuffer cb0 : register(b0)
{
  float4 cb0[309];
}




// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);


void main(
  float4 v0 : SV_POSITION0,
  float4 v1 : POSITION1,
  float3 v2 : POSITION2,
  float4 v3 : TEXCOORD0,
  float4 v4 : TEXCOORD1,
  float4 v5 : TEXCOORD2,
  float4 v6 : TEXCOORD3,
  float4 v7 : TEXCOORD7,
  float4 v8 : TEXCOORD11,
  float3 v9 : TEXCOORD14,
  out float4 o0 : SV_TARGET0)
{
  float4 r0,r1,r2,r3,r4;
  uint4 bitmask, uiDest;
  float4 fDest;

  r0.xy = v3.xy * cb0[296].xy + cb0[296].zw;
  r0.xy = cb1[0].yy * cb0[298].zw + r0.xy;
  r0.xyzw = t0.Sample(s0_s, r0.xy).xyzw;
  r1.x = cb0[308].z + r0.x;
  r1.y = 0.00100000005 + r0.x;
  r1.x = max(r1.x, r1.y);
  r1.x = r1.x + -r0.x;
  r1.x = 1 / r1.x;
  r2.xyzw = v3.xyxy * cb0[297].xyxy + cb0[297].zwzw;
  r1.yz = cb1[0].yy * cb0[298].yy + r2.zw;
  r2.xyzw = cb1[0].yyyy * cb0[298].xyxx + r2.xyzw;
  r3.xyzw = t1.Sample(s1_s, r1.yz).xyzw;
  r4.xyzw = t1.Sample(s1_s, r2.xy).xyzw;
  r2.xyzw = t1.Sample(s1_s, r2.zw).xyzw;
  r1.y = cb0[308].y * cb1[0].y + r4.x;
  r1.z = 3.1415925 * r1.y;
  r1.z = sin(r1.z);
  r1.z = -r1.z * 0.899999976 + 1;
  r1.z = r1.z + -r1.y;
  r3.xy = asint(cb0[307].wz);
  r1.y = r3.x * r1.z + r1.y;
  r1.z = r3.w + -r1.y;
  r1.y = r3.y * r1.z + r1.y;
  r1.z = r1.y + -r0.x;
  r1.x = saturate(r1.z * r1.x);
  r1.z = r1.x * -2 + 3;
  r1.x = r1.x * r1.x;
  r1.x = r1.z * r1.x + -r1.y;
  r4.w = cb0[299].x * r1.x + r1.y;
  r1.x = -1 + r1.y;
  r4.xyz = cb2[17].xyz * r4.www;
  r1.y = cmp(cb0[299].y == 1.000000);
  r4.xyzw = r1.yyyy ? r0.xyzw : r4.xyzw;
  r1.yzw = -r4.xyz + r2.xyz;
  r1.yzw = r3.yyy * r1.yzw + r4.xyz;
  r0.xyz = r0.xyz * cb2[17].xyz + -r1.yzw;
  r0.w = -r4.w + r0.w;
  r0.w = cb0[304].z * r0.w + r4.w;
  r2.x = asint(cb0[308].x);
  r0.xyz = r2.xxx * r0.xyz + r1.yzw;
  r1.x = r2.x * r1.x + 1;
  o0.w = r1.x * r0.w;
  // 1. 先获取原本要输出的基础颜色
  float3 finalColor = cb0[302].xxx * r0.xyz;

  // 2. 提取亮度 (Luma)
  // 使用你提供的灰度权重公式
  float luma = dot(finalColor.xyz, float3(0.299, 0.587, 0.114));

  // 3. 映射为樱花粉色
  // 这里的系数 1.8, 0.8, 1.1 会显著增强红紫色调
  float3 sakuraColor = luma * float3(1.8, 0.8, 1.1);

  // 4. 将结果赋予输出寄存器
  o0.xyz = sakuraColor;
  return;
}
