Configuration - akgunter/crt-royale-reshade GitHub Wiki
Grille, Slot, or Shadow
Chooses the type of phosphor mask. Important for simulating specific aesthetics or monitors.
Examples:
Grille Mask |
Slot Mask |
Shadow Mask |
Triad Width or Num Triads Across
Chooses the parameter that determines the size of the phosphors in the mask. If you’re looking for a particular aesthetic, Triad Width is easier to use. If you’re simulating a specific model of CRT, it’s easier to use Num Triads Across.
Float between 0.1 and 60.0
Defines the width of each phosphor triad in terms of pixels. Depending on your viewport’s width, some values will cause visual artifacts. This setting only has an effect when Mask Size Param is set to Triad Width.
Integer greater than 0
Defines the number of triads that span the width of the viewport. Depending on your viewport’s width, some values will cause visual artifacts. This setting only has an effect when Mask Size Param is set to Num Triads Across.
Float greater than 0
Scales the aspect ratio of the triads without affecting their width. Basically has the effect of stretching or compressing the triads vertically. Note that it also affects the gaps between phosphors.
Examples:
Triad Aspect Ratio 0.5 |
Triad Aspect Ratio 1.0 |
Triad Aspect Ratio 2.0 |
Float2 between 0 and 1
Increasing this increases the apparent thickness of the phosphors along each axis.
Examples:
Phosphor Thickness 0.1 |
Phosphor Thickness 0.2 |
Phosphor Thickness 0.99 |
Float2 greater than 0
Increasing this makes the phosphors appear sharper with more well-defined gaps. Low values can actually blur the gaps away altogether. This is more noticeable with very wide triads than with narrow ones.
Examples:
Phosphor Sharpness 5.0 |
Phosphor Sharpness 50.0 |
Phosphor Sharpness 500.0 |
Every Frame or Every 60 Frames
Toggles how frequently this shader recomputes the phosphor mask. The math to generate it is relatively expensive, and it only changes when you’re making adjustments. Setting this to Every 60 Frames can recover a few hundred microseconds on your GPU without affecting the shader’s appearance.
Boolean
Toggles interlacing and deinterlacing. Note that interlacing is highly sensitive to VSync and framerate quirks.
Examples:
Interlacing Disabled (Digital Scanlines, 3 pixels wide) |
Interlacing Enabled(Digital Scanlines, 3 pixels wide) |
None, Weaving, Blended Weaving, or Static
Selects the logic used to deinterlace when interlacing is enabled. Useful for simulating certain monitors, mitigating artifacts from framerate quirks, or for mitigating image retention on some monitors.
Note that None can exhibit combing artifacts on some displays at certain framerates. Weaving and Blended Weaving create combing artifacts in all cases, but they’re more consistent and are less stressful on some displays.
Float betweeen 0.1 and 5.0
Tunes the gamma encoding for the deinterlacing pass. This lets you adjust for any color distortions introduced by deinterlacing.
Boolean
Ordinarily, the even scanlines are draw during even-valued frames. This flips to drawing odd scanlines during even-valued frames. Usually this doesn’t do much of anything, but occasionally it does. Toggle it to your liking.
Digital, Linear, Gaussian, or Multi-Source Gaussian
Alters the shape of the electron beam.
Digital produces perfectly rectangular beams. Linear produces beams whose brightness decreases linearly with distance from the center. Gaussian beams have a realistic shape whose width varies with pixel brightness. Multi-Source Gaussian works better for wide and diffuse beams that overlap.
Linear beams are good for very narrow scanlines. Gaussian beams are more realistic for wider scanlines, but they can throw colors off with narrow scanlines.
Examples:
Digital Beams Left: 3 pixels wide |
Linear Beams Left: 3 pixels wide |
Gaussian Beams Left: 3 pixels wide |
Left: Gaussian Beams (Large Max Sigma) Multi-Source Gaussian is less prone to clipping when sigma is large. |
Float between 0.1 and 5.0
Scales the width of the gaps between electron beams. Can be used to tune the apparent intensity of the beam.
Float greater than 0.0
Gaussian scanlines have a sigma parameter that varies with pixel brightness. This sets the minimum value for sigma, which affects the apparent brightness of the beam. This interacts with Beam Max Sigma to alter the contrast of the image.
Float greater than 0.0 and greater than Beam Min Sigma
Gaussian scanlines have a sigma parameter that varies with pixel brightness. This sets the maximum value for sigma, which affects the apparent brightness of the beam. This interacts with Beam Min Sigma to alter the contrast of the image.
This should be greater than Beam Min Sigma, but breaking this rule shouldn’t break anything.
Float greater than 0.0
Gaussian scanlines have a sigma parameter that varies with pixel brightness. Beam Spot Power controls how skewed this scaling is. Increasing the value skews towards larger values of sigma, which increases the typical beam intensity.
None, Quilez, Gaussian, or Lanczos
In real CRT’s, the electron beam is a 2D spot that traverses the phosphor mask. This setting controls the horizontal shape of the electron beam, which produces a small-scale blurring effect.
None disables this effect and treats the electron beam as infinitely narrow. Quilez is a fast approximation of this blurring effect that blends pairs of neighboring pixels. Gaussian is a more accurate and tunable algorithm that blends four neighboring pixels. Lanczos uses a Lanczos filter to combine four neighboring pixels, which should tend to have a sharpening effect instead of a blurring.
Disclaimer: I can’t for the life of me see a meaningful difference in these settings. It’s possible that this needs to scale with Scanline Width.
Float between 0.01 and 0.67
For Gaussian Horiz Filter, increasing this makes the filter blend more strongly.
Float between 0.0 and 1.0
This doesn’t currently have any effect. The latest preprocessor settings for crt-royale, which I largely left alone, make this a no-op.
The Gaussian Horiz Filter calculates a blend between the linear RGB values and the gamma-corrected RGB values. In theory, increasing this makes brighter colors dominate dimmer ones. In practice, the gamma value used for this part of the pipeline is set to 1.0; so the "gamma-corrected" RGB values are the same as the linear RGB values.
Float between -10.0 and 10.0
Simulates horizontal misalignment of each of the RGB channels. Note that this does not alter the colors rendered, only their alignment.
Float between -10.0 and 10.0
Simulates vertical misalignment of each of the RGB channels.
Float between 1.0 and 5.0
The gamma value of the CRT you’re simulating with this shader. Increasing this decreases the brightness of the output.
Float between 1.0 and 5.0
The gamma value of your display. Increasing this increases the brightness of the output.
Float between 0.0 and 4.0
Scale the contrast of the simulated CRT. Increasing this increases the brightness of the output.
Float between 0.0 and 1.0
Scale the intensity of the halation effect. Halation is caused by photons bouncing under the glass and exciting neighboring phosphors. This blurs and desaturates the image.
Float between 0.0 and 1.0
Scale the intensity of the diffusion effect. Diffusion is caused by the glass refracting photons as they pass through. Moderate values make bright spots appear to glow, and strong values blur the image.
Float greater than 0.0
Scale the intensity of the bloom effect. Causes the image to appear significantly brighter and more saturated by filling in shadows left by the phosphor mask and interlacing.
Float between 0.0 and 1.0
Applies additional smoothing to the bloom effect. Similar to Diffusion, except it doesn’t produce a glow.
Flat, Spherical, Spherical (Alt), and Cylindrical
Controls the shape of the glass for the simulated CRT by projecting the content onto a surface.
Flat applies no distortion as in a flatscreen CRT. Spherical simulates a spherical screen with a square border. Spherical (Alt) simulates a spherical screen and also distorts the border. Cylindrical simulates a Trinitron-style screen.
Note that the distortions tend to interact with the phosphor mask’s pattern to produce banding artifacts. These can be mitigated with the anti-aliasing settings in the Preprocessor Definitions.
Float between 0.16 and 1024.0
Sets the radius of the sphere or cylinder used for the projection. Decreasing this increases the curvature of the simulated screen.
Float between 0.5 and 1024.0
Sets the user’s simulated viewing distance from the CRT. Decreasing this tends to amplify the effects of the other geometry settings.
Float between 0.0 and 3.14
Simulates the viewing angle between the user and the CRT. Useful for simulating arcade machines.
Float greater than 1.0
Theoretically alters the aspect ratio of the CRT. Doesn’t appear to have any effect, though.
Float greater than 1.0
Scales the width and height of the area covered by the electron beam. Has the effect of either squishing or stretching the image without altering the simulated screen.
Float between 0.0 and 0.5
Sets the width of the vignette effect applied to the edges of the screen.
Float greater than 0.0
Shifts the outer border of the vignette. Larger values make the edges of the screen much darker.
Float greater than 0.0
Shifts the inner border of the vignette. Smaller values make the interior of the screen somewhat darker.
Integer 0 or 1
Setting this to 1 disables the bulk of the shader and instead draws a colored box around the screen. This box denotes the portion of the screen that the shader will affect. In more technical terms, it denotes the boundaries of the viewport. The shader will crop out the viewport, apply its effects, and then uncrop.
If your game has letter-boxing, you should use this tool to ensure the phosphor mask and scanline effects are scaled correctly. The shader will still look okay if you skip this step, but it won’t be "correct."
Integer 0 or 1
Setting this to 1 draws the content box on the inside of the viewport, and setting it to 0 draws it on the outside of the viewport.
You can toggle this back and forth to get the box pixel-perfect. When inscribed, there shouldn’t be any pixels from your game on the outside of the box. When circumscribed, there shouldn’t be any black pixels (letter-boxing) on the inside of the box. Decreasing CONTENT_BOX_COLOR_A can help make this process easier.
Floats between 0.0 and 1.0
Collectively set the color and transparency of the content box when CONTENT_BOX_VISIBLE is set to 1. Modify these if the content box is hard to see, or if you want the box to be slightly transparent.
Integer greater than 0
Sets the thickness of the content box in pixels. Use this if the content box is hard to see.
Integer expression greater than 0
Adjusts the center of the content box in pixels. 0 corresponds to the center of the game’s window. Use this if your game doesn’t render in the center of the screen.
These can either be integers or mathematical expressions that output integers.
Integer expression greater than 0
Adjusts the width and height of the content box without changing its center.
These can either be integers or mathematical expressions that output integers. For example, you can set CONTENT_HEIGHT to BUFFER_HEIGHT
and CONTENT_WIDTH to CONTENT_HEIGHT * 4.0 / 30
. Then the content box will span the entire height of the screen, and the viewport will have a 4:3 aspect ratio; and you’ll be able to resize the game’s window without adjusting these settings.
If you write a more complex expression, I recommend you use parentheses aggressively to avoid silly math errors that’ll take an embarrassingly long time to figure out.
DEPRECATED
Integer 0 or 1
Setting this to 1 switches over to the deprecated, slower phosphor mask algorithms. These worked by downsampling and tiling textures across the screen. The algorithm is prone to rounding errors and ringing artifacts, but I’ve left it in for now.
Will be removed in version 2.0.
DEPRECATED
Integer 0 or 1
The phosphor mask can either be generated from a 128x128 texture or 524x524 texture.
Will be removed in version 2.0.
Integer from 0 to 9
Sets the antialiasing algorithm, which subtly alters the effect. 0: Box (separable) 1: Box (cylindrical) 2: Tent (separable) 3: Tent (cylindrical) 4: Gaussian (separable) 5: Gaussian (cylindrical) 6: Cubic (separable) 7: Cubic (cylindrical) 8: Lanczos Sinc (separable) 9: Lanczos Sinc (cylindrical)
Integer greater than 0
Sets the strength of the anti-aliasing effect. Any non-negative integer is valid, but only the following actually correspond to a change in intensity: 0, 1, 5, 6, 7, 8, 12, 16, 20, 24.