Texture2D tex1 : register(t0); SamplerState _tex1_sampler : register(s0); Texture2D tex2 : register(t1); SamplerState _tex2_sampler : register(s1); static uint vExtra; static float4 vTint; static float2 vUV1; static float2 vUV2; static float vRatio; static float4 fragColor; static float4 lightColor; struct SPIRV_Cross_Input { float2 vUV1 : TEXCOORD0; float2 vUV2 : TEXCOORD1; float4 vTint : TEXCOORD2; nointerpolation uint vExtra : TEXCOORD3; nointerpolation float vRatio : TEXCOORD4; }; struct SPIRV_Cross_Output { float4 fragColor : SV_Target0; float4 lightColor : SV_Target1; }; float4 applySpriteFlags(inout float4 color, float4 tint, uint extra) { if ((vExtra & 4u) != 0u) { color = float4(color.www - color.xyz, color.w); } if ((vExtra & 2u) == 0u) { color *= tint; } else { float alpha = color.w * tint.w; float3 x = (color.xyz * tint.xyz) * 2.0f; float3 y = alpha.xxx - (((color.w.xxx - color.xyz) * 2.0f) * (tint.w.xxx - tint.xyz)); float _104; if (color.x < (0.5f * color.w)) { _104 = x.x; } else { _104 = y.x; } color.x = _104; float _121; if (color.y < (0.5f * color.w)) { _121 = x.y; } else { _121 = y.y; } color.y = _121; float _137; if (color.z < (0.5f * color.w)) { _137 = x.z; } else { _137 = y.z; } color.z = _137; color.w = alpha; } if ((extra & 1u) != 0u) { float4 _154 = color; float3 _161 = dot(_154.xyz, float3(0.2989999949932098388671875f, 0.58700001239776611328125f, 0.114000000059604644775390625f)).xxx; color.x = _161.x; color.y = _161.y; color.z = _161.z; } return color; } float4 applySpriteFlags(float4 color) { float4 param = color; float4 param_1 = vTint; uint param_2 = vExtra; float4 _211 = applySpriteFlags(param, param_1, param_2); return _211; } float4 getFragColor(float4 color, uint extra) { bool4 _199 = ((extra & 16u) != 0u).xxxx; return float4(_199.x ? 0.0f.xxxx.x : color.x, _199.y ? 0.0f.xxxx.y : color.y, _199.z ? 0.0f.xxxx.z : color.z, _199.w ? 0.0f.xxxx.w : color.w); } float4 getLightColor(float4 color, uint extra) { float4 _175; if ((extra & 48u) != 0u) { _175 = float4(color.xyz, 0.0f); } else { _175 = float4(0.0f, 0.0f, 0.0f, color.w); } return _175; } void frag_main() { float4 param = lerp(tex1.Sample(_tex1_sampler, vUV1), tex2.Sample(_tex2_sampler, vUV2), vRatio.xxxx); float4 color = applySpriteFlags(param); float4 param_1 = color; uint param_2 = vExtra; fragColor = getFragColor(param_1, param_2); float4 param_3 = color; uint param_4 = vExtra; lightColor = getLightColor(param_3, param_4); } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) { vExtra = stage_input.vExtra; vTint = stage_input.vTint; vUV1 = stage_input.vUV1; vUV2 = stage_input.vUV2; vRatio = stage_input.vRatio; frag_main(); SPIRV_Cross_Output stage_output; stage_output.fragColor = fragColor; stage_output.lightColor = lightColor; return stage_output; }