CRT-Royale
CRT-Royale is a highly advanced multi-pass CRT shader that simulates almost every aspect of the CRT screen. There are tons of parameters to configure, such as phosphor type (aperture grille, slot mask, and EDP shadow mask) and size (i.e. dot pitch), convergence offsets, scanline blooming and many others. Higher resolution is better for this shader, especially with EDP shadow mask phosphor layout and with smaller phosphor dot pitch values. This shader is really complicated compared to most other CRT shaders, reading the README[1] and the documentation in the user-settings.h[2] is a must.
Contents
Customization
Since CRT-Royale has a large number of different settings for customization, this article will only cover those that have the most noticeable effect on the overall image.
CRT-Royale can be customized one of two ways: using the runtime shader parameters from inside RetroArch or editing the user-setting.h file. In order for the settings in user-settings.h that are marked with _static
to take effect, runtime parameters must be disabled by commenting out #define RUNTIME_SHADER_PARAMS_ENABLE
in user-settings.h. Doing this will make the runtime parameters non-functional so you will need to reload the shader to apply changes, but it will result in a performance boost since there is less need for expensive branching in the shader code when the settings are static.
There are some settings in user-settings.h that are static only and do not have a runtime parameter, and therefore do not require runtime parameters to be disabled to have an effect.
The settings listed below are taken from the runtime parameters with their default values.
Gamma and Contrast
crt_gamma = 2.500000 lcd_gamma = 2.200000 levels_contrast = 1.000000
Gamma and contrast controls. CRT gamma is the output gamma of the shader, while LCD gamma is the input gamma, which should be 2.2 in most cases.
Halation and Diffusion
halation_weight = 0.000000 diffusion_weight = 0.075000
Weights for halation and diffusion of the simulated CRT. Halation is the light being reflected on the phosphors, while diffusion is the light causing a glow when passing through the glass. Some may find these effects to be annoying, so they can be turned off by setting them to 0.0.
Bloom
bloom_underestimate_levels = 0.800000 bloom_excess = 0.000000
These settings control the level of blooming in the shader. Higher bloom_underestimate
will cause the bloom to be more intense. bloom_excess
causes extra blurring of all colors to soften the bloom effect, which is disabled by default.
Beam
beam_min_sigma = 0.020000 beam_max_sigma = 0.300000 beam_spot_power = 0.330000 beam_min_shape = 2.000000 beam_max_shape = 4.000000 beam_shape_power = 0.250000 beam_horiz_filter = 0.000000 beam_horiz_sigma = 0.350000 beam_horiz_linear_rgb_weight = 1.000000
These settings determine the shape and size of the lit scanlines of the simulated CRT.
Min and max sigma settings affect the size of each scanline relative to the brightness of the image. A large range of beam sigmas causes the scanlines to vary in width depending on brightness, while small ranges result in less variable width of scanlines. Higher sigmas increase the size of the scanlines, resulting in smaller gaps and more vertical blurring.
Min and max shape settings affect the Gaussian profile of the scanlines. Higher values for these make the scanline plateaus flatter and have steeper drop offs. These effects are really only noticeable at higher screen resolutions.
beam_horiz_filter
specifies how the beam is filtered horizontally. The options are 0.0 (Quilez, sharp and fast), 1.0 (Gaussian, configurable sharpness), and 2.0 (Lanczos2, sharp and higher quality). beam_horiz_sigma
is used to set the level of blur when using Gaussian horizontal filtering.
Convergence
convergence_offset_x_r = 0.000000 convergence_offset_x_g = 0.000000 convergence_offset_x_b = 0.000000 convergence_offset_y_r = 0.000000 convergence_offset_y_g = 0.000000 convergence_offset_y_b = 0.000000
The convergence offsets settings specify how well the simulated CRT electron beams are aligned. The default values indicate perfect convergance with no colors that are misaligned. However, real CRTs, particularly cheaper consumer models, very often did not have perfect convergance, so you can change the offsets to simulate that flaw if you want.
Mask
mask_type = 1.000000 mask_sample_mode_desired = 0.000000 mask_specify_num_triads = 0.000000 mask_triad_size_desired = 3.000000 mask_num_triads_desired = 480.000000
The mask settings control how the phosphor mask is rendered on the screen.
mask_type
specifies which layout of phosphors the screen has. The options for this are 0.0 (Aperture Grille), 1.0 (Slot Mask), and 2.0 (Dot Mask). Aperture Grille phosphor layout is easier to render at lower resolutions, the other options require higher resolutions to render at an acceptable level of detail.
mask_sample_mode_desired
specifies the sampling mode of the phosphor mask. The default of 0.0 is the highest quality and slowest method, while 1.0 is lower quality but faster. The 2.0 setting makes the mask tile without resizing, which results in a huge phosphor mask with the default mask textures, so it's intended more for mask textures for a screen of a fixed size.
mask_triad_size_desired
specifies the size of each phosphor triad relative to the screen. Smaller triad size will make the simulated CRT like a high resolution PC CRT or a Sony BVM with increased sharpness and less visible phosphors, while a larger triad size makes the simulated CRT into a low resolution CRT like many consumer TVs with more blurring and less visible scanline gaps. It's recommended to keep this setting as a whole number, since fractional sizes seem to cause scaling artifacts sometimes.
If mask_specify_num_triads
is set to 1.0, then the phosphor mask will be scaled to use the number of triads specified in mask_num_triads_desired
. This is disabled by default.
Notes
External Links
- CRT-Royale on GitHub
- CRT-Royale and 3dfx Shaders - hunterk's blog post about CRT-Royale's different phosphor mask layouts.