This file is best viewed in a markdown editor/viewer. You can also view it here https://github.com/HyperspaceMadness/Mega_Bezel with correct formatting
If you are wondering **"What is this thing?"** here's a little overview sharing our ideas around the project and some of the Mega Bezel features:
[RetroArch – Introducing the Mega Bezel Reflection Shader – Libretro](https://www.libretro.com/index.php/retroarch-introducing-the-mega-bezel/)
Find more conversation about the shader here on the Libretro forum:
This shader package is meant for you to experiment with and make your own creations if you like. Try adjusting the shader parameters to change the look, as most things are adjustable for personal taste. The base package is now part of the Libretro repo but there will also be updates coming periodically which may get a pre-release here before they go into the main repo.
----------------------------------------
----------------------------------------
----------------------------------------
**Installation - VERY IMPORTANT, PLEASE READ**
----------------------------------------
***
**INSTALLING THE BASE MEGA BEZEL PACKAGE**
* **You MUST use Retroarch Version 1.9.8 or Later** (It will fail to load on earlier versions)
* **If you want to use the default Mega Bezel included with Retroarch:**
* Use **Online Updater -> Update Slang Shaders** to update the shaders, the shaders will be added here `Retroarch/shaders/shaders_slang/bezel/Mega_Bezel`
* **If you want to install from a zipped release from the link above:**
* If the `shaders/shaders_slang/bezel/Mega_Bezel` folder exists delete it
* Inside the .zip is a **Mega_Bezel** folder. Copy the Mega_Bezel folder into your `Retroarch/shaders/shaders_slang/bezel` folder (If the bezel folder isn't there you can create it)
* The final path to the Mega bezel should be `Retroarch/shaders/shaders_slang/bezel/Mega_Bezel`
***
**RETROARCH SETUP**
* Set video driver to **Vulkan** or GLCore if Vulkan is not available
* It will run in **GLCore** but seems faster in **Vulkan**
* **D3D IS NOT RECOMMENDED**. If it loads in D3D it has a VERY slow load time
* Restart Retroarch after changing the video driver
* Open the **Settings** Menu and Set:
* **User Interface / Show Advanced Settings** to **ON**
* **Video / Scaling / Aspect Ratio** to **Full**
* This will match your monitor aspect aspect ratio
* **Video / Scaling / Integer Scale** to **OFF**
* **Video / Output / Video Rotation** to **Normal**
* **Core / Allow Rotation** to **OFF** -- **Important for FB Neo**
* For **FB Neo**
* Turn **vertical mode OFF** in **Quick Menu > Core Options** if it was previously turned on
* **Do all of this before loading content**
* For **FB Neo**
* **If your game is vertical** set the Rotate CRT Tube parameter to 1. If it is now upside down set Flip Core Image Vertical and Horizontal to 1
***
**LOADING AND SAVING PRESETS**
* **Load a preset** in the shaders menu.
* The Mega Bezel shader presets are found in: `Retroarch/shaders/shaders_slang/bezel/Mega_Bezel/Presets`
* **IMPORTANT!!** When saving a preset make sure you have the **Simple Presets** feature set to **ON**
* This will save a preset with a reference to the preset you loaded plus whatever parameter changes you made
* This will keep your presets loading properly when the shader updates in the future
***
**EDITING PRESETS**
* You can then open this Simple Preset file and add other parameter adjustments or set textures as you see fit. E.G. add the following lines to change the background image:
*`BackgroundImage = "MyImage.jpg"`
*`BackgroundVertImage = "MyImage.jpg"`
* Or change the path indicated on the `#reference` line to point at a different base preset
The Mega Bezel is coded and maintained by HyperspaceMadness, but leverages some amazing work from the community.
HyperspaceMadness@outlook.com
----------------------------------------
----------------------------------------
----------------------------------------
**Acknowledgements**
----------------------------------------
***
**THANKS TO THE SHADER WRITERS!**
The Mega Bezel sits atop the shoulders of giants and uses a number of amazing shaders written by shader writers from the community:
* Guest.r (Guest-Advanced crt shader)
* EasyMode
* CGCW (LCD Grid)
* DariusG (GDV Mini)
* Dogway (Grade Color Correction)
* Hyllian (SGENDPT)
* Aliaspider (GTU)
* Sp00kyFox (MDAPT & ScaleFX)
* Trogglemonkey (Royale 3D Curvature)
* Flyguy (Text Shadertoy)
* Special thanks to Hunterk for porting a number of these and helping me with his expertise along the way!
***
**THANKS TO THE MEGA BEZEL GRAPHICS ARTISTS PUSHING THE FEATURES DURING DEVELOPMENT**
The Mega Bezel would also not have gotten to this level of sophistication without some intense feedback from graphics experts pushing the features and finding the holes.
*@Duimon
*@TheNamec
*@Soqueroeu
***
**THANKS TO THE GRAPHICS ARTISTS WHO HAVE INSPIRED US**
And of course I probably would never have started this without seeing the great overlays created previously
* In general there is a background image which fills the screen, then the scaled down game screen with an automatically generated bezel image is drawn on top.
* The bezel and frame you see around the screen is auto generated and not part of the background image
* Additional Images can be layered on top to augment the look
* Most things can be changed to your taste with adjustment of the parameters, so try them out!
- All in the root of the Presets folder use @guest.r's awesome Guest-Advanced CRT shader which is considered the default CRT shader for the Mega Bezel, the only exception to this is the POTATO preset which uses GDV-MINI for performance reasons.
* Presets which show a blurry reflection in the area around the screen
* **Image Layering**
* Layering of multiple images for background, crt housing, LEDs etc
* Includes the Automatically Generated Bezel & Frame
* **Tube Effects**
* Tube Static Reflection Highlight
* Tube Diffuse Image & Shadow
* Tube Colored Gel
* **Basic Pre-CRT shader chain**
* Fewest passes, but still Includes Grade
* **Full Pre-CRT shader chain**
* Includes Grade, MDAPT & GTU
* **Full + ScaleFx Upres Pre-CRT shader chain**
* Includes Full Pre-CRT shader chain and ScaleFX
* Resolution is tripled in the middle of the chain for ScaleFX
* This requires increased GPU processing
**Preset Folders in Mega_Bezel / Presets**
* **Base_CRT_Presets**
- Includes presets using different crt shaders for the screen
- Look here for the LCD preset
* **Base_CRT_Presets_DREZ**
* Presets which set the resolution at the beginning of the shader chain
* Good for reducing the resolution from the core to native res to use with a crt shader
* Helps working with cores which are outputting at increased internal resolution, e.g. 2x, 4k this creates antialiasing at native res which comes from rendering at a higher resolution then reducing it
**HSM Examples Package (Separate additional Package from Mega Bezel)**
* **Community_CRT_Variations**
- Presets with crt settings created by community members
- Thanks to some of our community members who's settings appear here including @BendBombBoom, @NesGuy, @Sonkun&@Cyberlab
* **Variations**
* These presets are simple presets referencing one of the presets in the Mega_Bezel folder
* They reference the original preset then have adjusted parameters or texture paths
* **Experimental**
* **Use at your own risk!**
* These presets are work in progress and are likely to be moved, renamed, dissappear or change behavior at any future release
* If Retroarch crashes this is usually the core resolution overwhelming the graphics card's resources. This more often happens when you are using a SMOOTH-ADV preset. Try a STD, or STD-DREZ preset to reduce the resolution used within the shader chain
* When the shader works in imageviewer, but doesn’t work when using a core, it is probably related to the core
* If you still have difficulties loading the shader with a specific core, try updating the core
* If you still have difficulties download a new separate version of Retroarch and try it there. Sometimes problems lurk in a random config file which is very hard to track down
* **To see errors** coming from Retroarch you need to set up your logging settings:
* These last steps allow you to have a short log for us to look at
* If you want to see the errors as they happen you can set Log to File to OFF and an additional console window will open when retroarch opens and show errors here
* If the screen changes size when loading a game or switching between different parts of the game e.g. gameplay vs cinematic, this is because of the interaction between the different resolutions the core is outputting on different screens and the shader's integer scale or automatic aspect ratio settings.
* **How to fix**
* **Make sure Integer Scale is OFF in the RetroArch Video Settings**
* **If BOTH the HEIGHT and WIDTH of the screen size are changing size**
* Set the Integer scale mode to OFF (0)
* **If ONLY the WIDTH of the screen is changing size** (the HEIGHT stays constant)
* Set the Aspect Ratio Type to Explicit (1) This will use the explicit aspect ratio number instead of guessing
* If this solves your issue please consider posting on the thread at the top of this document the issue you had so that we can improve the auto aspect ratio in the future
**If you see artifacts on the game image like circles or interference patterns**
* These artifacts which look like round swirls or circles like tree trunk rings are called a Moiré patterns which happen when a high frequency pattern is sampled at a lower frequency - https://en.wikipedia.org/wiki/Moiré_pattern
* The base cause of the Moiré pattern is usually the curvature in combination with visible scanlines
* **How to fix**
* Set **CRT Curvature Scale Multiplier** to 0, This will remove curvature from the game image but leave everything else the same
* Set **Integer Scale Mode** to 1 or 2
* Make the game screen larger with either **Viewport Zoom** or **Non-Integer Scale %**
* When reporting a bug, it is VERY IMPORTANT to post images of the issue. This helps communicate the issue better & quicker, even if the issue seems simple.
* Please make sure you are using the latest version of the shader
* If you are having any issues with the shader not loading or crashing please include a log. See the readme for how to get a log
* If loading the shader crashes Retroarch your core internal res is probably too high. Try native resolution or one of the DREZ presets which reduce the resolution in the first pass.
* **Gamma In (Game Embedded Gamma - Gamma Space to Linear) Def 2.4** - The gamma adjustment applied to take the core image and bring it into linear color space. Gamma to Linear Space Decode
* **Gamma Out (Electron Gun Gamma - Linear to Gamma Space) Def 2.4** - The gamma adjustment applied to the CRT shader's linear color output to bring it back into a gamma corrected space. Also known as Linear to Gamma Space Encode
* **Post CRT Brightness** - Brightness adjustment on the CRT color output (Applied in Linear Color Space)
* **Post CRT Brightness Affects Grade Black Level** - As this value is reduced the brightness adjustment amount will be reduced on the black level. So if you set it to a low value there will be almost no increase in brightness on the areas which were black before the black level adjustment.
- **1 - ShortAxis Integer Scale On** - for the viewport (monitor) in landscape mode this is the vertical axis, If the screen/tube aspect ratio is vertical then integer scale is used for both horizontal and vertical axes
- **2 - Integer Scale on both axes**
- **Preset is for Monitor Portrait Mode (Smaller CRT Screen)**
- Turn on if this preset is to be used on monitor in Portrait mode, E.G. if your physical monitor is turned vertical
**[ INTEGER SCALE ]:**
- **Base Integer Scale Max Height %**
- The maximum screen height of the default integer scale when integer scale is on
- **Integer Scale Multiple Offset**
- Adjusts the size of the screen by increasing the multiple of the core resolution (on both axes) when using integer scale, to make the screen larger or smaller
- **Integer Scale Multiple Offset Long Axis**
- Adds an additional multiple offset but for only the long axis, with a horizontal aspect ratio this is the horizontal axis
**[ NON-INTEGER SCALE PERCENT ]:**
- **Non-Integer Scale %**
- If integer scale isn't used, this sets the vertical size of the vertical percentage of the full viewport. The default is 82.97 which corresponds to an exact integer scale of 224p content
Cropping removes parts of the game image at the edges of the screen which were never meant to be seen. Negative values can add more black area at the edges of the screen
- **2 - 2D-CYL** - Simplest and fastest curvature but for a cylindrical tube like a Trinitron
- **3 - 3D Sphere** - Geometric projection from the surface of a sphere to the viewport - Same as CRT-Royale
- **4 - 3D Sphere with adjusted corner mapping** --- Very similar to #1
- **5 - 3D Cylindrical Mapping** --- Vertically flat curvature like a Trinitron, e.g. PVM or BVM
- **2D Curvature on Long Axis** - Curvature multiple on long axis, for a horizontal aspect ratio this is the horizontal axis
- **2D Curvature on Short Axis** - Curvature multiple on short axis, for a horizontal aspect ratio this is the vertical axis
- **3D Radius** - Radius for the sphere the 3D projection is done on, values from 1-4 then to be useful
- **3D View Distance** - This is the distance of the virtual camera from the Sphere
- **3D Tilt Angle Y** - Vertical Tilt, with split screen this will tilt both screens towards or away from the center
- **CRT Curvature Scale Multiplier** - This allows reducing the curvature of the crt image to reduce Moire artifacts or just give a flat look while the bezel and black edge stays the same
Adds a shadow on top of the tube diffuse image and colored gel
- **Tube Shadow Image - OFF | ON**
- Apply a shadow on the top of the tube diffuse coloring
- **Opacity**
- Opacity of the shadow, and how dark the shadow is
- **Position X**
- **Position Y**
- **Scale X**
- **Scale Y** - Scales shadow from the top of the tube
- **Curvature Scale** - How much curvature is applied to the shadow, more curvature has the effect of making it look like the light is higher relative to the tube/bezel
- At 100 the reflection fades out as it comes away from the screen, at 0 the reflection does not fade and is full strength everywhere
- **Radial Fade Width**
- The distance away from the sides of the screen where the reflection to completely fades out
- **Radial Fade Height**
- The distance away from the top and bottom of the screen where the reflection to completely fades out
- **Lateral Outer Fade Position**
- When the reflection fades out towards the corners, for example on the bottom bezel the reflection fades out towards the left and right. The position where the fade starts.
- **Lateral Outer Fade Distance**
- For the lateral fade the distance for it to fade out
- **Viewport Vignette (For Glass Presets)**
- Adds a vignette over the entire viewport to darken the areas as it goes towards the edges used to darken the reflection in the glass preset
- How much noise seen in the reflection, gives the effect of the scattered reflection of a slightly textured surface
- **Noise Samples (0 for OFF)**
- How many samples taken for the effect, more samples the smoother the effect, fewer samples makes the surface look more like it has little bumps in it
- **Sample Distance**
- What is the farthest distance away from the point being drawn where the scattered sample come from
- **ADD** - Adds the image as if it is being projected on top
- **MULTIPLY** - Image is applied as if it was a colored plastic film
- **Opacity**
- **Brightness**
- **Show Background**
- **0 - UNDER SCREEN** - Background is applied under the screen and Since the default blend mode is additive this gives a backdrop effect. E.G. Tron's Deadly Discs
- **1 - OVER SCREEN** - Background is applied on top of the screen
Layer order adjusts the order in which the layers are composited or "layered" on top of each other, the index 0 is the bottom or base layer. If two layers are given the same index they fall back to being composited in the order seen here.
- ***3 - Multiply Blending*** *- Applied to as a darkening of what is underneath*
- ***Source Matte Color***
- *Controls how the image transparency is interpreted based on the matte color used when the image was stored (what color the image is blended with in the transparent area).*
- *Used to remove white fringing on the edges around transparent areas.*
- ***0 - Black***
- *The color in the transparent area was black*. Technically this is called Premultiplied alpha.
- ***1 - White***
- *The color in the transparent area was white, Use this if you see white fringing on the edges of the transparency where there should be none.*
- ***2 - None***
- *The image was not blended with any matte color, the only transparency info is in the alpha channel*
- **Mask** - Mask the layer with the area inside the:
- ***0 - ALL*** *- Whole viewport*
- ***1 - Screen*** *- Illuminated area of the tube*
- ***2 - Tube*** *- Inside the tube
- ***2 - Bezel and Inward*** *- Bezel and inward*
- ***3 - Bezel*** *- Bezel
- ***4 - Bezel +*** *- Bezel and outward*
- ***5 - Frame*** *- Frame
- ***6 - Frame +*** *- Frame and outward*
- ***7 - Background*** *- Outside the frame*
- ***Cutout Mask***
- ***0 - OFF*** *- Don't cut out any area of the layer*
- ***1 - ON*** *- Make the area of the layer INSIDE the cutout mask transparent*
- ***2 - Invert*** *- Make the area of the layer OUTSIDE the cutout mask transparent*
- ***Dual Screen Visibility*** - Where to show this image
- ***0 - Show on Both Screens***
- ***1 - Show only on Screen 1***
- ***2 - Show only on Screen 2***
- ***Inherit Scale***
- *Controls if this layer follows another layer's scaling*
- ***Full / Fullscreen*** *- Scale to the viewport*
- ***Tube*** *- Follow the Tube Scaling*
- ***Bezel*** *- Follow the Bezel Scaling*
- ***Background*** *- Follow the Background Image Scaling*
- ***Bezel Image*** *- Follow the Bezel Image Scaling*
- ***Decal Image*** *- Follow the Decal Image Scaling*
- ***Top Extra Image*** *- Follow the Top Extra Image Scaling*
- **Zoom FULL Scale Mode**
- When the layer Inherit Scale is in **FULL** mode this controls if the layer should scale with the global zoom or not, this defaults to ON
- Controls how the texture's aspect reacts to the inherited scale
- **0 - INHERIT FROM SCALE MODE** --- The texture's aspect will scale as what it follows is scaled
- **1 - USE TEXURE ASPECT** --- The layer's image stays the same aspect as what it follows is scaled
- **Example:**
- If the scale mode was **Tube** and **USE TEXURE ASPECT** was on, regardless of the aspect of the tube the layer's image would stay the aspect ratio of the image.
- If it is set to **INHERIT FROM SCALE MODE** the layer's image will react to the tube's changes in horizontal aspect.*
- **Image Fill Mode**
- **0 - STRETCH** --- Stretch the image across the whole area
- **1 - SPLIT HORIZONTAL** --- Splits the image in the center and slide it out until it hits the outer edge