slang-shaders/bezel/Mega_Bezel/shaders/HyperspaceMadness/hsm/common/hsm-globals.inc
2022-06-24 20:06:45 -04:00

864 lines
24 KiB
SourcePawn

/*
Mega Bezel - Creates a graphic treatment for the game play area to give a retro feel
Copyright (C) 2019-2021 HyperspaceMadness - HyperspaceMadness@outlook.com
Incorporates much great feedback from the libretro forum, and thanks
to Hunterk who helped me get started
See more at the libretro forum
https://forums.libretro.com/t/hsm-mega-bezel-reflection-shader-feedback-and-updates
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
layout(std140, set = 0, binding = 0) uniform UBO
{
mat4 MVP;
vec4 SourceSize;
vec4 OriginalSize;
vec4 CorePassSize;
vec4 CorePassFeedbackSize;
vec4 OutputSize;
vec4 FinalViewportSize;
vec4 NegativeCropAddedPassSize;
vec4 DerezedPassSize;
int FrameDirection;
uint FrameCount;
float HSM_RESOLUTION_DEBUG_ON;
float HSM_CACHE_GRAPHICS_ON;
float HSM_CACHE_UPDATE_INDICATOR_MODE;
// Graphics Brightness
float HSM_GLOBAL_GRAPHICS_BRIGHTNESS;
float HSM_STATIC_LAYERS_GAMMA;
// Night Lighting
float HSM_AMBIENT_LIGHTING_OPACITY;
float HSM_AMBIENT_LIGHTING_HUE;
float HSM_AMBIENT_LIGHTING_SATURATION;
float HSM_AMBIENT_LIGHTING_VALUE;
float HSM_AMBIENT_LIGHTING_SCALE;
float HSM_AMBIENT_LIGHTING_ROTATE;
float HSM_AMBIENT_LIGHTING_MIRROR_HORZ;
float HSM_AMBIENT_LIGHTING_SCALE_MODE;
float HSM_AMBIENT_LIGHTING_DITHERING_SAMPLES;
// Zoom & Pan
float HSM_VIEWPORT_ZOOM;
float HSM_VIEWPORT_POSITION_X;
float HSM_VIEWPORT_POSITION_Y;
float HSM_VIEWPORT_ZOOM_MASK;
// FLIP & ROTATE
float HSM_FLIP_VIEWPORT_VERTICAL;
float HSM_FLIP_VIEWPORT_HORIZONTAL;
float HSM_FLIP_CORE_VERTICAL;
float HSM_FLIP_CORE_HORIZONTAL;
float HSM_ROTATE_CORE_IMAGE;
// ASPECT RATIO
float HSM_ASPECT_RATIO_ORIENTATION;
float HSM_ASPECT_RATIO_MODE;
float HSM_ASPECT_RATIO_EXPLICIT;
// SCALING
float HSM_INT_SCALE_MODE;
float HSM_INT_SCALE_MULTIPLE_OFFSET;
float HSM_INT_SCALE_MULTIPLE_OFFSET_LONG;
float HSM_INT_SCALE_MAX_HEIGHT;
float HSM_VERTICAL_PRESET;
float HSM_NON_INTEGER_SCALE;
float HSM_USE_PHYSICAL_SIZE_FOR_NON_INTEGER;
float HSM_PHYSICAL_MONITOR_ASPECT_RATIO;
float HSM_PHYSICAL_MONITOR_DIAGONAL_SIZE;
float HSM_PHYSICAL_SIM_TUBE_DIAGONAL_SIZE;
// Extended Scale
float HSM_USE_IMAGE_FOR_PLACEMENT;
float HSM_PLACEMENT_IMAGE_USE_HORIZONTAL;
float HSM_PLACEMENT_IMAGE_MODE;
float HSM_NON_INTEGER_SCALE_OFFSET;
float HSM_USE_SNAP_TO_CLOSEST_INT_SCALE;
float HSM_SNAP_TO_CLOSEST_INT_SCALE_TOLERANCE;
// Position
float HSM_SCREEN_POSITION_X;
float HSM_SCREEN_POSITION_Y;
// CROPPING
float HSM_CROP_MODE;
float HSM_CROP_PERCENT_ZOOM;
float HSM_CROP_PERCENT_TOP;
float HSM_CROP_PERCENT_BOTTOM;
float HSM_CROP_PERCENT_LEFT;
float HSM_CROP_PERCENT_RIGHT;
float HSM_CROP_BLACK_THRESHOLD;
// SCANLINES
float HSM_SCANLINE_DIRECTION;
// CORE RES SAMPLING
float HSM_CORE_RES_SAMPLING_MULT_SCANLINE_DIR;
float HSM_DOWNSAMPLE_BLUR_SCANLINE_DIR;
float HSM_CORE_RES_SAMPLING_MULT_OPPOSITE_DIR;
float HSM_DOWNSAMPLE_BLUR_OPPOSITE_DIR;
// INTERLACING
float HSM_INTERLACE_TRIGGER_RES;
float HSM_INTERLACE_MODE;
float HSM_INTERLACE_EFFECT_SMOOTHNESS_INTERS;
float HSM_INTERLACE_SCANLINE_EFFECT;
float iscans;
// FAKE SCANLINES
float HSM_FAKE_SCANLINE_MODE;
float HSM_FAKE_SCANLINE_OPACITY;
float HSM_FAKE_SCANLINE_RES_MODE;
float HSM_FAKE_SCANLINE_RES;
float HSM_FAKE_SCANLINE_INT_SCALE;
float HSM_FAKE_SCANLINE_ROLL;
float HSM_FAKE_SCANLINE_CURVATURE;
float HSM_FAKE_SCANLINE_BRIGHTNESS_CUTOFF;
// DUAL SCREEN
float HSM_DUALSCREEN_MODE;
float HSM_DUALSCREEN_CORE_IMAGE_SPLIT_MODE;
float HSM_DUALSCREEN_CORE_IMAGE_SWAP_SCREENS;
float HSM_DUALSCREEN_CORE_IMAGE_SPLIT_OFFSET;
float HSM_DUALSCREEN_VIEWPORT_SPLIT_LOCATION;
float HSM_DUALSCREEN_SHIFT_POSITION_WITH_SCALE;
float HSM_DUALSCREEN_POSITION_OFFSET_BETWEEN_SCREENS;
float HSM_2ND_SCREEN_ASPECT_RATIO_MODE;
float HSM_2ND_SCREEN_INDEPENDENT_SCALE;
float HSM_2ND_SCREEN_SCALE_OFFSET;
float HSM_2ND_SCREEN_POS_X;
float HSM_2ND_SCREEN_POS_Y;
float HSM_2ND_SCREEN_CROP_PERCENT_ZOOM;
float HSM_2ND_SCREEN_CROP_PERCENT_TOP;
float HSM_2ND_SCREEN_CROP_PERCENT_BOTTOM;
float HSM_2ND_SCREEN_CROP_PERCENT_LEFT;
float HSM_2ND_SCREEN_CROP_PERCENT_RIGHT;
// CURVATURE
float HSM_CURVATURE_MODE;
float HSM_CURVATURE_2D_SCALE_LONG_AXIS;
float HSM_CURVATURE_2D_SCALE_SHORT_AXIS;
// float HSM_CURVATURE_2D_SHAPE;
float HSM_CURVATURE_3D_RADIUS;
float HSM_CURVATURE_3D_VIEW_DIST;
float HSM_CURVATURE_3D_TILT_ANGLE_X;
float HSM_CURVATURE_3D_TILT_ANGLE_Y;
float HSM_CRT_CURVATURE_SCALE;
// ANTI-FLICKER
float HSM_ANTI_FLICKER_ON;
float HSM_ANTI_FLICKER_THRESHOLD;
// CRT vs ORIGINAL A/B TESTING
float HSM_AB_COMPARE_SHOW_MODE;
float HSM_AB_COMPARE_AREA;
float HSM_AB_COMPARE_FREEZE_CRT_TUBE;
float HSM_AB_COMPARE_FREEZE_GRAPHICS;
float HSM_AB_COMPARE_SPLIT_AREA;
float HSM_AB_COMPARE_SPLIT_POSITION;
// CRT Screen
// These names are inconsistent with the general naming on purpose
// They match the namse in Guest's shader
float HSM_CRT_BLEND_MODE;
float HSM_CRT_BLEND_AMOUNT;
float HSM_CRT_SCREEN_BLEND_MODE;
// Screen Vignette
float HSM_SCREEN_VIGNETTE_ON;
float HSM_SCREEN_VIGNETTE_DUALSCREEN_VIS_MODE;
float HSM_SCREEN_VIGNETTE_STRENGTH;
float HSM_SCREEN_VIGNETTE_POWER;
float HSM_SCREEN_VIGNETTE_IN_REFLECTION;
// Monochrome
float HSM_MONOCHROME_MODE;
float HSM_MONOCHROME_BRIGHTNESS;
float HSM_MONOCHROME_GAMMA;
float HSM_MONOCHROME_HUE_OFFSET;
float HSM_MONOCHROME_SATURATION;
float HSM_MONOCHROME_DUALSCREEN_VIS_MODE;
// Reflection Transform
float HSM_SCREEN_REFLECTION_RENDER_ON;
float HSM_SCREEN_REFLECTION_SCALE;
float HSM_SCREEN_REFLECTION_POS_X;
float HSM_SCREEN_REFLECTION_POS_Y;
// float HSM_PHOSPHOR_PERSISTENCE_BLEND;
// float HSM_PHOSPHOR_PERSISTENCE_RED;
// float HSM_PHOSPHOR_PERSISTENCE_GREEN;
// float HSM_PHOSPHOR_PERSISTENCE_BLUE;
// TUBE IMAGES
float HSM_TUBE_DIFFUSE_MODE;
float HSM_TUBE_DIFFUSE_IMAGE_DUALSCREEN_VIS_MODE;
float HSM_TUBE_DIFFUSE_OPACITY;
float HSM_TUBE_DIFFUSE_IMAGE_HUE;
float HSM_TUBE_DIFFUSE_IMAGE_COLORIZE_ON;
float HSM_TUBE_DIFFUSE_IMAGE_SATURATION;
float HSM_TUBE_DIFFUSE_IMAGE_BRIGHTNESS;
float HSM_TUBE_DIFFUSE_IMAGE_GAMMA;
float HSM_TUBE_DIFFUSE_IMAGE_AMBIENT_LIGHTING;
float HSM_TUBE_DIFFUSE_IMAGE_SCALE;
float HSM_TUBE_DIFFUSE_IMAGE_SCALE_X;
float HSM_TUBE_EMPTY_THICKNESS;
float HSM_TUBE_EMPTY_THICKNESS_X_SCALE;
float HSM_TUBE_COLORED_GEL_IMAGE_ON;
float HSM_TUBE_COLORED_GEL_IMAGE_DUALSCREEN_VIS_MODE;
float HSM_TUBE_COLORED_GEL_IMAGE_MULTIPLY_AMOUNT;
float HSM_TUBE_COLORED_GEL_IMAGE_NORMAL_AMOUNT;
float HSM_TUBE_COLORED_GEL_IMAGE_NORMAL_BRIGHTNESS;
float HSM_TUBE_COLORED_GEL_IMAGE_TRANSPARENCY_THRESHOLD;
float HSM_TUBE_COLORED_GEL_IMAGE_ADDITIVE_AMOUNT;
float HSM_SHOW_CRT_ON_TOP_OF_COLORED_GEL;
float HSM_TUBE_SHADOW_IMAGE_ON;
float HSM_TUBE_SHADOW_IMAGE_OPACITY;
float HSM_TUBE_SHADOW_IMAGE_SCALE_X;
float HSM_TUBE_SHADOW_IMAGE_SCALE_Y;
float HSM_TUBE_SHADOW_IMAGE_POS_X;
float HSM_TUBE_SHADOW_IMAGE_POS_Y;
float HSM_TUBE_SHADOW_CURVATURE_SCALE;
float HSM_TUBE_COLORED_GEL_IMAGE_AMBIENT_LIGHTING;
float HSM_TUBE_COLORED_GEL_IMAGE_SCALE;
float HSM_TUBE_COLORED_GEL_IMAGE_FLIP_HORIZONTAL;
float HSM_TUBE_COLORED_GEL_IMAGE_FLIP_VERTICAL;
// TUBE STATIC REFLECTION
float HSM_TUBE_STATIC_REFLECTION_IMAGE_ON;
float HSM_TUBE_STATIC_REFLECTION_IMAGE_DUALSCREEN_VIS_MODE;
float HSM_TUBE_STATIC_REFLECTION_IMAGE_OPACITY;
float HSM_TUBE_STATIC_REFLECTION_IMAGE_AMBIENT_LIGHTING;
float HSM_TUBE_STATIC_REFLECTION_IMAGE_SCALE;
float HSM_TUBE_STATIC_REFLECTION_IMAGE_DITHERING_SAMPLES;
// SCREEN BLACK EDGE
float HSM_GLOBAL_CORNER_RADIUS;
float HSM_TUBE_BLACK_EDGE_CORNER_RADIUS_SCALE;
float HSM_TUBE_BLACK_EDGE_SHARPNESS;
float HSM_TUBE_BLACK_EDGE_CURVATURE_SCALE;
float HSM_TUBE_BLACK_EDGE_THICKNESS;
float HSM_TUBE_BLACK_EDGE_THICKNESS_X_SCALE;
float HSM_TUBE_BLACK_EDGE_LAYERING_MODE;
// Bezel Independent Scale
float HSM_BZL_USE_INDEPENDENT_SCALE;
float HSM_BZL_INDEPENDENT_SCALE;
float HSM_BZL_USE_INDEPENDENT_CURVATURE;
float HSM_BZL_INDEPENDENT_CURVATURE_SCALE_LONG_AXIS;
float HSM_BZL_INDEPENDENT_CURVATURE_SCALE_SHORT_AXIS;
// Bezel General
float HSM_BZL_OPACITY;
float HSM_BZL_BLEND_MODE;
float HSM_BZL_WIDTH;
float HSM_BZL_HEIGHT;
float HSM_BZL_SCALE_OFFSET;
float HSM_BZL_INNER_CURVATURE_SCALE;
float HSM_BZL_INNER_CORNER_RADIUS_SCALE;
// Bezel Params not in Screen Scale
float HSM_BZL_OUTER_CURVATURE_SCALE;
float HSM_BZL_INNER_EDGE_THICKNESS;
float HSM_BZL_INNER_EDGE_SHARPNESS;
float HSM_BZL_OUTER_CORNER_RADIUS_SCALE;
float HSM_BZL_INNER_EDGE_SHADOW;
// Generated Bezel
float HSM_BZL_COLOR_HUE;
float HSM_BZL_COLOR_SATURATION;
float HSM_BZL_COLOR_VALUE;
float HSM_BZL_NOISE;
float HSM_BZL_BRIGHTNESS;
float HSM_BZL_HIGHLIGHT;
float HSM_BZL_AMBIENT_LIGHTING_MULTIPLIER;
// Generated Frame
float HSM_FRM_USE_INDEPENDENT_COLOR;
float HSM_FRM_COLOR_HUE;
float HSM_FRM_COLOR_SATURATION;
float HSM_FRM_COLOR_VALUE;
float HSM_FRM_NOISE;
float HSM_FRM_OUTER_CURVATURE_SCALE;
float HSM_FRM_THICKNESS;
float HSM_FRM_THICKNESS_SCALE_X;
float HSM_FRM_OUTER_POS_Y;
float HSM_FRM_INNER_EDGE_THICKNESS;
float HSM_FRM_OUTER_EDGE_THICKNESS;
float HSM_FRM_OUTER_EDGE_SHADING;
float HSM_FRM_OUTER_CORNER_RADIUS;
float HSM_BZL_OUTER_POSITION_Y;
float HSM_FRM_SHADOW_OPACITY;
float HSM_FRM_SHADOW_WIDTH;
// Corner
float HSM_REFLECT_CORNER_FADE;
float HSM_REFLECT_CORNER_INNER_SPREAD;
float HSM_REFLECT_CORNER_OUTER_SPREAD;
float HSM_REFLECT_CORNER_ROTATION_OFFSET_TOP;
float HSM_REFLECT_CORNER_ROTATION_OFFSET_BOTTOM;
float HSM_REFLECT_CORNER_SPREAD_FALLOFF;
float HSM_REFLECT_CORNER_FADE_DISTANCE;
// Reflection
float HSM_REFLECT_GLOBAL_AMOUNT;
float HSM_REFLECT_GLOBAL_GAMMA_ADJUST;
float HSM_REFLECT_BEZEL_INNER_EDGE_AMOUNT;
float HSM_REFLECT_BEZEL_INNER_EDGE_FULLSCREEN_GLOW;
float HSM_REFLECT_FRAME_INNER_EDGE_AMOUNT;
float HSM_REFLECT_FRAME_INNER_EDGE_SHARPNESS;
float HSM_REFLECT_DIRECT_AMOUNT;
float HSM_REFLECT_DIFFUSED_AMOUNT;
float HSM_REFLECT_FULLSCREEN_GLOW;
float HSM_REFLECT_FULLSCREEN_GLOW_GAMMA;
float HSM_REFLECT_FADE_AMOUNT;
float HSM_REFLECT_RADIAL_FADE_WIDTH;
float HSM_REFLECT_RADIAL_FADE_HEIGHT;
float HSM_REFLECT_LATERAL_OUTER_FADE_POSITION;
float HSM_REFLECT_LATERAL_OUTER_FADE_DISTANCE;
float HSM_REFLECT_VIGNETTE_AMOUNT;
float HSM_REFLECT_VIGNETTE_SIZE;
float HSM_REFLECT_NOISE_AMOUNT;
float HSM_REFLECT_NOISE_SAMPLES;
float HSM_REFLECT_NOISE_SAMPLE_DISTANCE;
// Blur Stuff
float HSM_REFLECT_BLUR_NUM_SAMPLES;
float HSM_REFLECT_BLUR_FALLOFF_DISTANCE;
float HSM_REFLECT_BLUR_MIN;
float HSM_REFLECT_BLUR_MAX;
float HSM_REFLECT_MASK_IMG_AMOUNT;
float HSM_REFLECT_IS_LAST_PASS;
float HSM_GLASS_BORDER_ON;
float HSM_POTATO_SHOW_BG_OVER_SCREEN;
float HSM_STANDARD_DECAL_SCALE_WITH_FRAME;
float HSM_STANDARD_TOP_SCALE_WITH_FRAME;
// Layer Order
float HSM_BG_LAYER_ORDER;
float HSM_VIEWPORT_VIGNETTE_LAYER_ORDER;
float HSM_CRT_LAYER_ORDER;
float HSM_DEVICE_LAYER_ORDER;
float HSM_CAB_GLASS_LAYER_ORDER;
float HSM_DECAL_LAYER_ORDER;
float HSM_LED_LAYER_ORDER;
float HSM_TOP_LAYER_ORDER;
// Cutout
float HSM_CUTOUT_ASPECT_MODE;
float HSM_CUTOUT_EXPLICIT_ASPECT;
float HSM_CUTOUT_SCALE_MODE;
float HSM_CUTOUT_SCALE_FULL_WITH_ZOOM;
float HSM_CUTOUT_KEEP_ASPECT;
float HSM_CUTOUT_SCALE;
float HSM_CUTOUT_SCALE_X;
float HSM_CUTOUT_CORNER_RADIUS;
float HSM_CUTOUT_POS_X;
float HSM_CUTOUT_POS_Y;
// Background
float HSM_BG_OPACITY;
float HSM_BG_HUE;
float HSM_BG_COLORIZE_ON;
float HSM_BG_SATURATION;
float HSM_BG_BRIGHTNESS;
float HSM_BG_GAMMA;
float HSM_BG_AMBIENT_LIGHTING_MULTIPLIER;
float HSM_BG_APPLY_AMBIENT_IN_ADD_MODE;
float HSM_BG_BLEND_MODE;
float HSM_BG_SOURCE_MATTE_TYPE;
float HSM_BG_MASK_MODE;
float HSM_BG_CUTOUT_MODE;
float HSM_BG_DUALSCREEN_VIS_MODE;
float HSM_BG_SCALE_MODE;
float HSM_BG_SCALE_FULL_WITH_ZOOM;
float HSM_BG_FILL_MODE;
float HSM_BG_SCALE_KEEP_ASPECT;
float HSM_BG_SCALE;
float HSM_BG_SCALE_X;
float HSM_BG_POS_X;
float HSM_BG_POS_Y;
float HSM_BG_MIRROR_WRAP;
float HSM_BG_MIPMAPPING_BLEND_BIAS;
// Background Vignette
float HSM_VIEWPORT_VIGNETTE_OPACITY;
float HSM_VIEWPORT_VIGNETTE_MASK_MODE;
float HSM_VIEWPORT_VIGNETTE_CUTOUT_MODE;
float HSM_VIEWPORT_VIGNETTE_SCALE_MODE;
float HSM_VIEWPORT_VIGNETTE_SCALE;
float HSM_VIEWPORT_VIGNETTE_SCALE_X;
float HSM_VIEWPORT_VIGNETTE_POS_X;
float HSM_VIEWPORT_VIGNETTE_POS_Y;
// LED
float HSM_LED_OPACITY;
float HSM_LED_HUE;
float HSM_LED_COLORIZE_ON;
float HSM_LED_SATURATION;
float HSM_LED_BRIGHTNESS;
float HSM_LED_GAMMA;
float HSM_LED_AMBIENT_LIGHTING_MULTIPLIER;
float HSM_LED_APPLY_AMBIENT_IN_ADD_MODE;
float HSM_LED_BLEND_MODE;
float HSM_LED_SOURCE_MATTE_TYPE;
float HSM_LED_MASK_MODE;
float HSM_LED_CUTOUT_MODE;
float HSM_LED_DUALSCREEN_VIS_MODE;
float HSM_LED_SCALE_MODE;
float HSM_LED_SCALE_FULL_WITH_ZOOM;
float HSM_LED_SCALE_KEEP_ASPECT;
float HSM_LED_FILL_MODE;
float HSM_LED_SCALE;
float HSM_LED_SCALE_X;
float HSM_LED_POS_X;
float HSM_LED_POS_Y;
float HSM_LED_MIPMAPPING_BLEND_BIAS;
// Device
float HSM_DEVICE_OPACITY;
float HSM_DEVICE_HUE;
float HSM_DEVICE_COLORIZE_ON;
float HSM_DEVICE_SATURATION;
float HSM_DEVICE_BRIGHTNESS;
float HSM_DEVICE_GAMMA;
float HSM_DEVICE_AMBIENT_LIGHTING_MULTIPLIER;
float HSM_DEVICE_APPLY_AMBIENT_IN_ADD_MODE;
float HSM_DEVICE_BLEND_MODE;
float HSM_DEVICE_SOURCE_MATTE_TYPE;
float HSM_DEVICE_MASK_MODE;
float HSM_DEVICE_CUTOUT_MODE;
float HSM_DEVICE_DUALSCREEN_VIS_MODE;
float HSM_DEVICE_SCALE_MODE;
float HSM_DEVICE_SCALE_FULL_WITH_ZOOM;
float HSM_DEVICE_SCALE_KEEP_ASPECT;
float HSM_DEVICE_FILL_MODE;
float HSM_DEVICE_SCALE;
float HSM_DEVICE_SCALE_X;
float HSM_DEVICE_POS_X;
float HSM_DEVICE_POS_Y;
float HSM_DEVICE_COPY_INHERITED_COORD;
float HSM_REFLECT_MASK_SCALE_MODE;
float HSM_DEVICE_MIPMAPPING_BLEND_BIAS;
// Generated Bezel & Frame
float HSM_FRM_OPACITY;
float HSM_FRM_BLEND_MODE;
float HSM_FRM_TEXTURE_OPACITY;
float HSM_FRM_TEXTURE_BLEND_MODE;
// Decal
float HSM_DECAL_OPACITY;
float HSM_DECAL_HUE;
float HSM_DECAL_COLORIZE_ON;
float HSM_DECAL_SATURATION;
float HSM_DECAL_BRIGHTNESS;
float HSM_DECAL_GAMMA;
float HSM_DECAL_AMBIENT_LIGHTING_MULTIPLIER;
float HSM_DECAL_APPLY_AMBIENT_IN_ADD_MODE;
float HSM_DECAL_BLEND_MODE;
float HSM_DECAL_SOURCE_MATTE_TYPE;
float HSM_DECAL_MASK_MODE;
float HSM_DECAL_CUTOUT_MODE;
float HSM_DECAL_DUALSCREEN_VIS_MODE;
float HSM_DECAL_SCALE_MODE;
float HSM_DECAL_SCALE_FULL_WITH_ZOOM;
float HSM_DECAL_SCALE_KEEP_ASPECT;
float HSM_DECAL_FILL_MODE;
float HSM_DECAL_SCALE;
float HSM_DECAL_SCALE_X;
float HSM_DECAL_POS_X;
float HSM_DECAL_POS_Y;
float HSM_DECAL_MIPMAPPING_BLEND_BIAS;
// Cab Glass
float HSM_CAB_GLASS_OPACITY;
float HSM_CAB_GLASS_HUE;
float HSM_CAB_GLASS_COLORIZE_ON;
float HSM_CAB_GLASS_SATURATION;
float HSM_CAB_GLASS_BRIGHTNESS;
float HSM_CAB_GLASS_GAMMA;
float HSM_CAB_GLASS_AMBIENT_LIGHTING_MULTIPLIER;
float HSM_CAB_GLASS_APPLY_AMBIENT_IN_ADD_MODE;
float HSM_CAB_GLASS_BLEND_MODE;
float HSM_CAB_GLASS_SOURCE_MATTE_TYPE;
float HSM_CAB_GLASS_MASK_MODE;
float HSM_CAB_GLASS_CUTOUT_MODE;
float HSM_CAB_GLASS_DUALSCREEN_VIS_MODE;
float HSM_CAB_GLASS_SCALE_MODE;
float HSM_CAB_GLASS_SCALE_FULL_WITH_ZOOM;
float HSM_CAB_GLASS_SCALE_KEEP_ASPECT;
float HSM_CAB_GLASS_FILL_MODE;
float HSM_CAB_GLASS_SCALE;
float HSM_CAB_GLASS_SCALE_X;
float HSM_CAB_GLASS_POS_X;
float HSM_CAB_GLASS_POS_Y;
float HSM_CAB_GLASS_MIPMAPPING_BLEND_BIAS;
// Top Image
float HSM_TOP_OPACITY;
float HSM_TOP_HUE;
float HSM_TOP_COLORIZE_ON;
float HSM_TOP_SATURATION;
float HSM_TOP_BRIGHTNESS;
float HSM_TOP_GAMMA;
float HSM_TOP_AMBIENT_LIGHTING_MULTIPLIER;
float HSM_TOP_APPLY_AMBIENT_IN_ADD_MODE;
float HSM_TOP_BLEND_MODE;
float HSM_TOP_SOURCE_MATTE_TYPE;
float HSM_TOP_MASK_MODE;
float HSM_TOP_CUTOUT_MODE;
float HSM_TOP_DUALSCREEN_VIS_MODE;
float HSM_TOP_SCALE_MODE;
float HSM_TOP_SCALE_FULL_WITH_ZOOM;
float HSM_TOP_SCALE_KEEP_ASPECT;
float HSM_TOP_FILL_MODE;
float HSM_TOP_SCALE;
float HSM_TOP_SCALE_X;
float HSM_TOP_POS_X;
float HSM_TOP_POS_Y;
float HSM_TOP_MIRROR_WRAP;
float HSM_TOP_MIPMAPPING_BLEND_BIAS;
float HSM_RENDER_SIMPLE_MODE;
float HSM_RENDER_SIMPLE_MASK_TYPE;
float HSM_LAYERING_DEBUG_MASK_MODE;
float HSM_INTRO_LOGO_BLEND_MODE;
float HSM_INTRO_LOGO_FLIP_VERTICAL;
float HSM_INTRO_NOISE_BLEND_MODE;
float HSM_INTRO_NOISE_HOLD;
float HSM_INTRO_NOISE_FADE_OUT;
float HSM_INTRO_SOLID_BLACK_HOLD;
float HSM_INTRO_SOLID_BLACK_FADE_OUT;
float HSM_INTRO_SOLID_COLOR_BLEND_MODE;
float HSM_INTRO_LOGO_OVER_SOLID_COLOR;
float HSM_INTRO_LOGO_PLACEMENT;
float HSM_INTRO_LOGO_HEIGHT;
float HSM_INTRO_LOGO_POS_X;
float HSM_INTRO_LOGO_POS_Y;
float HSM_INTRO_WHEN_TO_SHOW;
float HSM_INTRO_SPEED;
float HSM_INTRO_LOGO_WAIT;
float HSM_INTRO_LOGO_FADE_IN;
float HSM_INTRO_LOGO_HOLD;
float HSM_INTRO_LOGO_FADE_OUT;
float HSM_INTRO_SOLID_COLOR_HUE;
float HSM_INTRO_SOLID_COLOR_SAT;
float HSM_INTRO_SOLID_COLOR_VALUE;
float HSM_INTRO_SOLID_COLOR_HOLD;
float HSM_INTRO_SOLID_COLOR_FADE_OUT;
// Guest-Dr-Venom Params
float GAMMA_INPUT;
float gamma_out;
float post_br;
float post_br_affect_black_level;
float glow;
float bloom;
float bloom_dist;
float halation;
float TATE;
float IOS;
float OS;
float BLOOM;
float overscanX;
float overscanY;
float intres;
float prescalex;
float c_shape;
float sborder;
float csize;
float bsize1;
float warpX;
float warpY;
float gamma_c;
float brightboost;
float brightboost1;
float blendMode;
float gsl;
float scanline1;
float scanline2;
float beam_min;
float beam_max;
float beam_size;
float vertmask;
float scans;
float scan_falloff;
float spike;
float ring;
float scangamma;
float rolling_scan;
float h_sharp;
float s_sharp;
float smart_ei;
float ei_limit;
float sth;
float barspeed;
float barintensity;
float bardir;
float shadowMask;
float maskstr;
float mcut;
float masksize;
float maskDark;
float maskLight;
float mask_gamma;
float slotmask;
float slotmask1;
float slotwidth;
float double_slot;
float slotms;
float mclip;
float mshift;
float mask_layout;
float GDV_DECONVERGENCE_ON;
float decons;
float GDV_NOISE_ON;
float addnoised;
float noisetype;
float noiseresd;
float deconrr;
float deconrg;
float deconrb;
float deconrry;
float deconrgy;
float deconrby;
float deconsmooth;
float dctypex;
float dctypey;
// Grade Params
float g_grade_on;
float wp_temperature;
float g_satr;
float g_satg;
float g_satb;
// Grade Afterglow Params
float AS;
float asat;
// Megatron Parameters
float hcrt_h_size;
float hcrt_v_size;
float hcrt_h_cent;
float hcrt_v_cent;
float hcrt_pin_phase;
float hcrt_pin_amp;
} global;
/////////////// DEFINES ///////////////
// Maximum Negative cropping fron each edge
// This means that the pass with the negative crop area
// added needs to have twice this much added in each direction
#define DEFAULT_CRT_GAMMA 2.4
#define DEFAULT_SRGB_GAMMA 2.2
#define DEFAULT_SCREEN_HEIGHT 0.8297
#define DEFAULT_SCREEN_HEIGHT_PORTRAIT_MULTIPLIER (DEFAULT_SCREEN_HEIGHT - 0.4792) / DEFAULT_SCREEN_HEIGHT
#define SHOW_ON_DUALSCREEN_MODE_BOTH 0
#define SHOW_ON_DUALSCREEN_MODE_SCREEN_1 1
#define SHOW_ON_DUALSCREEN_MODE_SCREEN_2 2
#define INHERITED_SCALE_MODE_VIEWPORT 0
#define INHERITED_SCALE_MODE_SCREEN 1
#define INHERITED_SCALE_MODE_BEZEL_OUTSIDE 2
#define INHERITED_SCALE_MODE_BG 3
#define INHERITED_SCALE_MODE_DEVICE 4
#define INHERITED_SCALE_MODE_DECAL 5
#define TEXTURE_ASPECT_MODE_VIEWPORT 0
#define TEXTURE_ASPECT_MODE_EXPLICIT 1
#define TEXTURE_ASPECT_MODE_4_3 2
#define TEXTURE_ASPECT_MODE_3_4 3
#define TEXTURE_ASPECT_MODE_16_9 4
#define TEXTURE_ASPECT_MODE_9_16 5
float NEGATIVE_CROP_EXPAND_MULTIPLIER = 0.5;
float MAX_NEGATIVE_CROP = 0.5;
// In square coordinate space
#define DEFAULT_UNCORRECTED_SCREEN_SCALE vec2(1.10585, 0.8296)
#define DEFAULT_UNCORRECTED_BEZEL_SCALE vec2(1.2050, 0.9110)
float DEFAULT_SCREEN_ASPECT = DEFAULT_UNCORRECTED_SCREEN_SCALE.x / DEFAULT_UNCORRECTED_SCREEN_SCALE.y;
float DEFAULT_BEZEL_ASPECT = DEFAULT_UNCORRECTED_BEZEL_SCALE.x / DEFAULT_UNCORRECTED_BEZEL_SCALE.y;
vec2 DEFAULT_SCREEN_SCALE = vec2(0);
vec2 DEFAULT_BEZEL_SCALE = vec2(0);
#define DEFAULT_SCREEN_CORNER_RADIUS 10
int INFOCACHE_MAX_INDEX = 4;
float BLEND_MODE_OFF = 0;
float BLEND_MODE_NORMAL = 1;
float BLEND_MODE_ADD = 2;
float BLEND_MODE_MULTIPLY = 3;
float SOURCE_MATTE_PREMULTIPLIED = 0;
float SOURCE_MATTE_WHITE = 1;
float SOURCE_MATTE_NONE = 2;
float IMAGE_ASPECT_MODE_INHERIT_ASPECT_SCALE = 0;
float IMAGE_ASPECT_MODE_KEEP_ASPECT = 1;
float FILL_MODE_STRETCH = 0;
float FILL_MODE_SPLIT_FILL_HORIZONTAL = 1;
float FILL_MODE_SPLIT_FILL_VERTICAL = 2;
#define RENDER_SIMPLE_MODE_NONE 0
#define RENDER_SIMPLE_MODE_BLACK_SCREEN 1
#define RENDER_SIMPLE_MODE_BLACK_SCREEN_AND_BG 2
#define RENDER_SIMPLE_MODE_PINK_MASK 3
#define RENDER_SIMPLE_MODE_BLACK_WHITE_MASK 4
#define RENDER_SIMPLE_MASK_TYPE_SCREEN 0
#define RENDER_SIMPLE_MASK_TYPE_TUBE 1
#define RENDER_SIMPLE_MASK_TYPE_BEZEL_AND_FRAME 2
#define RENDER_SIMPLE_MASK_TYPE_BEZEL 3
#define RENDER_SIMPLE_MASK_TYPE_FRAME 4
bool CACHE_INFO_PARAM_SUM_CHANGED = false;
float CURRENT_FRAME_FROM_CACHE_INFO = 0;
float PARAMETER_SUM_SCREEN_SCALE = 0;
float PARAMETER_SUM_SCREEN_SCALE_FEEDBACK = 0;
float PARAMETER_SUM_BEZEL = 0;
float PARAMETER_SUM_BEZEL_FEEDBACK = 0;
float PARAMETER_SUM_IMAGE_LAYERS_1 = 0;
float PARAMETER_SUM_IMAGE_LAYERS_1_FEEDBACK = 0;
float PARAMETER_SUM_IMAGE_LAYERS_2 = 0;
float PARAMETER_SUM_IMAGE_LAYERS_2_FEEDBACK = 0;
float PARAMETER_SUM_IMAGE_LAYERS_3 = 0;
float PARAMETER_SUM_IMAGE_LAYERS_3_FEEDBACK = 0;
float PARAMETER_SUM_IMAGE_LAYERS_4 = 0;
float PARAMETER_SUM_IMAGE_LAYERS_4_FEEDBACK = 0;
float SCREEN_MASK = 0;
float TUBE_MASK = 0;
float BEZEL_MASK = 0;
float INSIDE_BEZEL_MASK = 0;
float OUTSIDE_TUBE_MASK_FOR_IMAGE = 0;
float FRAME_MASK = 0;
float FRAME_MASK_FOR_IMAGE = 0;
float OUTSIDE_BEZEL_MASK = 0;
float OUTSIDE_FRAME_MASK_FOR_IMAGE = 0;
float OUTSIDE_FRAME_MASK = 0;
float CUTOUT_MASK = 0;
float SCREEN_INDEX = 1;
float SCREEN_ASPECT = 1;
vec2 SCREEN_SCALE = vec2(1);
vec2 SCREEN_SCALE_FEEDBACK = vec2(1);
vec2 SCREEN_POS_OFFSET = vec2(0.15);
vec2 SCREEN_POS_OFFSET_FEEDBACK = vec2(0.15);
vec2 SCREEN_SCALE_2ND_SCREEN = vec2(1);
vec2 SCREEN_SCALE_2ND_SCREEN_FEEDBACK = vec2(1);
vec2 SCREEN_POS_OFFSET_2ND_SCREEN = vec2(0.15);
vec2 SCREEN_POS_OFFSET_2ND_SCREEN_FEEDBACK = vec2(0.15);
vec2 VIEWPORT_SCALE = vec2(1);
vec2 VIEWPORT_SCALE_FEEDBACK = vec2(1);
vec2 VIEWPORT_POS = vec2(1);
vec2 VIEWPORT_POS_FEEDBACK = vec2(1);
vec2 TUBE_SCALE = vec2(1);
vec2 TUBE_SCALE_FEEDBACK = vec2(1);
vec2 BLACK_EDGE_SCALE = vec2(1);
vec2 FRAME_SCALE = vec2(1);
vec2 FRAME_SCALE_FEEDBACK = vec2(1);
vec2 BEZEL_OUTSIDE_SCALE = vec2(0.5);
vec2 BACKGROUND_SCALE = vec2(0.5);
vec2 LED_SCALE = vec2(0.5);
vec2 DEVICE_SCALE = vec2(0.5);
vec2 DECAL_SCALE = vec2(0.5);
vec2 CAB_GLASS_SCALE = vec2(0.5);
vec2 TOP_IMAGE_SCALE = vec2(0.5);
float AVERAGE_LUMA = 0;
float USE_VERTICAL_SCANLINES = 0;
vec2 CORE_SIZE = vec2(1);
vec2 CORE_FEEDBACK_SIZE = vec2(2);
vec2 ROTATED_CORE_ORIGINAL_SIZE = vec2(1);
vec2 ROTATED_CORE_PREPPED_SIZE = vec2(1);
vec2 ROTATED_DEREZED_SIZE = vec2(1);
vec2 CROPPED_ROTATED_SIZE_WITH_RES_MULT = vec2(1);
vec2 CROPPED_ROTATED_SIZE = vec2(1);
vec2 SAMPLE_AREA_START_PIXEL_COORD = vec2(1);
vec2 VIEWPORT_UNSCALED_COORD = vec2(0.5);
vec2 SCREEN_COORD = vec2(0.5);
vec2 TUBE_COORD = vec2(0.5);
vec2 BLACK_EDGE_COORD = vec2(0.5);
vec2 BEZEL_OUTSIDE_COORD = vec2(0.5);
vec2 BACKGROUND_COORD = vec2(0.5);
vec2 DEVICE_COORD = vec2(0.5);
vec2 LED_COORD = vec2(0.5);
vec2 DECAL_COORD = vec2(0.5);
vec2 CAB_GLASS_COORD = vec2(0.5);
vec2 TOP_IMAGE_COORD = vec2(0.5);
vec2 SCREEN_CURVED_COORD = vec2(0.5);
vec2 TUBE_CURVED_COORD = vec2(0.5);
vec2 SCREEN_BLACK_EDGE_CURVED_COORD = vec2(0.5);
vec2 BEZEL_OUTSIDE_CURVED_COORD = vec2(0.5);
vec2 FRAME_OUTSIDE_CURVED_COORD = vec2(0.5);
vec2 BACKGROUND_CURVED_COORD = vec2(0.5);
vec2 LED_CURVED_COORD = vec2(0.5);
vec2 DEVICE_CURVED_COORD = vec2(0.5);
vec2 DECAL_CURVED_COORD = vec2(0.5);
vec2 CAB_GLASS_CURVED_COORD = vec2(0.5);
vec2 TOP_IMAGE_CURVED_COORD = vec2(0.5);