[![Open in Visual Studio Code](https://open.vscode.dev/badges/open-in-vscode.svg)](https://github.com/HyperspaceMadness/Mega_Bezel)
----------------------------------------
Licensing
----------------------------------------
Licensing of package components which incude licensing are LGPL3
----------------------------------------
What does it do?
----------------------------------------
* Adds an auto-generated bezel around the screen with reflection
* Enable easier use of bezels and more "natural" presentation
* Ease of use for screen scaling and automatic aspect ratio with existing shaders
* Provide a consistent set of enhanced features wrapped around the core crt shaders
* Layering images to add artwork and visual effects
----------------------------------------
How does it work?
----------------------------------------
* 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!
----------------------------------------
Installation
----------------------------------------
* **You MUST use Retroarch Version 1.9.8 or Later** (It will fail to load on earlier versions)
* The most flexible and most resource hungry start with index 0.
* As the name's index number increases the performance of the preset improves but but flexibility decreases.
* The presets with the lowest performance requirements are:
* MBZ__3__STD__GDV-MINI - This has a Dynamic Bezel and Reflections
* MBZ__4__STD-NO-REFLECT__GDV-MINI - This Has a Dynamic Bezel but No Reflections
* MBZ__5__POTATO__GDV-MINI - This has no Dynamic Bezel and no Reflections
----------------------------------------
Presets in Mega_Bezel / Presets
----------------------------------------
- All in the root of the Presets folder use @guest.r's awesome Guest-DrVenom-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 %**
* Use a higher resolution monitor if available
----------------------------------------
---
Bug Reporting
----------------------------------------
- **Please post images** of the issue if it is at all visual in nature. This often helps communicate the issue better & quicker, **even if the issue seems simple**.
- Please make sure to **Use the latest version of the shader** when reporting bugs
- If you are having any issues with the shader not loading or crashing please include a log (See above for turning on logs)
* **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
- **Scale Aspect (Mode)**
- 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
- **Scale** --- *Scales image layer equally in both directions*