#define FULL_RT_REFLECTIONS // OFF: only surfaces with high smoothness values will render reflections. ON: Allow rougher surfaces to render reflections (higher computational cost). This can cause big slowdowns with lots of semi-rough surfaces!
#define REFLECTION_TRACE_LENGTH 90 // The maximum ray length of ray traced reflections. Higher values result in reflections tracing farther into the world at a higher cost. Lower values can can cause leaking in large indoor areas! [60 90 120 150]
#define DIFFUSE_TRACE_LENGTH 60 // The maximum ray length of path traced diffuse GI. Higher values result in more accurate lighting, taking farther away surfaces into account, at a higher cost. Lower values can cause leaking in large indoor areas! [60 80 100 120]
#define GI_RESPONSIVENESS 3 // How well GI responds to lighting changes over time. Lower settings sacrifice responsiveness for improved stability, better noise reduction, and higher detail in GI. [0 1 2 3]
#define GI_SCREEN_SPACE_TRACING // Allows for surfaces in screen-space to cast indirect shadows and lighting that wouldn't otherwise (mobs, grass, etc.). If enabled, can leave weird ghosty shadows when GI Responsiveness is low.
#define GI_FILTER_QUALITY 1 // Quality of GI filter. [0 1]
#define REFLECTION_SCREEN_SPACE_TRACING // Allows for surfaces in screen-space to show up in reflections that wouldn't othwerise (mobs, grass, etc.). 

const float VEuHgNkYWB = 0.00006;
const float RpkYnrplgT = 0.08 * pow(1.5, 3 - GI_RESPONSIVENESS);
const float stsnCtKdLM = 0.0;
const float KlpdgVFXTx = 1.28 * 1.5 * 1;
const float DcwmUwqobm = 0.5 * 1.5;
const float qCwgzTWkLX = 2.0;
const float KABuxcMtkh = 2.525;
const float UXxVifBHkD = 2.0;
const float nzBhhdpOfe = 1.0;


