//P5S cel shading PS 7 (title screen characters).
// ---- Created with 3Dmigoto v1.3.16 on Sun Mar 27 13:28:21 2022

cbuffer _Globals : register(b0)
{
  float fThick : packoffset(c0);
  float4 clEdge : packoffset(c1);
}

Texture2D<float4> sInputTex : register(t0);
Texture2D<float4> sAutoHDRScaleExposure : register(t1);


// 3Dmigoto declarations
#define cmp -
Texture1D<float4> IniParams : register(t120);
Texture2D<float4> StereoParams : register(t125);


void main(
  float4 v0 : SV_Position0,
  out float4 o0 : SV_Target0)
{
  float4 r0;
  uint4 bitmask, uiDest;
  float4 fDest;
  
  float4 iniparams6 = IniParams.Load(int2(6,0));
  if (iniparams6.x==1) {
    discard;
  }
  
  r0.xy = (int2)v0.xy;
  r0.zw = float2(0,0);
  r0.x = sInputTex.Load(r0.xyz).x;
  r0.x = fThick + -r0.x;
  r0.x = saturate(0.5 + r0.x);
  o0.w = clEdge.w * r0.x;
  r0.x = sAutoHDRScaleExposure.Load(float4(0,0,0,0)).x;
  r0.x = 1 / r0.x;
  r0.x = min(3.40282306e+038, r0.x);
  o0.xyz = clEdge.xyz * r0.xxx;
  return;
}

/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//   using 3Dmigoto v1.3.16 on Sun Mar 27 13:28:21 2022
//
//
// Buffer Definitions:
//
// cbuffer $Globals
// {
//
//   float fThick;                      // Offset:    0 Size:     4
//   float4 clEdge;                     // Offset:   16 Size:    16
//
// }
//
//
// Resource Bindings:
//
// Name                                 Type  Format         Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// sInputTex                         texture  float4          2d    0        1
// sAutoHDRScaleExposure             texture  float4          2d    1        1
// $Globals                          cbuffer      NA          NA    0        1
//
//
//
// Input signature:
//
// Name                 Index   Mask Register SysValue  Format   Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_Position              0   xyzw        0      POS   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_resource_texture2d (float,float,float,float) t0
dcl_resource_texture2d (float,float,float,float) t1
dcl_input_ps_siv linear noperspective v0.xy, position
dcl_output o0.xyzw
dcl_temps 1
ftoi r0.xy, v0.xyxx
mov r0.zw, l(0,0,0,0)
ld_indexable(texture2d)(float,float,float,float) r0.x, r0.xyzw, t0.xyzw
add r0.x, -r0.x, cb0[0].x
add_sat r0.x, r0.x, l(0.500000)
mul o0.w, r0.x, cb0[1].w
ld_indexable(texture2d)(float,float,float,float) r0.x, l(0, 0, 0, 0), t1.xyzw
div r0.x, l(1.000000, 1.000000, 1.000000, 1.000000), r0.x
min r0.x, r0.x, l(340282306073709650000000000000000000000.000000)
mul o0.xyz, r0.xxxx, cb0[1].xyzx
ret
// Approximately 11 instruction slots used

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
