cbuffer passParams : register(b1) { float _232_passTime : packoffset(c0); }; Texture2D atlasTexture : register(t0); SamplerState _atlasTexture_sampler : register(s0); Texture2D atlasAlpha : register(t3); SamplerState _atlasAlpha_sampler : register(s3); Texture2D mask1Texture : register(t1); SamplerState _mask1Texture_sampler : register(s1); Texture2D mask2Texture : register(t2); SamplerState _mask2Texture_sampler : register(s2); static float2 vUV; static float4 maskUVs; static float4 fragColor; static float3 vTint; static uint vFlags; static float4 lightColor; struct SPIRV_Cross_Input { float2 vUV : TEXCOORD0; float4 maskUVs : TEXCOORD1; nointerpolation uint vFlags : TEXCOORD2; float3 vTint : TEXCOORD3; }; struct SPIRV_Cross_Output { float4 fragColor : SV_Target0; float4 lightColor : SV_Target1; }; float fetchMaskTexture(Texture2D mask1Texture_1, SamplerState _mask1Texture_1_sampler, Texture2D mask2Texture_1, SamplerState _mask2Texture_1_sampler, float4 maskUVs_1, float time) { float mask = 1.0f; float2 mask1UV = maskUVs_1.xy; float2 mask2UV = maskUVs_1.zw; if (mask1UV.x > (-1.0f)) { mask = mask1Texture_1.Sample(_mask1Texture_1_sampler, mask1UV).x; if (mask2UV.x > (-1.0f)) { mask *= mask2Texture_1.Sample(_mask2Texture_1_sampler, mask2UV).x; } else { if (mask2UV.x <= (-2.0f)) { float timeScale = (-mask2UV.x) - 2.0f; float wave = (sin((time * timeScale) + mask2UV.y) + 1.0f) * 0.357142865657806396484375f; mask = 1.0f - smoothstep(wave, wave + 0.300000011920928955078125f, 1.0f - mask); } } } return mask; } float4 YCoCgToRGB(float4 ycocg, float alpha) { float Y = ycocg.w; float scale = 1.0f / ((31.875f * ycocg.z) + 1.0f); float Co = (ycocg.x - 0.501960813999176025390625f) * scale; float Cg = (ycocg.y - 0.501960813999176025390625f) * scale; float R = (Y + Co) - Cg; float G = Y + Cg; float B = (Y - Co) - Cg; return float4(R, G, B, alpha); } float4 getFragColor(float4 color, float3 tint, uint flags) { float4 finalColor = float4(color.xyz * tint, color.w); bool4 _112 = ((flags & 4u) != 0u).xxxx; return float4(_112.x ? 0.0f.xxxx.x : finalColor.x, _112.y ? 0.0f.xxxx.y : finalColor.y, _112.z ? 0.0f.xxxx.z : finalColor.z, _112.w ? 0.0f.xxxx.w : finalColor.w); } float4 getLightColor(float4 color, float mask, uint flags) { if ((flags & 36u) != 0u) { return float4(color.xyz * (mask * mask), 0.0f); } float _137; if ((flags & 64u) == 0u) { _137 = color.w; } else { _137 = 0.0f; } return float4(0.0f, 0.0f, 0.0f, _137); } void frag_main() { float4 yCoCg = atlasTexture.Sample(_atlasTexture_sampler, vUV); float alpha = atlasAlpha.Sample(_atlasAlpha_sampler, vUV).x; float4 param = maskUVs; float param_1 = _232_passTime; float mask = fetchMaskTexture(mask1Texture, _mask1Texture_sampler, mask2Texture, _mask2Texture_sampler, param, param_1); float4 param_2 = yCoCg; float param_3 = alpha; float4 color = YCoCgToRGB(param_2, param_3) * mask; float4 param_4 = color; float3 param_5 = vTint; uint param_6 = vFlags; fragColor = getFragColor(param_4, param_5, param_6); float4 param_7 = color; float param_8 = mask; uint param_9 = vFlags; lightColor = getLightColor(param_7, param_8, param_9); } SPIRV_Cross_Output main(SPIRV_Cross_Input stage_input) { vUV = stage_input.vUV; maskUVs = stage_input.maskUVs; vTint = stage_input.vTint; vFlags = stage_input.vFlags; frag_main(); SPIRV_Cross_Output stage_output; stage_output.fragColor = fragColor; stage_output.lightColor = lightColor; return stage_output; }