Please show off what crt shaders can do!

Interesting! I think I can make out some scanlines in the last image, but they’re very faint.

Have you tried lowering contrast/brightness until scanlines appear?

What is the brand/model of the TV? I’ve never encountered one that didn’t display scanlines with 240p, especially through RGB.

Either:

  1. it’s displaying 240p but contrast/brightness is too high, causing the scanlines to bloom into each other.

  2. The CRT is losing focus due to age

  3. it’s an HD CRT that upscales everything to 480p

  4. it’s an SD CRT and it’s displaying 240p and brightness/contrast is correct, but there are no scanlines and/or they’re so faint that they’re practically invisible.

1 Like

this is my guess :slight_smile: It looks great, of course.

2 Likes

Yeah, HD CRTs are amazing for anything 480p and up. PS4 downscaled to a HD CRT can look incredible.

I think PS1 games that used polygon-based graphics would also look great on an HD CRT (that first shot looks great!), but anything sprite-based needs scanlines to look right, IMO.

By tweaking CRT-Royale and its user-settings.h file too.I activated the runtime of the sub-pixels, activated lanczos window for sinc-resize mask, adjusted levels_autodim_temp to 1.0 etc.

http://emulation.gametechwiki.com/index.php/CRT-Royale

I run 3 different games which are respectively 240p 480p (i) and 320x200 double scan, save state on specific area. I raise lcd gamma to 5.0 in shader options (retroarch) then I adjust the max sigma until the darkest part of the mask is homogeneous, then I adjust the power spot until the scanlines are the lowest possible without loss of details (aperture mask) as for my example on dark legions screenshot. I’ll post an example of my method after. @trnzaddict ty! yes i think i can do better better with settings :exploding_head: No it is in 4k resolution! it costs the price of a luxury car for a screen 8 k ahaha

Method screenshots.

First : https://pasteboard.co/Iifo8Fp.png (gamma 5.0 destroying my eyes :smile: )

Final : https://pasteboard.co/Iifoow3.png (aperture)

Bonus experimenting : https://pasteboard.co/IifoCQS.png (slot)

And using 240p test suite too :stuck_out_tongue:

3 Likes

Very interesting. The 480p look is something I was after, I had a look but there’s not user-settings.h in glsl. I guess I can copy it from the slang repository(?).

On a different note I finally managed to assemble a nice Sega Genesis shader with crt-royale. The issue is I couldn’t stack many shaders before the svideo part (link). This must be something specific to crt-royale. Therefore before the svideo part I placed first “gdapt - stripes” (two shaders slots) to remove the characteristic stripe dithering of Sega games, then color mangler modified with a vignette function. At this point if I stacked another shader like white_point it wouldn’t work so I placed it at the very end, this is better than placing color mangler at the end.

Comix%20Zone%20(USA)-bef-t Comix%20Zone%20(USA)-aft-t

4 Likes

GLSL doesn’t support #include statements, so everything in royale that’s not a parameter had to be hardcoded.

1 Like

Where’d you pull the vignette code from? MAME?

I used the one in film_noise, but grabbed the middle point from another shader that I don’t remember

1 Like

Hmm, could you post your color_mangler with the vignette? I like the vignette effect.

I guess it would be convenient to make it stand alone, also in this version you have to use different values depending on game resolution, and couldn’t find a slang variant (struggling with GetVignetting() )

(Edit: fixed the coefficients)

https://pastebin.com/Tx8uM28a

vtenis2-vign pjustic-vign

4 Likes

Personally I use GLSL myself.

Those are some nice screens.

I’m definitely going to check out that shader, I like how that looks compared to MAME HLSL vignette effect.

1 Like

It’s easy to go overboard (Project Justice example), use sparsely. I edited the pastebin link, I wrongly used the old version with Rec.601 coefficients.

1 Like

I kinda like the Project Justice screen, it is a little much though. Lol

I’d probably use settings that are about in the middle of those two screens.

Were you able to download the Zomb pack? I get told the file is unavailable :frowning:

1 Like

