//
// Generated by Microsoft (R) HLSL Shader Compiler 10.0.10011.16384
//
//   using 3Dmigoto v1.3.16 on Tue Jan 18 18:00:19 2022
//
//
// Buffer Definitions:
//
// cbuffer ConstBuf__modelData
// {
//
//   struct ModelData
//   {
//
//       uint lightGroupID;             // Index:    0
//       uint modelFlags;               // Index:    0.y
//       float lodFade;                 // Index:    0.z
//       float displacementBlend;       // Index:    0.w
//       int turbulenceDataIdx;         // Index:    1
//       int instanceOffset;            // Index:    1.y
//       int characterFxIdx;            // Index:    1.z
//       uint debugRenderChannel;       // Index:    1.w
//       uint decayWriteOffset;         // Index:    2
//       uint decayWriteMaxCount;       // Index:    2.y
//       uint decayAtomicCounterIndex;  // Index:    2.z
//       float modelAlpha;              // Index:    2.w
//       float emissiveScale;           // Index:    3
//       float desaturationScale;       // Index:    3.y
//       float decayCoverageEstimation; // Index:    3.z
//       float3 quantScale;             // Index:    4
//       float3 quantBias;              // Index:    5
//
//   } resourceTables__modelData;       // Index:    0-5.z            Components:    23
                                        // Textures:  t0-t3
//
// }
//
// cbuffer ConstBuf__viewData
// {
//
//   struct ViewData
//   {
//
//       float4x4 view;                 // Index:    0
//       float4x4 invView;              // Index:    4
//       float4x4 proj;                 // Index:    8
//       float4x4 invViewProjNoZReproj; // Index:   12
//       float4x4 viewProj;             // Index:   16
//       float4x4 invViewProj;          // Index:   20
//       float4x4 previousViewProj;     // Index:   24
//       float4 prevLodEyePos;          // Index:   28
//       float4 lodEyePos;              // Index:   29
//       float4 viewDirDepthBias;       // Index:   30
//       float3 eyePos;                 // Index:   31
//       float2 viewportSize;           // Index:   32
//       float2 invViewportSize;        // Index:   32.z
//       float4 mirrorPlaneWS;          // Index:   33
//       float2 mirrorViewportSize;     // Index:   34
//       float2 opaqueRefractionViewportSize;// Index:   34.z
//       float windTime;                // Index:   35
//       float deltaTime;               // Index:   35.y
//       float depthReprojectScale;     // Index:   35.z
//       float depthReprojectBias;      // Index:   35.w
//       uint shadowViewType;           // Index:   36
//       float normalDepthBias;         // Index:   36.y
//       float noNormalAA;              // Index:   36.z
//       float noNormalFromAlpha;       // Index:   36.w
//       float noOpaqueTransparency;    // Index:   37
//       float translucentAmount;       // Index:   37.y
//       uint framePhase;               // Index:   37.z
//       float cameraAmbientExposure;   // Index:   37.w
//       float fxExposure;              // Index:   38
//       float fxAmbientExposure;       // Index:   38.y
//       uint checkerboardPhase;        // Index:   38.z
//       float sparkleIntensityScale;   // Index:   38.w
//
//   } resourceTables__viewData;        // Index:    0-38             Components:   156
                                        // Textures:  t6-t7
