/*----------------------------------------------------------------------------------------------
        _____                                                                    _____
        ( ___ )                                                                  ( ___ )
        |   |~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|   |
        |   | ██╗   ██╗███╗   ██╗██╗███████╗ ██████╗ ██████╗ ███╗   ███╗███████╗ |   |
        |   | ██║   ██║████╗  ██║██║██╔════╝██╔═══██╗██╔══██╗████╗ ████║██╔════╝ |   |
        |   | ██║   ██║██╔██╗ ██║██║█████╗  ██║   ██║██████╔╝██╔████╔██║███████╗ |   |
        |   | ██║   ██║██║╚██╗██║██║██╔══╝  ██║   ██║██╔══██╗██║╚██╔╝██║╚════██║ |   |
        |   | ╚██████╔╝██║ ╚████║██║██║     ╚██████╔╝██║  ██║██║ ╚═╝ ██║███████║ |   |
        |   |  ╚═════╝ ╚═╝  ╚═══╝╚═╝╚═╝      ╚═════╝ ╚═╝  ╚═╝╚═╝     ╚═╝╚══════╝ |   |
        |___|~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|___|
        (_____)                              (thanks to isuewo and SpacEagle17)  (_____)

---------------------------------------------------------------------------------------------*/
uniform bool isRightHanded = true;
uniform int blockEntityId;

uniform int entityId;
uniform int frameCounter;
uniform int heldBlockLightValue;
uniform int heldBlockLightValue2;
uniform int heldItemId;
uniform int heldItemId2;
uniform int isEyeInWater;
uniform int moonPhase;
uniform int worldTime;
uniform int worldDay;
uniform int bedrockLevel;
uniform int hideGUI;

uniform float aspectRatio;
uniform float blindness;

uniform float darknessFactor;
uniform float darknessLightFactor;
uniform float maxBlindnessDarkness;
uniform float eyeAltitude;
uniform float frameTime;
uniform float centerDepthSmooth;
#ifdef FROZEN_TIME
float frameTimeCounter = 10;
#else
uniform float frameTimeCounter;
#endif
uniform float far;
uniform float near;
uniform float nightVision;
uniform float rainStrength;
uniform float screenBrightness;
uniform float viewHeight;
uniform float viewWidth;
uniform float wetness;
uniform float sunAngle;

uniform ivec2 atlasSize;
uniform ivec2 eyeBrightness;
uniform ivec2 eyeBrightnessSmooth;

uniform vec3 cameraPosition;
uniform vec3 fogColor;
uniform vec3 previousCameraPosition;
uniform vec3 skyColor;
uniform vec3 eyePosition;

uniform vec4 entityColor;
// uniform vec4 lightningBoltPosition = vec4(0);

uniform mat4 gbufferModelView;
uniform mat4 gbufferModelViewInverse;
uniform mat4 gbufferPreviousModelView;
uniform mat4 gbufferPreviousProjection;
uniform mat4 shadowModelView;
uniform mat4 shadowModelViewInverse;
uniform mat4 shadowProjection;
uniform mat4 shadowProjectionInverse;

uniform sampler2D colortex0;
uniform sampler2D colortex1;
uniform sampler2D colortex2;
uniform sampler2D colortex3;
uniform sampler2D colortex4;
uniform sampler2D colortex5;
uniform sampler2D colortex6;
uniform sampler2D colortex7;
uniform sampler2D colortex8;
uniform sampler2D colortex9;
uniform sampler2D colortex10;
uniform sampler2D colortex11;

uniform sampler2D colortex12;

uniform sampler2D colortex13;
uniform sampler2D colortex14;

uniform sampler3D colortex15;
uniform sampler2D depthtex0;

#ifndef altnoise
uniform sampler2D depthtex1;
#endif

uniform sampler2D depthtex2;
uniform sampler2D gaux1;
uniform sampler2D gaux2;
uniform sampler2D gaux3;
uniform sampler2D gaux4;
uniform sampler2D normals;

uniform sampler2D noisetex;
uniform sampler2D specular;
uniform sampler2D tex;
uniform sampler2D texture;

uniform sampler2D shadowcolor0;
uniform sampler2D shadowcolor1;

uniform sampler2DShadow shadow;
uniform sampler2DShadow shadowtex1;

uniform sampler2D shadowtex0;
uniform mat4 shadowModelViewProjection;

#ifdef DISTANT_HORIZONS
uniform int dhRenderDistance;
uniform float dhNearPlane;
uniform float dhFarPlane;
uniform mat4 dhProjection;
uniform mat4 dhProjectionInverse;
uniform mat4 dhPreviousProjection;

uniform sampler2D dhDepthTex;
uniform sampler2D dhDepthTex0;
uniform sampler2D dhDepthTex1;
#endif

#if !defined DH_TERRAIN && !defined DH_WATER
uniform mat4 gbufferProjection;
uniform mat4 gbufferProjectionInverse;
#else
mat4 gbufferProjection = dhProjection;
mat4 gbufferProjectionInverse = dhProjectionInverse;
#endif

#ifdef LPV_ENABLED
uniform usampler1D texBlockData;
uniform sampler3D texLpv1;
uniform sampler3D texLpv2;
uniform int renderStage;
uniform int currentRenderedItemId;
#endif
#if defined IS_IRIS
uniform float cloudHeight;
uniform int heightLimit;
uniform float cloudTime;

#else
float cloudTime = frameTimeCounter;

float cloudHeight = 192;
int heightLimit = 320;
#endif
/*-----------------------------------------------------------------------------
  ___ _   _ ___ _____ ___  __  __   _   _ _  _ ___ ___ ___  ___ __  __ ___
 / __| | | / __|_   _/ _ \|  \/  | | | | | \| |_ _| __/ _ \| _ \  \/  / __|
| (__| |_| \__ \ | || (_) | |\/| | | |_| | .` || || _| (_) |   / |\/| \__ \
 \___|\___/|___/ |_| \___/|_|  |_|  \___/|_|\_|___|_| \___/|_|_\_|  |_|___/

-----------------------------------------------------------------------------*/

uniform int framemod8;

uniform float scaledTime;
uniform float velocity;
uniform float starter;
uniform float rainFactor;
uniform float inVanillaEnd = 1.0;
uniform float shaderStart;

uniform float isSneaking = 1.0;
uniform float isSprinting = 0.0;

uniform float normWT;
uniform float nightblend5Inv;
uniform float lightningFlashOptifine;
uniform float nightblend5;
uniform float rainStrengthInv;
uniform float shadowblend;
uniform float biasblend;
uniform float biasblend2;
uniform float sunElevation;
uniform float sunpow;
uniform float lightRadiance;
uniform float nightblendShadows;
uniform float SunsetMult;

uniform vec2 viewResolution;
uniform vec2 viewSize;
uniform vec2 texelSize;
uniform vec3 sunVec;
uniform vec3 sunPosWorld;
uniform vec3 moonPosWorld;
uniform vec3 sunLight;
uniform vec3 sunLightAlt;
uniform vec3 lightPos;
uniform vec3 shadowPosWorld;
uniform vec3 atmosphereUp;
