/**************************
***** Compiler Parameters *****
***************************
@P EffectName: TextureFXEffect
@P   - EffectNodeBase.EffectNodeBaseShader: mixin Halo_TextureFX [{BackgroundColor = mixin DoFloat4 [{Before = mixin ComputeOrder [{Computes = [mixin AssignVarFloat4<Default_0> [{Value = InputFloat4<ShaderFX.InputValueFloat4_Color,PerUpdate>}]]}]}, {Value = GetVarFloat4<Default_0>}]}, {HaloColor = mixin DoFloat4 [{Before = mixin ComputeOrder [{Computes = [mixin AssignVarFloat4<Default_1> [{Value = InputFloat4<ShaderFX.InputValueFloat4_Color.i1,PerUpdate>}]]}]}, {Value = GetVarFloat4<Default_1>}]}]
@P BackgroundColor: mixin DoFloat4 [{Before = mixin ComputeOrder [{Computes = [mixin AssignVarFloat4<Default_0> [{Value = InputFloat4<ShaderFX.InputValueFloat4_Color,PerUpdate>}]]}]}, {Value = GetVarFloat4<Default_0>}]
@P HaloColor: mixin DoFloat4 [{Before = mixin ComputeOrder [{Computes = [mixin AssignVarFloat4<Default_1> [{Value = InputFloat4<ShaderFX.InputValueFloat4_Color.i1,PerUpdate>}]]}]}, {Value = GetVarFloat4<Default_1>}]
***************************
****  ConstantBuffers  ****
***************************
cbuffer PerDraw [Size: 64]
@C    MatrixTransform_id73 => SpriteBase.MatrixTransform
cbuffer PerUpdate [Size: 32]
@C    InputValue_id94 => ShaderFX.InputValueFloat4_Color
@C    InputValue_id100 => ShaderFX.InputValueFloat4_Color.i1
cbuffer PerView [Size: 32]
@C    NearClipPlane_id74 => Camera.NearClipPlane
@C    FarClipPlane_id75 => Camera.FarClipPlane
@C    ZProjection_id76 => Camera.ZProjection
@C    ViewSize_id77 => Camera.ViewSize
@C    AspectRatio_id78 => Camera.AspectRatio
cbuffer Globals [Size: 96]
@C    Texture0TexelSize_id15 => Texturing.Texture0TexelSize
@C    Texture1TexelSize_id17 => Texturing.Texture1TexelSize
@C    Texture2TexelSize_id19 => Texturing.Texture2TexelSize
@C    Texture3TexelSize_id21 => Texturing.Texture3TexelSize
@C    Texture4TexelSize_id23 => Texturing.Texture4TexelSize
@C    Texture5TexelSize_id25 => Texturing.Texture5TexelSize
@C    Texture6TexelSize_id27 => Texturing.Texture6TexelSize
@C    Texture7TexelSize_id29 => Texturing.Texture7TexelSize
@C    Texture8TexelSize_id31 => Texturing.Texture8TexelSize
@C    Texture9TexelSize_id33 => Texturing.Texture9TexelSize
@C    InnerRadius_id87 => Halo_TextureFX.InnerRadius
@C    OuterRadius_id88 => Halo_TextureFX.OuterRadius
@C    Type_id89 => Halo_TextureFX.Type
@C    Gamma_id92 => Halo_TextureFX.Gamma
***************************
******  Resources    ******
***************************
@R    PerDraw => PerDraw [Stage: Vertex, Slot: (0-0)]
@R    PerUpdate => PerUpdate [Stage: Pixel, Slot: (0-0)]
@R    PerView => PerView [Stage: Pixel, Slot: (1-1)]
@R    Globals => Globals [Stage: Pixel, Slot: (2-2)]
***************************
*****     Sources     *****
***************************
@S    Halo_TextureFX => 8ee56ba147cec64af37d65539da9ac2f
@S    TextureFX => 27bb4f1f808a5eedf6dfeaa75c669c29
@S    ImageEffectShader => 8064e30cc02e5eb4052f420259dbf05e
@S    SpriteBase => 5a7aa9dfd5b5c7613053f4f66c79ca0d
@S    ShaderBase => 4ecbcd2528b64a79eebe81a863892d8c
@S    ShaderBaseStream => b705b699a7385d39c7de52a8d13f3978
@S    Texturing => 91ef3011c1071c2e5d41cd3ee0418b18
@S    Camera => f5d1a113ef7a27319900e8cc2e11ae0d
@S    ShaderUtils => 27e27e08e991883f970444d1aebe3b58
@S    ComputeColor => c875a0e093379dd74cd9a5a73aca830f
@S    DoFloat4 => 312f1c610231ffe618620ce43634d0aa
@S    ComputeFloat4 => f871947e9f604da432ea9fc3c9cb4363
@S    ComputeVoid => b62583a94b8503c79e9107f4b5bc9392
@S    ComputeOrder => 1d9b1cd3f5e3ad3f3f10e4fc88326cc7
@S    AssignVarFloat4 => 3a0c495ce724365e837c33156190acbe
@S    StreamVariableFloat4 => 2bfe58666cb67eed05b9410465550725
@S    InputFloat4 => f6891eacc9ea2d912dcfded49ea96a71
@S    DeclFloat4 => 03cb445d0e450d0a37ad5f24c8a93feb
@S    GetVarFloat4 => 2805d4f95c82389ce488a02bbf6e99f5
***************************
*****     Stages      *****
***************************
@G    Vertex => 79eb7ff071584feaa45b858a38e87b6a
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//
// Buffer Definitions: 
//
// cbuffer PerDraw
// {
//
//   float4x4 MatrixTransform_id73;     // Offset:    0 Size:    64
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim      HLSL Bind  Count
// ------------------------------ ---------- ------- ----------- -------------- ------
// PerDraw                           cbuffer      NA          NA            cb0      1 
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy  
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB0[4], immediateIndexed
dcl_input v0.xyzw
dcl_input v1.xy
dcl_output_siv o0.xyzw, position
dcl_output o1.xy
//
// Initial variable locations:
//   v0.x <- __input__.Position_id72.x; v0.y <- __input__.Position_id72.y; v0.z <- __input__.Position_id72.z; v0.w <- __input__.Position_id72.w; 
//   v1.x <- __input__.TexCoord_id62.x; v1.y <- __input__.TexCoord_id62.y; 
//   o1.x <- <VSMain return value>.TexCoord_id62.x; o1.y <- <VSMain return value>.TexCoord_id62.y; 
//   o0.x <- <VSMain return value>.ShadingPosition_id0.x; o0.y <- <VSMain return value>.ShadingPosition_id0.y; o0.z <- <VSMain return value>.ShadingPosition_id0.z; o0.w <- <VSMain return value>.ShadingPosition_id0.w
//
#line 241 "C:\Users\alex\Documents\vvvv\gamma\Exports\5sun2\log\shader_TextureFXEffect_10463acb30cd0d5cc1824ad213145ad1.hlsl"
dp4 o0.x, v0.xyzw, cb0[0].xyzw
dp4 o0.y, v0.xyzw, cb0[1].xyzw
dp4 o0.z, v0.xyzw, cb0[2].xyzw
dp4 o0.w, v0.xyzw, cb0[3].xyzw

#line 245
mov o1.xy, v1.xyxx
ret 
// Approximately 6 instruction slots used
@G    Pixel => fe8ce198f210fa125f31c87b88d2e38e
//
// Generated by Microsoft (R) HLSL Shader Compiler 10.1
//
//
// Buffer Definitions: 
//
// cbuffer PerUpdate
// {
//
//   float4 InputValue_id94;            // Offset:    0 Size:    16
//   float4 InputValue_id100;           // Offset:   16 Size:    16
//
// }
//
// cbuffer PerView
// {
//
//   float NearClipPlane_id74;          // Offset:    0 Size:     4 [unused]
//      = 0x3f800000 
//   float FarClipPlane_id75;           // Offset:    4 Size:     4 [unused]
//      = 0x42c80000 
//   float2 ZProjection_id76;           // Offset:    8 Size:     8 [unused]
//   float2 ViewSize_id77;              // Offset:   16 Size:     8
//   float AspectRatio_id78;            // Offset:   24 Size:     4 [unused]
//
// }
//
// cbuffer Globals
// {
//
//   float2 Texture0TexelSize_id15;     // Offset:    0 Size:     8 [unused]
//   float2 Texture1TexelSize_id17;     // Offset:    8 Size:     8 [unused]
//   float2 Texture2TexelSize_id19;     // Offset:   16 Size:     8 [unused]
//   float2 Texture3TexelSize_id21;     // Offset:   24 Size:     8 [unused]
//   float2 Texture4TexelSize_id23;     // Offset:   32 Size:     8 [unused]
//   float2 Texture5TexelSize_id25;     // Offset:   40 Size:     8 [unused]
//   float2 Texture6TexelSize_id27;     // Offset:   48 Size:     8 [unused]
//   float2 Texture7TexelSize_id29;     // Offset:   56 Size:     8 [unused]
//   float2 Texture8TexelSize_id31;     // Offset:   64 Size:     8 [unused]
//   float2 Texture9TexelSize_id33;     // Offset:   72 Size:     8 [unused]
//   float InnerRadius_id87;            // Offset:   80 Size:     4
//      = 0x00000000 
//   float OuterRadius_id88;            // Offset:   84 Size:     4
//      = 0x3f000000 
//   int Type_id89;                     // Offset:   88 Size:     4
//      = 0x00000000 
//   float Gamma_id92;                  // Offset:   92 Size:     4
//      = 0x3f000000 
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim      HLSL Bind  Count
// ------------------------------ ---------- ------- ----------- -------------- ------
// PerUpdate                         cbuffer      NA          NA            cb0      1 
// PerView                           cbuffer      NA          NA            cb1      1 
// Globals                           cbuffer      NA          NA            cb2      1 
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float       
// TEXCOORD                 0   xy          1     NONE   float   xy  
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB0[2], immediateIndexed
dcl_constantbuffer CB1[2], immediateIndexed
dcl_constantbuffer CB2[6], immediateIndexed
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 3
//
// Initial variable locations:
//   v0.x <- __input__.ShadingPosition_id0.x; v0.y <- __input__.ShadingPosition_id0.y; v0.z <- __input__.ShadingPosition_id0.z; v0.w <- __input__.ShadingPosition_id0.w; 
//   v1.x <- __input__.TexCoord_id62.x; v1.y <- __input__.TexCoord_id62.y; 
//   o0.x <- <PSMain return value>.ColorTarget_id2.x; o0.y <- <PSMain return value>.ColorTarget_id2.y; o0.z <- <PSMain return value>.ColorTarget_id2.z; o0.w <- <PSMain return value>.ColorTarget_id2.w
//
#line 209 "C:\Users\alex\Documents\vvvv\gamma\Exports\5sun2\log\shader_TextureFXEffect_10463acb30cd0d5cc1824ad213145ad1.hlsl"
div r0.x, cb1[1].x, cb1[1].y  // r0.x <- aspect

#line 210
add r0.zw, v1.xxxy, l(0.000000, 0.000000, -0.500000, -0.500000)
mov r0.y, l(1.000000)
mul r0.xy, r0.xyxx, r0.zwzz

#line 211
add r0.z, -cb2[5].w, l(1.000010)
div r0.z, cb2[5].w, r0.z  // r0.z <- g

#line 212
add r0.w, -cb2[5].x, cb2[5].y  // r0.w <- thickness

#line 213
dp2 r0.x, -r0.xyxx, -r0.xyxx
sqrt r0.x, r0.x
add r0.x, r0.x, -cb2[5].x
max r0.x, r0.x, l(0.000000)
min r0.x, r0.w, r0.x  // r0.x <- halo

#line 214
div r0.x, r0.x, r0.w  // r0.x <- f

#line 215
switch cb2[5].z

#line 218
  case l(0)

#line 200
  mov_sat r0.x, r0.x
  mad r0.y, r0.x, l(-2.000000), l(3.000000)
  mul r0.w, r0.x, r0.x
  mul r0.y, r0.w, r0.y  // r0.y <- f

#line 201
  log r0.y, r0.y
  mul r0.y, r0.y, r0.z
  exp r0.y, r0.y  // r0.y <- f

#line 202
  add r2.xyzw, cb0[0].xyzw, -cb0[1].xyzw
  mad r1.xyzw, r0.yyyy, r2.xyzw, cb0[1].xyzw  // r1.x <- <Smooth_id29 return value>.x; r1.y <- <Smooth_id29 return value>.y; r1.z <- <Smooth_id29 return value>.z; r1.w <- <Smooth_id29 return value>.w

#line 220
  break   // r0.w <- thickness; r0.x <- f

#line 221
  case l(1)

#line 195
  log r0.x, r0.x
  mul r0.x, r0.x, r0.z
  exp r0.x, r0.x  // r0.x <- f

#line 196
  add r2.xyzw, cb0[0].xyzw, -cb0[1].xyzw
  mad r1.xyzw, r0.xxxx, r2.xyzw, cb0[1].xyzw  // r1.x <- <Linear_id28 return value>.x; r1.y <- <Linear_id28 return value>.y; r1.z <- <Linear_id28 return value>.z; r1.w <- <Linear_id28 return value>.w

#line 223
  break   // r0.x <- f

#line 224
  default 
  mov r1.xyzw, l(0,0,0,0)  // r1.x <- col.x; r1.y <- col.y; r1.z <- col.z; r1.w <- col.w
  break 
endswitch 
mov o0.xyzw, r1.xyzw

#line 234
ret 
// Approximately 38 instruction slots used
***************************
*************************/
struct PS_STREAMS 
{
    float2 TexCoord_id62;
    float4 Default_1_id99;
    float4 Default_0_id93;
    float4 ColorTarget_id2;
};
struct PS_OUTPUT 
{
    float4 ColorTarget_id2 : SV_Target0;
};
struct PS_INPUT 
{
    float4 ShadingPosition_id0 : SV_Position;
    float2 TexCoord_id62 : TEXCOORD0;
};
struct VS_STREAMS 
{
    float4 Position_id72;
    float2 TexCoord_id62;
    float4 ShadingPosition_id0;
};
struct VS_OUTPUT 
{
    float4 ShadingPosition_id0 : SV_Position;
    float2 TexCoord_id62 : TEXCOORD0;
};
struct VS_INPUT 
{
    float4 Position_id72 : POSITION;
    float2 TexCoord_id62 : TEXCOORD0;
};
cbuffer PerDraw 
{
    float4x4 MatrixTransform_id73;
};
cbuffer PerUpdate 
{
    float4 InputValue_id94;
    float4 InputValue_id100;
};
cbuffer PerView 
{
    float NearClipPlane_id74 = 1.0f;
    float FarClipPlane_id75 = 100.0f;
    float2 ZProjection_id76;
    float2 ViewSize_id77;
    float AspectRatio_id78;
};
cbuffer Globals 
{
    float2 Texture0TexelSize_id15;
    float2 Texture1TexelSize_id17;
    float2 Texture2TexelSize_id19;
    float2 Texture3TexelSize_id21;
    float2 Texture4TexelSize_id23;
    float2 Texture5TexelSize_id25;
    float2 Texture6TexelSize_id27;
    float2 Texture7TexelSize_id29;
    float2 Texture8TexelSize_id31;
    float2 Texture9TexelSize_id33;
    float InnerRadius_id87 = 0.0f;
    float OuterRadius_id88 = 0.5f;
    int Type_id89 = 0;
    float Gamma_id92 = 0.5f;
};
Texture2D Texture0_id14;
Texture2D Texture1_id16;
Texture2D Texture2_id18;
Texture2D Texture3_id20;
Texture2D Texture4_id22;
Texture2D Texture5_id24;
Texture2D Texture6_id26;
Texture2D Texture7_id28;
Texture2D Texture8_id30;
Texture2D Texture9_id32;
TextureCube TextureCube0_id34;
TextureCube TextureCube1_id35;
TextureCube TextureCube2_id36;
TextureCube TextureCube3_id37;
Texture3D Texture3D0_id38;
Texture3D Texture3D1_id39;
Texture3D Texture3D2_id40;
Texture3D Texture3D3_id41;
SamplerState Sampler_id42;
SamplerState PointSampler_id43 
{
    Filter = MIN_MAG_MIP_POINT;
};
SamplerState LinearSampler_id44 
{
    Filter = MIN_MAG_MIP_LINEAR;
};
SamplerState LinearBorderSampler_id45 
{
    Filter = MIN_MAG_MIP_LINEAR;
    AddressU = Border;
    AddressV = Border;
};
SamplerComparisonState LinearClampCompareLessEqualSampler_id46 
{
    Filter = COMPARISON_MIN_MAG_LINEAR_MIP_POINT;
    AddressU = Clamp;
    AddressV = Clamp;
    ComparisonFunc = LessEqual;
};
SamplerState AnisotropicSampler_id47 
{
    Filter = ANISOTROPIC;
};
SamplerState AnisotropicRepeatSampler_id48 
{
    Filter = ANISOTROPIC;
    AddressU = Wrap;
    AddressV = Wrap;
    MaxAnisotropy = 16;
};
SamplerState PointRepeatSampler_id49 
{
    Filter = MIN_MAG_MIP_POINT;
    AddressU = Wrap;
    AddressV = Wrap;
};
SamplerState LinearRepeatSampler_id50 
{
    Filter = MIN_MAG_MIP_LINEAR;
    AddressU = Wrap;
    AddressV = Wrap;
};
SamplerState RepeatSampler_id51 
{
    AddressU = Wrap;
    AddressV = Wrap;
};
SamplerState Sampler0_id52;
SamplerState Sampler1_id53;
SamplerState Sampler2_id54;
SamplerState Sampler3_id55;
SamplerState Sampler4_id56;
SamplerState Sampler5_id57;
SamplerState Sampler6_id58;
SamplerState Sampler7_id59;
SamplerState Sampler8_id60;
SamplerState Sampler9_id61;
float4 Compute_id33()
{
    return InputValue_id94;
}
float4 Compute_id42()
{
    return InputValue_id100;
}
void Compute_id36(inout PS_STREAMS streams)
{
    streams.Default_0_id93 = Compute_id33();
}
void Compute_id45(inout PS_STREAMS streams)
{
    streams.Default_1_id99 = Compute_id42();
}
float4 Compute_id39(inout PS_STREAMS streams)
{
    return streams.Default_0_id93;
}
void Compute_id38(inout PS_STREAMS streams)
{

    {
        Compute_id36(streams);
    }
}
float4 Compute_id48(inout PS_STREAMS streams)
{
    return streams.Default_1_id99;
}
void Compute_id47(inout PS_STREAMS streams)
{

    {
        Compute_id45(streams);
    }
}
float4 Compute_id32(inout PS_STREAMS streams)
{
    Compute_id38(streams);
    return Compute_id39(streams);
}
float4 Compute_id31(inout PS_STREAMS streams)
{
    Compute_id47(streams);
    return Compute_id48(streams);
}
float4 Linear_id28(inout PS_STREAMS streams, float f, float g)
{
    f = pow(f, g);
    return lerp(Compute_id31(streams), Compute_id32(streams), f);
}
float4 Smooth_id29(inout PS_STREAMS streams, float f, float g)
{
    f = smoothstep(0, 1, f);
    f = pow(f, g);
    return lerp(Compute_id31(streams), Compute_id32(streams), f);
}
float4 Shading_id30(inout PS_STREAMS streams)
{
    float2 uv = streams.TexCoord_id62;
    float4 col = 0;
    float2 targetSize = ViewSize_id77;
    float aspect = targetSize.x / targetSize.y;
    uv = (uv - 0.5) * float2(aspect, 1) + 0.5;
    float g = Gamma_id92 / (1.00001 - Gamma_id92);
    float thickness = OuterRadius_id88 - InnerRadius_id87;
    float halo = clamp(distance(float2(0, 0), uv - 0.5) - InnerRadius_id87, 0, thickness);
    float f = halo / thickness;
    switch (Type_id89)

    {
        case 0:
            col = Smooth_id29(streams, f, g);
            break;
        case 1:
            col = Linear_id28(streams, f, g);
            break;
    }
    return col;
}
PS_OUTPUT PSMain(PS_INPUT __input__)
{
    PS_STREAMS streams = (PS_STREAMS)0;
    streams.TexCoord_id62 = __input__.TexCoord_id62;
    streams.ColorTarget_id2 = Shading_id30(streams);
    PS_OUTPUT __output__ = (PS_OUTPUT)0;
    __output__.ColorTarget_id2 = streams.ColorTarget_id2;
    return __output__;
}
VS_OUTPUT VSMain(VS_INPUT __input__)
{
    VS_STREAMS streams = (VS_STREAMS)0;
    streams.Position_id72 = __input__.Position_id72;
    streams.TexCoord_id62 = __input__.TexCoord_id62;
    streams.ShadingPosition_id0 = mul(streams.Position_id72, MatrixTransform_id73);
    VS_OUTPUT __output__ = (VS_OUTPUT)0;
    __output__.ShadingPosition_id0 = streams.ShadingPosition_id0;
    __output__.TexCoord_id62 = streams.TexCoord_id62;
    return __output__;
}
