Editing CRT Geom

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
 
[[File:Retroarch_2013-07-22_17-21-17-60.png|thumb|298px|CRT-Geom-Flat, with default settings]]
 
[[File:Retroarch_2013-07-22_17-21-17-60.png|thumb|298px|CRT-Geom-Flat, with default settings]]
  
'''CRT-Geom''' is a popular CRT shader created by cgwg.
+
One of the more popular CRT shaders.
  
 
==Download==
 
==Download==
*[https://github.com/libretro/common-shaders/blob/master/crt/shaders/crt-geom.cg crt-geom.cg]
+
 
*[https://gist.github.com/anonymous/dda125d65ded3fe9ed955800666eacf9 crt-geom-flat.cg]
+
*[https://github.com/libretro/common-shaders/blob/master/crt/crt-geom-flat.cg CRT Geom flag.cg]
 +
 
 +
*[https://github.com/libretro/common-shaders/tree/master/crt/crt-interlaced-halation]
 +
 
 +
*[https://github.com/libretro/common-shaders/blob/master/crt/crt-geom-flat-sharpness.cg]
 +
 
 +
*[http://www.mediafire.com/download/6ygh7saafpn7gm0/CRT-Geom_for_CRT_monitors.7z]
  
 
==Versions==
 
==Versions==
Line 15: Line 21:
  
 
===Halation===
 
===Halation===
 +
 
A multipass version with a "halation" effect that replicates the bloom of a CRT TV.  
 
A multipass version with a "halation" effect that replicates the bloom of a CRT TV.  
 +
 +
===CRT Monitor variant===
 +
 +
If you're using a CRT monitor, you can use the variants of CRT-Geom at 1280x960 full screen for a near authentic 240p look. These variants are based on the flat variant with phosphor code commented out and the gamma correction disabled. There are three main variants (Normal, Sharp, Sharper), and each have different scanline brightness presets and interlacing enabled/disabled. As above, use integer scaling and force 4:3 aspect ratio. Some games may have black borders due to the full overscan area being visible, use your monitor's zoom function to zoom in and hide overscan. Also works with handheld games if you use the non-interlaced variant and force a 4x scale in RGUI.
 +
  
 
==Tweaking CRT Geom==
 
==Tweaking CRT Geom==
CRT Geom is highly customizable. You can open up the .cg file in [http://notepad-plus-plus.org/ Notepad++] and edit it. Regular notepad will work, but Notepad++ is recommended.
+
Note: Most of the coding in this section is out of date, and refers to the .shader version, not the current .cg version.
 +
 
 +
CRT Geom is highly customizable. You can open up CRT Geom in [http://notepad-plus-plus.org/ notepad++] and edit it. Regular notepad will work, but notepad++ is recommended.
  
Shader parameters can be changed by editing the first value of the parameter at the beginning of the file, or through [[RetroArch]]'s shader menu.
 
 
[[File:Retroarch_2013-07-22_17-22-39-87.png|thumb|225px|CRT-Geom-Flat, with brighter scanlines]]
 
[[File:Retroarch_2013-07-22_17-22-39-87.png|thumb|225px|CRT-Geom-Flat, with brighter scanlines]]
  
Line 29: Line 42:
  
 
===Sharpness===
 
===Sharpness===
'''old XML shader format only'''
+
 
 
[[File:Retroarch_2013-07-22_19-24-11-41.png|thumb|225px|CRT-Geom-Flat, at 2x sharpness]]If you find the shader looks too blurry, you can increase the sharpness by going to the sections in the code that have the following lines (should be at the beginning of both the vertex and fragment portions of the shader code):
 
[[File:Retroarch_2013-07-22_19-24-11-41.png|thumb|225px|CRT-Geom-Flat, at 2x sharpness]]If you find the shader looks too blurry, you can increase the sharpness by going to the sections in the code that have the following lines (should be at the beginning of both the vertex and fragment portions of the shader code):
 
  uniform vec2 rubyInputSize;
 
  uniform vec2 rubyInputSize;
Line 39: Line 52:
 
  vec2 TextureSize = vec2(n*rubyTextureSize.x, rubyTextureSize.y);
 
  vec2 TextureSize = vec2(n*rubyTextureSize.x, rubyTextureSize.y);
 
[[File:Retroarch_2013-07-22_19-27-22-65.png|thumb|225px|CRT-Geom-Flat, at 4x sharpness]]Replace "n" with either 2 for increased sharpness, or 4 for maximum sharpness. Then Ctrl+F and seek out any portions of the code that say "rubyInputSize" and "rubyTextureSize", and replace them with "InputSize" and "TextureSize" respectively.
 
[[File:Retroarch_2013-07-22_19-27-22-65.png|thumb|225px|CRT-Geom-Flat, at 4x sharpness]]Replace "n" with either 2 for increased sharpness, or 4 for maximum sharpness. Then Ctrl+F and seek out any portions of the code that say "rubyInputSize" and "rubyTextureSize", and replace them with "InputSize" and "TextureSize" respectively.
 
 
===Scanline Size===
 
===Scanline Size===
'''old xml shader format only'''
 
 
 
To obtain thinner, 480p-esque scanlines, first tweak the shader to apply greater sharpness, but only apply it to the TextureSize. The code should look like this:
 
To obtain thinner, 480p-esque scanlines, first tweak the shader to apply greater sharpness, but only apply it to the TextureSize. The code should look like this:
 
  uniform vec2 rubyTextureSize;
 
  uniform vec2 rubyTextureSize;
Line 53: Line 63:
  
 
===Curvature===
 
===Curvature===
'''old xml shader format only'''
 
  
To make it flat, just set corner size (line 107) to 0.001 and corner smooth (line 110) to 8000.0. Then, comment out (i.e., put two slashes in front of it, like this: // ) line 141, #define CURVATURE.
+
To make it flat, just set cornersize (line 107) to something small, like 0.001 and cornersmooth (line 110) to something large, like 8000.0. Then, comment out (i.e., put two slashes in front of it, like this: // ) line 141, #define CURVATURE.
  
  //#Define CURVATURE
+
Define Curvature. Something like that Comment it out. That means adding "//" in front of it. It should look like this when you're done:
 +
 
 +
  //#Define Curvature
  
 
===Interlacing===
 
===Interlacing===
For the original, to disable interlacing, comment it out:
 
 
//#define INTERLACED
 
  
 +
For the original, to disable interlacing, change this line:
 +
 +
ilfac = vec2(1.0,floor(rubyInputSize.y/200.0));
 +
 +
to the following:
 +
 +
ilfac = vec2(1.0,1.0);
 
===Phosphor===
 
===Phosphor===
[[File:Retroarch_2013-07-22_19-33-30-35.png|thumb|225px|CRT-Geom-Flat, with phosphor disabled]]To disable phosphor emulation (which alternately tints pixels green and magenta), comment out #define DOTMASK:
+
[[File:Retroarch_2013-07-22_19-33-30-35.png|thumb|225px|CRT-Geom-Flat, with phosphor disabled]]To disable phosphor emulation (which alternately tints pixels green and magenta), comment out the following lines, found at the bottom of the shader code:
 +
 
 +
vec3 dotMaskWeights = mix(
 +
vec3(1.0, 0.7, 1.0),
 +
vec3(0.7, 1.0, 0.7),
 +
floor(mod(mod_factor, 2.0))
 +
);
 +
 +
mul_res *= dotMaskWeights;
  
//#define DOTMASK
 
  
 
===Halation===
 
===Halation===
Line 73: Line 95:
 
  mul_res += pow(tex2D(decal, xy2).rgb, float3(monitorgamma))*0.1;
 
  mul_res += pow(tex2D(decal, xy2).rgb, float3(monitorgamma))*0.1;
  
Lowering the last number reduces the effect of the halation. This is preferred since the default halation level is too high.
+
Lowering the last number reduces the effect of the halation. This is prefered since the default halation level is too high.
 +
 
  
 
[[Category:FAQs]]
 
[[Category:FAQs]]
 
[[Category:Shaders/Filters]]
 
[[Category:Shaders/Filters]]

Please note that all contributions to Emulation General Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Emulation General Wiki:Copyrights for details). Do not submit copyrighted work without permission!

To edit this page, please answer the question that appears below (more info):

Cancel Editing help (opens in new window)