const int btFrPSprwb = 2048;



 int sQqqFIeezy(float v)
 {
   return int(floor(v));
 }
 int guaOZnjjlN(int v)
 {
   return v-sQqqFIeezy(mod(float(v),2.))-0;
 }
 int uSBBhagcMA(int v)
 {
   return v-sQqqFIeezy(mod(float(v),2.))-1;
 }
 int EzKMZYBlJk()
 {
   ivec2 f=ivec2(viewWidth,viewHeight);
   int v=f.x*f.y;
   return guaOZnjjlN(sQqqFIeezy(floor(pow(float(v),.333333))));
 }
 int taMQjRYtnp()
 {
   ivec2 f=ivec2(btFrPSprwb,btFrPSprwb);
   int v=f.x*f.y;
   return uSBBhagcMA(sQqqFIeezy(floor(pow(float(v),.333333))));
 }
 vec3 xehrkSGArh(vec2 v)
 {
   ivec2 f=ivec2(viewWidth,viewHeight);
   int W=f.x*f.y,y=EzKMZYBlJk();
   ivec2 V=ivec2(v.x*f.x,v.y*f.y);
   float x=float(V.y/y),r=float(int(V.x+mod(f.x*x,y))/y);
   r+=floor(f.x*x/y);
   vec3 i=vec3(0.,0.,r);
   i.x=mod(V.x+mod(f.x*x,y),y);
   i.y=mod(V.y,y);
   i.xyz=floor(i.xyz);
   i/=y;
   i.xyz=i.xzy;
   return i;
 }
 vec2 JMMZJKJYbG(vec3 f)
 {
   ivec2 v=ivec2(viewWidth,viewHeight);
   int y=EzKMZYBlJk();
   vec3 i=f.xzy*y;
   i=floor(i+1e-05);
   float x=i.z;
   vec2 r;
   r.x=mod(i.x+x*y,v.x);
   float V=i.x+x*y;
   r.y=i.y+floor(V/v.x)*y;
   r+=.5;
   r/=v;
   return r;
 }
 vec3 NePyAApOgn(vec2 v)
 {
   vec2 i=v;
   i.xy/=.5;
   ivec2 f=ivec2(btFrPSprwb,btFrPSprwb);
   int V=f.x*f.y,y=taMQjRYtnp();
   ivec2 x=ivec2(i.x*f.x,i.y*f.y);
   float W=float(x.y/y),r=float(int(x.x+mod(f.x*W,y))/y);
   r+=floor(f.x*W/y);
   vec3 G=vec3(0.,0.,r);
   G.x=mod(x.x+mod(f.x*W,y),y);
   G.y=mod(x.y,y);
   G.xyz=floor(G.xyz);
   G/=y;
   G.xyz=G.xzy;
   return G;
 }
 vec2 iaHpXwuYWT(vec3 f,int y)
 {
   f=clamp(f,vec3(0.),vec3(1.));
   ivec2 v=ivec2(btFrPSprwb,btFrPSprwb);
   vec3 i=f.xzy*y;
   i=floor(i+1e-05);
   float x=i.z;
   vec2 r;
   r.x=mod(i.x+x*y,v.x);
   float V=i.x+x*y;
   r.y=i.y+floor(V/v.x)*y;
   r+=.5;
   r/=v;
   r.xy*=.5;
   return r;
 }
 vec2 iaHpXwuYWT(vec3 v)
 {
   int V=taMQjRYtnp();
   return iaHpXwuYWT(v,taMQjRYtnp());
 }
 vec3 ILFqHXVeln(vec3 v,int y)
 {
   return v*=1./y,v=v+vec3(.5),v=clamp(v,vec3(0.),vec3(1.)),v;
 }
 vec3 cOIxxHmKYc(vec3 v,int y)
 {
   return v*=1./y,v=v+vec3(.5),v;
 }
 vec3 ILFqHXVeln(vec3 v)
 {
   return ILFqHXVeln(v,taMQjRYtnp());
 }
 vec3 cOIxxHmKYc(vec3 v)
 {
   return cOIxxHmKYc(v,taMQjRYtnp());
 }
 vec3 MyOAgTGgLA(vec3 v)
 {
   int y=taMQjRYtnp();
   v=v-vec3(.5);
   v*=y;
   return v;
 }
 vec3 HYYOmtxeNa(vec3 v)
 {
   int y=EzKMZYBlJk();
   v*=1./y;
   v=v+vec3(.5);
   v=clamp(v,vec3(0.),vec3(1.));
   return v;
 }
 vec3 XOJSZBuxYe(vec3 v)
 {
   int y=EzKMZYBlJk();
   v=v-vec3(.5);
   v*=y;
   return v;
 }struct tmVkZlOvfU{float EEYwzbmFmS;float iZHIyueBza;float piQTAOsNKv;float ucDwsULpwe;vec3 nJnYDFKgVy;};
 vec4 rwDeqcrEVL(tmVkZlOvfU v)
 {
   vec4 i;
   i.x=v.EEYwzbmFmS;
   v.nJnYDFKgVy=pow(v.nJnYDFKgVy,vec3(.25));
   i.y=PackTwo16BitTo32Bit(v.nJnYDFKgVy.x,v.iZHIyueBza);
   i.z=PackTwo16BitTo32Bit(v.nJnYDFKgVy.y,v.piQTAOsNKv);
   i.w=PackTwo16BitTo32Bit(v.nJnYDFKgVy.z,v.ucDwsULpwe);
   return i;
 }
 tmVkZlOvfU wHnZOImuGb(vec4 v)
 {
   tmVkZlOvfU i;
   vec2 f=UnpackTwo16BitFrom32Bit(v.y),y=UnpackTwo16BitFrom32Bit(v.z),G=UnpackTwo16BitFrom32Bit(v.w);
   i.EEYwzbmFmS=v.x;
   i.iZHIyueBza=f.y;
   i.piQTAOsNKv=y.y;
   i.ucDwsULpwe=G.y;
   i.nJnYDFKgVy=pow(vec3(f.x,y.x,G.x),vec3(4.));
   return i;
 }
 tmVkZlOvfU cDZTwilxvP(vec2 v)
 {
   vec2 y=1./vec2(viewWidth,viewHeight),x=vec2(viewWidth,viewHeight);
   v=(floor(v*x)+.5)*y;
   return wHnZOImuGb(texture2DLod(gaux2,v,0));
 }
 float KljOtRwpZm(float v,float y)
 {
   #ifdef FULL_RT_REFLECTIONS
   float f=clamp(pow(v,.125)+y,0.,1.);
   #ifdef PHYSICALLY_BASED_MAX_ROUGHNESS
   f=max(f,.25);
   #endif
   return f;
   #else
   return clamp(v*10.0-7.0,0.0,1.0);
   #endif
 };