//
// }
//
// Resource bind info for resourceTables__modelData.instancingBuffer
// {
//
//   struct InstancingData
//   {
//
//       float4x3 transformCurrentFrame;// Index:    0
//       float4x3 transformPrevFrame;   // Index:    3
//       uint vertColOffset;            // Index:    6
//       uint packedLodFadeDisplacementTurbulenceIdx;// Index:    6.y
//
//   } $Element;                        // Index:    0-6.y            Components:    26
//
// }
//
// Resource bind info for resourceTables__modelData.turbulenceDataThis
// {
//
//   struct TurbulenceData
//   {
//
//       float3 leafSwayLag;            // Index:    0
//       float bend;                    // Index:    0.w
//       float3 offsetA;                // Index:    1
//       float useWindAtPivot;          // Index:    1.w
//       float3 offsetB;                // Index:    2
//       float phaseLerp;               // Index:    2.w
//       float3 densityLevel;           // Index:    3
//       float stretchiness;            // Index:    3.w
//       float3 densityLevelBlend;      // Index:    4
//       float treeBend;                // Index:    4.w
//       float3 rotationPivotMask;      // Index:    5
//       float treeHeight;              // Index:    5.w
//       float3 treeSway;               // Index:    6
//       float treeWeightScale;         // Index:    6.w
//       float3 leafSway;               // Index:    7
//       float leafWiggleScale;         // Index:    7.w
//       float windAdjustScale;         // Index:    8
//       float swaySpring;              // Index:    8.y
//       float swayDamping;             // Index:    8.z
//       float pad0;                    // Index:    8.w
//       int _debugNoNoise;             // Index:    9
//       float _debugUserParam1;        // Index:    9.y
//       float _debugUserParam2;        // Index:    9.z
//       float padDebug;                // Index:    9.w
//
//   } $Element;                        // Index:    0-9              Components:    40
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// resourceTables__viewData__smpLinear    sampler      NA          NA    1        1
// resourceTables__modelData.instancingBuffer    texture  struct         r/o    2        1
// resourceTables__modelData.turbulenceDataThis    texture  struct         r/o    3        1
// resourceTables__viewData.texTurbulence    texture  float3          3d    7        1
// ConstBuf__modelData               cbuffer      NA          NA    1        1
// ConstBuf__viewData                cbuffer      NA          NA    2        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// POSITION                 0   xyzw        0     NONE   float   xyzw
// TEXCOORD                 0   xy          1     NONE   float   xy
// NORMAL                   0   xyz         2     NONE   float   xyz
// TANGENT                  0   xyzw        3     NONE   float
// TEXCOORD                 4   xyzw        4     NONE    uint   xyzw
// TEXCOORD                 7   xyzw        5     NONE   float   xyzw
// SV_InstanceID            0   x           6   INSTID    uint   x
// SV_VertexID              0   x           7   VERTID    uint   x
//
//
// Output signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION              0   xyzw        0      POS   float   xyzw
// VERT_ID                  0   x           1     NONE    uint   x
// TEXCOORD                 0   xy          2     NONE   float   xy
// NORMAL                   0   xyz         3     NONE   float   xyz
// TEXCOORD                 5   xyzw        4     NONE   float   xyzw
//
vs_5_0
dcl_globalFlags refactoringAllowed
dcl_constantbuffer cb1[6], immediateIndexed
dcl_constantbuffer cb2[37], immediateIndexed
dcl_sampler s1, mode_default
dcl_resource_structured t2, 104
dcl_resource_structured t3, 160
dcl_resource_texture3d (float,float,float,float) t7
dcl_input v0.xyzw
dcl_input v1.xy
dcl_input v2.xyz
dcl_input v4.xyzw
dcl_input v5.xyzw
dcl_input_sgv v6.x, instance_id
dcl_input_sgv v7.x, vertex_id
dcl_output_siv o0.xyzw, position
dcl_output o1.x
dcl_output o2.xy
dcl_output o3.xyz
dcl_output o4.xyzw
dcl_temps 50
dcl_resource_texture2d (float,float,float,float) t125
ld_indexable(texture2d)(float,float,float,float) r40.xyzw, l(0, 0, 0, 0), t125.xyzw
mad r0.xyz, v0.xyzx, cb1[4].xyzx, cb1[5].xyzx
dp3 r0.w, r0.xyzx, r0.xyzx
sqrt r0.w, r0.w
iadd r1.x, v6.x, cb1[1].y
ld_structured_indexable(structured_buffer, stride=104)(mixed,mixed,mixed,mixed) r1.y, r1.x, l(100), t2.xxxx
and r1.z, r1.y, l(0x0000ffff)
bfi o1.x, l(24), l(0), v7.x, r1.y
ld_structured_indexable(structured_buffer, stride=160)(mixed,mixed,mixed,mixed) r2.xyzw, r1.z, l(80), t3.xyzw
div r0.w, r0.w, r2.w
log r0.w, r0.w
ld_structured_indexable(structured_buffer, stride=160)(mixed,mixed,mixed,mixed) r3.xyzw, r1.z, l(64), t3.xyzw
mul r0.w, r0.w, r3.w
exp r0.w, r0.w
ld_structured_indexable(structured_buffer, stride=160)(mixed,mixed,mixed,mixed) r4.xyzw, r1.z, l(96), t3.xyzw
mul r0.w, r0.w, r4.w
ld_structured_indexable(structured_buffer, stride=160)(mixed,mixed,mixed,mixed) r5.xyzw, r1.z, l(0), t3.xyzw
ld_structured_indexable(structured_buffer, stride=160)(mixed,mixed,mixed,mixed) r6.xyzw, r1.z, l(112), t3.xyzw
mad r5.xyz, -r0.wwww, r5.xyzx, r6.xyzx
ld_structured_indexable(structured_buffer, stride=104)(mixed,mixed,mixed,mixed) r7.xyzw, r1.x, l(0), t2.xyzw
dp3 r6.x, r0.xyzx, r7.xyzx
ld_structured_indexable(structured_buffer, stride=104)(mixed,mixed,mixed,mixed) r8.xyzw, r1.x, l(16), t2.xyzw
ld_structured_indexable(structured_buffer, stride=104)(mixed,mixed,mixed,mixed) r9.xyzw, r1.x, l(32), t2.xyzw
dp3 r6.y, r0.xyzx, r8.xyzx
dp3 r6.z, r0.xyzx, r9.xyzx
mov r10.x, r7.w
mov r10.y, r8.w
mov r10.z, r9.w
add r1.xyw, r6.xyxz, r10.xyxz
log r2.w, v5.w
mul r2.w, r2.w, r5.w
exp r2.w, r2.w
mad r5.xyz, r5.xyzx, r2.wwww, r1.xywx
mul r2.w, r6.w, r2.w
min r3.w, r2.z, r2.y
min r3.w, r2.x, r3.w
mad r0.xyz, v5.xyzx, r3.wwww, r0.xyzx
mul r6.xyz, r2.xyzx, r0.xyzx
mov r6.w, v0.w
dp4 r0.x, r6.xyzw, r7.xyzw
dp4 r0.y, r6.xyzw, r8.xyzw
dp4 r0.z, r6.xyzw, r9.xyzw
add r6.xyz, -r5.xyzx, r0.xyzx
ld_structured_indexable(structured_buffer, stride=160)(mixed,mixed,mixed,mixed) r11.xyzw, r1.z, l(16), t3.xyzw
mad r6.xyz, r11.wwww, r6.xyzx, r5.xyzx
ld_structured_indexable(structured_buffer, stride=160)(mixed,mixed,mixed,mixed) r12.xyzw, r1.z, l(48), t3.xyzw
ld_structured_indexable(structured_buffer, stride=160)(mixed,mixed,mixed,mixed) r13.xyzw, r1.z, l(32), t3.xyzw
mad r14.xyz, r6.xyzx, r12.xyzx, r11.xyzx
sample_l_indexable(texture3d)(float,float,float,float) r14.xyz, r14.xyzx, t7.xyzw, s1, l(0.000000)
mad r14.xyz, r14.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mad r15.xyz, r3.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
mul r14.xyz, r14.xyzx, r15.xyzx
mul r16.xyz, r6.xyzx, r12.xyzx
mad r6.xyz, r6.xyzx, r12.xyzx, r13.xyzx
sample_l_indexable(texture3d)(float,float,float,float) r6.xyz, r6.xyzx, t7.xyzw, s1, l(0.000000)
mad r6.xyz, r6.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mul r6.xyz, r6.xyzx, r15.xyzx
mad r12.xyz, r16.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r11.xyzx
sample_l_indexable(texture3d)(float,float,float,float) r12.xyz, r12.xyzx, t7.xyzw, s1, l(0.000000)
mad r12.xyz, r12.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mul r15.xyz, r3.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
mad r12.xyz, r15.xyzx, r12.xyzx, r14.xyzx
mad r14.xyz, r16.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), r11.xyzx
mad r11.xyz, r16.xyzx, l(0.250000, 0.250000, 0.250000, 0.000000), r11.xyzx
sample_l_indexable(texture3d)(float,float,float,float) r11.xyz, r11.xyzx, t7.xyzw, s1, l(0.000000)
mad r11.xyz, r11.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r14.xyz, r14.xyzx, t7.xyzw, s1, l(0.000000)
mad r14.xyz, r14.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mad r17.xyz, r3.xyzx, l(-0.500000, -0.500000, -0.500000, 0.000000), l(1.000000, 1.000000, 1.000000, 0.000000)
mad r3.xyz, r3.xyzx, l(-0.500000, -0.500000, -0.500000, 0.000000), l(0.500000, 0.500000, 0.500000, 0.000000)
mad r12.xyz, r17.xyzx, r14.xyzx, r12.xyzx
mad r11.xyz, r3.xyzx, r11.xyzx, r12.xyzx
mul r11.xyz, r11.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000)
mad r12.xyz, r16.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), r13.xyzx
sample_l_indexable(texture3d)(float,float,float,float) r12.xyz, r12.xyzx, t7.xyzw, s1, l(0.000000)
mad r12.xyz, r12.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mad r6.xyz, r15.xyzx, r12.xyzx, r6.xyzx
mad r12.xyz, r16.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), r13.xyzx
mad r13.xyz, r16.xyzx, l(0.250000, 0.250000, 0.250000, 0.000000), r13.xyzx
sample_l_indexable(texture3d)(float,float,float,float) r13.xyz, r13.xyzx, t7.xyzw, s1, l(0.000000)
mad r13.xyz, r13.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
sample_l_indexable(texture3d)(float,float,float,float) r12.xyz, r12.xyzx, t7.xyzw, s1, l(0.000000)
mad r12.xyz, r12.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
mad r6.xyz, r17.xyzx, r12.xyzx, r6.xyzx
mad r3.xyz, r3.xyzx, r13.xyzx, r6.xyzx
mad r3.xyz, r3.xyzx, l(0.500000, 0.500000, 0.500000, 0.000000), -r11.xyzx
mad r3.xyz, r13.wwww, r3.xyzx, r11.xyzx
mad r3.xyz, r2.wwww, r3.xyzx, r5.xyzx
add r5.xyz, -r0.xyzx, r3.xyzx
dp3 r1.z, r5.xyzx, r5.xyzx
max r1.z, r1.z, l(1.000000012E-007)
rsq r1.z, r1.z
mul r5.xyz, r1.zzzz, r5.xyzx
add r1.xyz, -r0.xyzx, r1.xywx
dp3 r1.x, r1.xyzx, r1.xyzx
sqrt r1.x, r1.x
mad r0.xyz, r1.xxxx, r5.xyzx, r0.xyzx
add r1.xyz, -r0.xyzx, r3.xyzx
mad r0.xyz, r12.wwww, r1.xyzx, r0.xyzx
max r1.x, r2.z, r2.y
max r1.x, r1.x, r2.x
lt r1.x, l(-0.100000), r1.x
movc r0.xyz, r1.xxxx, r0.xyzx, r3.xyzx
mad r1.xyz, r0.wwww, r4.xyzx, r0.xyzx
add r0.xyz, -r10.xyzx, r0.xyzx
dp3 r0.x, r0.xyzx, r0.xyzx
sqrt r0.x, r0.x
add r0.yzw, -r10.xxyz, r1.xxyz
dp3 r1.x, r0.yzwy, r0.yzwy
rsq r1.x, r1.x
mul r0.yzw, r0.yyzw, r1.xxxx
mad r0.xyz, r0.yzwy, r0.xxxx, r10.xyzx
add r1.xyz, r0.xyzx, -cb2[31].xyzx
dp3 r0.w, r1.xyzx, r1.xyzx
rsq r0.w, r0.w
mul r1.xyz, r0.wwww, r1.xyzx
mad r2.xyz, v2.xyzx, l(2.000000, 2.000000, 2.000000, 0.000000), l(-1.000000, -1.000000, -1.000000, 0.000000)
dp3 r3.x, r2.xyzx, r7.xyzx
dp3 r3.y, r2.xyzx, r8.xyzx
dp3 r3.z, r2.xyzx, r9.xyzx
dp3 r0.w, r3.xyzx, r3.xyzx
rsq r0.w, r0.w
mul r2.xyz, r0.wwww, r3.xyzx
dp3_sat r0.w, -r1.xyzx, r2.xyzx
add r0.w, -r0.w, l(1.000000)
mul r3.xyz, r2.xyzx, cb2[36].yyyy
mov o3.xyz, r2.xyzx
mad r2.xyz, -r3.xyzx, r0.wwww, r0.xyzx
mad r1.xyz, r1.xyzx, cb2[30].wwww, r2.xyzx
add r2.xyz, r2.xyzx, cb2[30].xyzx
ieq r0.w, l(1), cb2[36].x
movc r1.xyz, r0.wwww, r2.xyzx, r1.xyzx
movc r0.xyz, cb2[36].xxxx, r1.xyzx, r0.xyzx
mov r0.w, l(1.000000)
dp4 r42.x, r0.xyzw, cb2[16].xyzw
dp4 r42.y, r0.xyzw, cb2[17].xyzw
dp4 r42.z, r0.xyzw, cb2[18].xyzw
dp4 r42.w, r0.xyzw, cb2[19].xyzw
ieq r41.x, r42.w, l(1.0)
ieq r41.y, l(1), cb2[36].x
if_nz r41.x
if_z r41.y
add r40.w, r42.w, -r40.y
mad r42.x, r40.x, r40.w, r42.x
endif
endif
mov o0.xyzw, r42.xyzw
mov o2.xy, v1.xyxx
utof r0.xyzw, v4.xyzw
mul o4.xyzw, r0.xyzw, l(0.00392156886, 0.00392156886, 0.00392156886, 0.00392156886)
ret
// Approximately 141 instruction slots used
