Changes

Jump to navigation Jump to search

CRT-Royale

11,857 bytes added, 10:06, 21 October 2020
Interlacing
[[File:CRT-Royale.png|thumb|298px|CRT-Royale, with default settings at 1080p (view original for full details)]]
'''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<ref>[https://raw.githubusercontent.com/libretro/common-shaders/master/crt/shaders/crt-royale/README.TXT CRT-Royale README.TXT]</ref> and the documentation in the <code>user-settings.h</code><ref>[https://github.com/libretro/common-shaders/blob/master/crt/shaders/crt-royale/user-settings.h CRT-Royale user-settings.h]</ref> is a must.
==System Requirements==
A highly advanced multiCRT-pass CRT Royale is a large and complex shader that simulates almost every aspect of , so it will need modern hardware to run correctly. Discrete Nvidia or AMD video cards made in the CRT screen. There last few years are tons of parameters to configure, such as phosphor type (aperture grille, slot mask, and EDP shadow mask) and size (i.erecommended. dot pitch)In particular, convergence offests, scanline blooming Intel iGPUs will struggle to run the shader and many otherssome may not even run in some cases. Higher resolution is better The author provided a preset for Intel users that compromises some functionality for this shader, especially with EDP shadow mask phosphor layout and with smaller phosphor dot pitch valuescompatibility. This shader is really complicated compared to most other CRT shaders, reading the README and the documentation in the There's also various <code>user-settings.h is a must</code> files in <code>crt-royale-settings-files</code><ref>[https://github.com/libretro/common-shaders/tree/master/crt/shaders/crt-royale/crt-royale-settings-files crt-royale-settings-files]</ref> that enable/disable options for different GPU profiles.
The display you use for CRT-Royale should have at least 1440p of resolution to give a decent level of detail for slot mask emulation, though 4K (2160p) or higher resolutions are recommended. 1080p displays can work for aperture grille emulation since less resolution is needed to render vertically aligned phosphors. This shader uses some features in RetroArch's Cg shader format that has only been somewhat recently added since version 1.0.0.2, such as sRGB framebuffers and mipmapping, so you should at least be using RetroArch 1.2 for this shader. ==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 <code>user-settings.h</code> file. In order for the settings in <code>user-settings.h</code> that are marked with <code>_static</code> to take effect, runtime parameters must be disabled by commenting out <code>#define RUNTIME_SHADER_PARAMS_ENABLE</code> in <code>user-settings.h</code>. Doing this will make the runtime parameters non-functional so you will need to reload the shader to apply changes made in <code>user-settings.h</code>, 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 <code>user-settings.h</code> 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.4 and 2.2 in most cases, respectively.  ===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 <code>bloom_underestimate</code> will cause the bloom to be more intense on phosphors that are fully lit, which raises the overall brightness of the image and counteracts the loss of brightness caused drawing a phosphor grid over the image. <code>bloom_excess</code> 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 scan line 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 a less variable width of scanlines. Higher sigmas increase the size of the scan lines, 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. <code>beam_horiz_filter</code> 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). <code>beam_horiz_sigma</code> 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 convergence with no colors that are misaligned. However, real CRTs, particularly cheaper consumer models, very often did not have perfect convergence, 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. <code>mask_type</code> 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. <code>mask_sample_mode_desired</code> 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. <code>mask_triad_size_desired</code> 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 <code>mask_specify_num_triads</code> is set to 1.0, then the phosphor mask will be scaled to use the number of triads specified in <code>mask_num_triads_desired</code>. This is disabled by default. Examples of each kind of phosphor style. :<gallery widths=320 heights=240>  File:Aptureture girl.png|Aperture GrilleFile:Slut mask.png|Slot MaskFile:Dope mask.png|Dot mask </gallery> ===Anti-Aliasing=== aa_subpixel_r_offset_x_runtime = -0.333333 aa_subpixel_r_offset_y_runtime = 0.000000 aa_cubic_c = 0.500000 aa_gauss_sigma = 0.500000 These settings affect the anti-aliasing for curvature, overscan, and subpixels that is done to the shader in the last pass. These settings are quite technical and may not have immediately apparent effects. Refer to the documentation in <code>user-settings.h</code> for detailed explanations. ===Geometry=== geom_mode_runtime = 0.000000 geom_radius = 2.000000 geom_view_dist = 2.000000 geom_tilt_angle_x = 0.000000 geom_tilt_angle_y = 0.000000 geom_aspect_ratio_x = 432.000000 geom_aspect_ratio_y = 329.000000 geom_overscan_x = 1.000000 geom_overscan_y = 1.000000 These are the settings that control the geometry of the simulated CRT. The geometry modes available are 0.0 (Flat), 1.0 ([[CRT-Geom]] style curvature), 2.0 (bulbous curvature), and 3.0 (cylindrical Trinitron curvature). View distance specifies how far the CRT is in the user's field of view. The tilt angle settings control which direction the screen is tilted. The aspect ratio of the simulated screen can also be configured. Overscan affects how much of the image is visible on the simulated CRT since many consumer TVs did not display the full scan area. Some people may find curvature to be distracting so leaving these settings at default will leave the CRT image perfectly flat. ===Border=== border_size = 0.015000 border_darkness = 2.000000 border_compress = 2.500000 These settings affect the size and shape of the black border around the CRT. The default settings create a bit of vignetting around the corners; if you dislike this effect, you can set the size and darkness of the border to 0.0. ===Interlacing=== interlace_bff = 0.000000 interlace_1080i = 0.000000 These settings control how interlacing is handled by the shader. The "bff" setting refers to the order in which each scan line field is displayed, where setting that to 1.0 would make it "bottom field first" as opposed to "top field first" like the default. The 1080i setting specifies whether interlacing is enabled if the input image is 1080 pixels tall, setting it to 1.0 makes it display 1080i instead of 1080p. Interlacing detection can be turned off entirely by editing <code>interlace_detect</code> in <code>user-settings.h</code> to be <code>false</code>. This will make it display 480 pixel tall content as 480p instead of 480i, which will eliminate any flickering, but may result in combing artifacts if the game is interlaced natively. This setting is static only and is not a runtime parameter. A recent version seems to have made this tunable at runtime. This was motivated by [https://amp.reddit.com/r/RetroArch/comments/ehw7te/stop_suffering_with_the_crtroyale_shader/ user feedback on SNES emulation], where the shader improperly detected interlacing on progressive video. ==DownloadVariants== There are some different variants of the shader provided as different presets. Besides the default <code>crt-royale.cgp</code>, there is a "fake bloom" preset that uses a much faster bloom method that is lower quality. There are also Intel variants of both the full and fake bloom versions of the shader that omit some features to allow the shader to run on Intel iGPUs. There are also presets with passes of Themaister's [[NTSC Filters|NTSC shader]] applied before the CRT-Royale passes, though this increases the requirements quite a bit. ==4K == CRT Royale works best at 2,880 × 2,160 (4K) resolution. That resolution is exactly 9 times 320x240, which was a common resolution for these consoles. <gallery widths=320 heights=240> File:Ff7 4k crt shader.png|Final Fantasy 7 (PlayStation)File:1446491029205-1-.png|Castlevania: Symphony of the Night (PlayStation)File:Retroarch-1102-0058354ertd.png|Castlevania: Symphony of the Night (PlayStation)File:Ff5 4k.png|Final Fantasy 5 (Super Famicom)File:Rtype 4k.png|R-Type Delta (PlayStation)File:Mr bones 4k.png|MediEvil (PlayStation)</gallery> ==Notes== <references /> ==External Links==*[https://github.com/libretro/common-shaders/tree/master/crt/shaders/crt-royale CRT-Royaleon GitHub]*[http://filthypants.blogspot.com/2014/07/crt-royale-and-3dfx-shaders.html CRT-Royale and 3dfx Shaders]- hunterk's blog post about CRT-Royale's different phosphor mask layouts.
[[Category:Shaders/Filters]]
Anonymous user

Navigation menu