// DECALS
// Generated by Microsoft (R) HLSL Shader Compiler 9.30.9200.20546
//
//   using 3Dmigoto v1.3.15 on Sun Mar 24 14:56:00 2019
//
//
// Buffer Definitions:
//
// cbuffer cbDecalParam
// {
//
//   row_major float4x4 FC_ProjToDecalSpace;// Offset:    0 Size:    64
//   float4x4 g_InvProjMatrix;          // Offset:   64 Size:    64 [unused]
//   float4x4 g_CameraMatrix;           // Offset:  128 Size:    64 [unused]
//   float4 unused_FC_ScreenSize;       // Offset:  192 Size:    16 [unused]
//   row_major float3x4 FC_DecalWorldRotation;// Offset:  208 Size:    48
//   float4 FC_EyeInDecalSpace;         // Offset:  256 Size:    16 [unused]
//   float4 FC_ParallaxScale;           // Offset:  272 Size:    16
//   float4 FC_DecalSoakThreshold;      // Offset:  288 Size:    16 [unused]
//   float4 FC_CubeCenterOffset;        // Offset:  304 Size:    16 [unused]
//   float4 FC_DiffuseScale;            // Offset:  320 Size:    16
//   float3 FC_ReflectanceScale;        // Offset:  336 Size:    12
//   float FC_ShininessScale;           // Offset:  348 Size:     4
//   float4 FC_LightInDecalSpace;       // Offset:  352 Size:    16 [unused]
//   float FC_EmissiveIntensity;        // Offset:  368 Size:     4 [unused]
//   float FC_NearFade_Start;           // Offset:  384 Size:     4
//   float FC_NearFade_ReciRange;       // Offset:  388 Size:     4
//   float FC_FarFade_Start;            // Offset:  392 Size:     4
//   float FC_FarFade_ReciRange;        // Offset:  396 Size:     4
//   float FC_NormalThreshold_Start;    // Offset:  400 Size:     4
//   float FC_NormalThreshold_ReciRange;// Offset:  404 Size:     4
//
// }
//
// cbuffer cbModelParam
// {
//
//   float4 FC_DifColMul;               // Offset:    0 Size:    16
//   float FC_EnvMapInterpRatio;        // Offset:   16 Size:     4 [unused]
//   float FC_EnvMapColorScale0;        // Offset:   20 Size:     4 [unused]
//   float FC_EnvMapColorScale1;        // Offset:   24 Size:     4 [unused]
//   float FC_DitherEnable;             // Offset:   32 Size:     4 [unused]
//   float FC_CameraFadeEnd;            // Offset:   36 Size:     4 [unused]
//   float FC_CameraFadeInvRange;       // Offset:   40 Size:     4 [unused]
//   float4 FC_SkinMatchColor;          // Offset:   96 Size:    16 [unused]
//   float4 FC_ParallaxCorrectedCubemapOriginA;// Offset:  128 Size:    16 [unused]
//   float4 FC_ParallaxCorrectedCubemapOriginB;// Offset:  144 Size:    16 [unused]
//   float4x4 FC_ParallaxCorrectedCubemapObbA;// Offset:  160 Size:    64 [unused]
//   float4x4 FC_ParallaxCorrectedCubemapInvObbA;// Offset:  224 Size:    64 [unused]
//   float4x4 FC_ParallaxCorrectedCubemapObbB;// Offset:  288 Size:    64 [unused]
//   float4x4 FC_ParallaxCorrectedCubemapInvObbB;// Offset:  352 Size:    64 [unused]
//   float FC_ParallaxCorrectedCubemapObbAEnable;// Offset:  416 Size:     4 [unused]
//   float FC_ParallaxCorrectedCubemapObbBEnable;// Offset:  420 Size:     4 [unused]
//   float4x4 FC_IrradianceVolumeAInvObb;// Offset:  432 Size:    64 [unused]
//   float4x4 FC_IrradianceVolumeBInvObb;// Offset:  496 Size:    64 [unused]
//   float4 FC_IrradianceVolumeASamplingParam;// Offset:  560 Size:    16 [unused]
//   float4 FC_IrradianceVolumeBSamplingParam;// Offset:  576 Size:    16 [unused]
//   float FC_IrradianceVolumeAEnable;  // Offset:  592 Size:     4 [unused]
//   float FC_IrradianceVolumeBEnable;  // Offset:  596 Size:     4 [unused]
//   float FC_IrradianceVolumeAScale;   // Offset:  600 Size:     4 [unused]
//   float FC_IrradianceVolumeBScale;   // Offset:  604 Size:     4 [unused]
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// SS_DiffuseMap                     sampler      NA          NA    0        1
// SS_SpecularMap                    sampler      NA          NA    1        1
// SS_BumpMap                        sampler      NA          NA    2        1
// SS_MaskMap                        sampler      NA          NA    3        1
// SS_ClampPoint                     sampler      NA          NA    7        1
// g_DiffuseTexture                  texture  float4          2d    0        1
// g_SpecularTexture                 texture  float4          2d    1        1
// g_BumpmapTexture                  texture  float4          2d    3        1
// g_DepthTexture                    texture  float4          2d    4        1
// g_GBuffer0Texture                 texture  float4          2d   13        1
// g_MaskTexture                     texture  float4          2d   17        1
// cbModelParam                      cbuffer      NA          NA    7        1
// cbDecalParam                      cbuffer      NA          NA   10        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   float
// TEXCOORD                 0   xyzw        1     NONE   float   xy w
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Target                0   xyzw        0   TARGET   float   xyzw
// SV_Target                1   xyzw        1   TARGET   float   xyzw
// SV_Target                2   xyzw        2   TARGET   float   xyzw
//
ps_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer CB10[26], immediateIndexed
dcl_constantbuffer CB7[1], immediateIndexed
dcl_sampler s0, mode_default
dcl_sampler s1, mode_default
dcl_sampler s2, mode_default
dcl_sampler s3, mode_default
dcl_sampler s7, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_resource_texture2d (float,float,float,float) t3
dcl_resource_texture2d (float,float,float,float) t4
dcl_resource_texture2d (float,float,float,float) t13
dcl_resource_texture2d (float,float,float,float) t17
dcl_input_ps linear v1.xyw
dcl_output o0.xyzw
dcl_output o1.xyzw
dcl_output o2.xyzw