Make sure you have a account on the launchbox forums and be signed in, then you should be able to download it.

That was my issue.

@Dogway I think that having the vignette in color_mangler washes out blacks when the vignette is visible.

Also, saturation is separated in rgb in code but the user settings is only a single channel, so the shader fails to load. I got it working, though

Yes sorry, it wasn’t meant for sharing, it was a personal attempt to fit it into crt-royale (along gadapt, white_point, etc). I went ahead and made it stand alone so it can be placed before or after color mangler. If hunterk wants to make some fixes and/or port it to slang it would be very welcome.

/*
   Vignette
   License: Public domain
*/

#pragma parameter vignette "Vignette Toggle" 1.0 0.0 1.0 1.0
#pragma parameter inner "Inner Ring" 0.25 0.0 1.0 0.01
#pragma parameter outer "Outer Ring" 0.60 0.0 1.0 0.01


#if defined(VERTEX)

#if __VERSION__ >= 130
#define COMPAT_VARYING out
#define COMPAT_ATTRIBUTE in
#define COMPAT_TEXTURE texture
#else
#define COMPAT_VARYING varying 
#define COMPAT_ATTRIBUTE attribute 
#define COMPAT_TEXTURE texture2D
#endif

#ifdef GL_ES
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif

COMPAT_ATTRIBUTE vec4 VertexCoord;
COMPAT_ATTRIBUTE vec4 COLOR;
COMPAT_ATTRIBUTE vec4 TexCoord;
COMPAT_VARYING vec4 COL0;
COMPAT_VARYING vec4 TEX0;

vec4 _oPosition1; 
uniform mat4 MVPMatrix;
uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;

void main()
{
   gl_Position = MVPMatrix * VertexCoord;
   TEX0.xy = TexCoord.xy;
}

#elif defined(FRAGMENT)

#if __VERSION__ >= 130
#define COMPAT_VARYING in
#define COMPAT_TEXTURE texture
out vec4 FragColor;
#else
#define COMPAT_VARYING varying
#define FragColor gl_FragColor
#define COMPAT_TEXTURE texture2D
#endif

#ifdef GL_ES
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
#define COMPAT_PRECISION mediump
#else
#define COMPAT_PRECISION
#endif

struct output_dummy {
    vec4 _color;
};

uniform COMPAT_PRECISION int FrameDirection;
uniform COMPAT_PRECISION int FrameCount;
uniform COMPAT_PRECISION vec2 OutputSize;
uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform sampler2D Texture;
COMPAT_VARYING vec4 TEX0;

// compatibility #defines
#define Source Texture
#define vTexCoord TEX0.xy

#define SourceSize vec4(TextureSize, 1.0 / TextureSize) //either TextureSize or InputSize
#define OutSize vec4(OutputSize, 1.0 / OutputSize)

#ifdef PARAMETER_UNIFORM
uniform COMPAT_PRECISION float vignette;
uniform COMPAT_PRECISION float inner;
uniform COMPAT_PRECISION float outer;
#else
#define vignette 1.0
#define inner 0.0
#define outer 1.0
#endif

void main()
{

    vec3 vcolor = COMPAT_TEXTURE(Source, TEX0.xy).rgb;
// a simple calculation for the vignette effect
	vec2 mid = vec2(0.49999, 0.49999) * InputSize / TextureSize;
	vec2 middle = TEX0.xy - mid;
	float len = length(middle);
	float vig = smoothstep(inner, outer, len);

	vcolor *= (vignette > 0.5) ? (1.0 - vig) : 1.0; // Vignette

	FragColor = vec4(vcolor,1.0);
	
} 
#endif
2 Likes

Sorry I wasn’t trying to complain, I was wanting to let you know because if other people tried to use.

I ported libretro’s white_point shader to pcsx2 GSdx. I didn’t know it was going to work, but it did! I don’t know if it’s still in need for PS2 but I think games were still designed with CRT in mind?

https://pasteboard.co/IiEmkfp.png

https://pasteboard.co/IiEmq4J.png

4 Likes