dcl_temps 34
dcl_resource_texture2d (float,float,float,float) t125

div r0.xy, v1.xyxx, v1.wwww
mad r1.xy, r0.xyxx, l(0.500000, -0.500000, 0.000000, 0.000000), l(0.500000, 0.500000, 0.000000, 0.000000)
sample_indexable(texture2d)(float,float,float,float) r0.z, r1.xyxx, t4.yzxw, s7
sample_indexable(texture2d)(float,float,float,float) r1.xyz, r1.xyxx, t13.xyzw, s7
mad r1.xyz, r1.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mov r0.w, l(1.000000)

// depth
dp4 r32.w, cb10[7].xyzw, r0.xyzw

// correction
ld_indexable(texture2d)(float,float,float,float) r33.xyzw, l(0, 0, 0, 0), t125.xyzw
mul r33.w, r32.w, r33.y
add r33.w, r33.w, l(-1.0)
mul r33.w, r33.w, r33.x
add r0.x, r0.x, r33.w


dp4 r2.x, cb10[0].xyzw, r0.xyzw
dp4 r2.y, cb10[1].xyzw, r0.xyzw
dp4 r2.z, cb10[2].xyzw, r0.xyzw
dp4 r0.x, cb10[3].xyzw, r0.xyzw
div r0.xyz, r2.xyzx, r0.xxxx
lt r2.xyz, r0.xyzx, l(0.000000, 0.000000, 0.000000, 0.000000)
and r2.xyz, r2.xyzx, l(1, 1, 1, 0)
lt r3.xyz, l(1.000000, 1.000000, 1.000000, 0.000000), r0.xyzx
and r3.xyz, r3.xyzx, l(1, 1, 1, 0)
iadd r2.xyz, r2.xyzx, r3.xyzx
itof r2.xyz, r2.xyzx
dp3 r0.w, r2.xyzx, r2.xyzx
ne r0.w, r0.w, l(0.000000)
discard_nz r0.w
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r1.xyzx
dp3 r0.w, r1.xyzx, -cb10[14].xyzx
add r0.w, r0.w, -cb10[25].x
mul_sat r0.w, r0.w, cb10[25].y
add r1.xy, r0.yyyy, -cb10[24].xzxx
mul_sat r1.xy, r1.xyxx, cb10[24].ywyy
mul r0.y, r0.w, r1.x
add r0.w, -r1.y, l(1.000000)
mul r0.y, r0.w, r0.y
sample_indexable(texture2d)(float,float,float,float) r1.xyzw, r0.xzxx, t0.xyzw, s0
mul r0.y, r0.y, r1.w
mul r1.xyz, r1.xyzx, cb10[20].xyzx
mul r0.y, r0.y, cb10[20].w
sample_indexable(texture2d)(float,float,float,float) r0.w, r0.xzxx, t17.yzwx, s3
mul r0.y, r0.w, r0.y
mul r0.y, r0.y, cb7[0].w
ge r0.w, l(0.000000), r0.y
discard_nz r0.w
sample_indexable(texture2d)(float,float,float,float) r0.w, r0.xzxx, t3.xywz, s2
sample_indexable(texture2d)(float,float,float,float) r2.xyz, r0.xzxx, t1.xyzw, s1
mul o0.x, r0.w, cb10[21].w
mov o0.w, r0.y
mov o0.yz, l(0,0,1.000000,0)
mad r0.xzw, -r2.xxyz, cb10[21].xxyz, l(1.000000, 0.000000, 1.000000, 1.000000)
mul r2.xyz, r2.xyzx, cb10[21].xyzx
sqrt o2.xyz, r2.xyzx
mul r0.xzw, r0.xxzw, r1.xxyz
mul r0.xzw, r0.xxzw, cb7[0].xxyz
mul o1.xyz, r0.yyyy, r0.xzwx
mov o1.w, r0.y
mul o2.w, r0.y, cb10[17].z
ret
// Approximately 54 instruction slots used

