Author Topic: Theme to demonstrate CRT shaders  (Read 13982 times)

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Theme to demonstrate CRT shaders
« on: September 19, 2018, 11:26:58 PM »
UPDATED: Split shaders in to own themes for easier viewing.

I ended up finally finishing off some other stuff I started years ago - namely, a small theme just to show videos using a few different types of CRT shaders.

Gitlab link

You'll need to play around with things to get nice settings for yourself.

Link to high quality photos of running on an 4:3 LCD machine
« Last Edit: September 20, 2018, 06:15:56 PM by Luke_Nukem »

iOtero

  • Sr. Member
  • ****
  • Posts: 414
    • View Profile
Re: Theme to demonstrate CRT shaders
« Reply #1 on: September 20, 2018, 01:20:11 AM »
Change "movie" to "snap", or nothing will be seen... 8)
Nacer a los 15 años Una novela de iOtero

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Theme to demonstrate CRT shaders
« Reply #2 on: September 20, 2018, 01:44:44 AM »
Change "movie" to "snap", or nothing will be seen... 8)

Lol! It's been a while. I still have some 3 year old settings floating around.

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Theme to demonstrate CRT shaders
« Reply #3 on: September 20, 2018, 01:53:47 AM »
Attached scaled photo of Lottes CRT shader - this is the better one, also used in flat_blue theme, but without the curvature or rounded corners.
« Last Edit: September 20, 2018, 01:56:44 AM by Luke_Nukem »

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Theme to demonstrate CRT shaders
« Reply #4 on: September 20, 2018, 01:55:25 AM »
Attached scaled photo of CGWG CRT shader - this is the "CRT" labelled one.

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Theme to demonstrate CRT shaders
« Reply #5 on: September 20, 2018, 05:14:35 PM »
UPDATED: Split shaders in to own themes for easier viewing.

Attachment replaced in OG post. Also added to attractmode-extra, awaiting merge.

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Theme to demonstrate CRT shaders
« Reply #6 on: September 21, 2018, 12:04:21 AM »
This is really nice, I'm planning to add some lotte shaders to my theme, for the "info" page where you can see a larger version of the game movie, adding this CRT effect would look great. I wish I had more time to dedicate to theme making, but real work needs to be done sometimes :D

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Theme to demonstrate CRT shaders
« Reply #7 on: September 21, 2018, 02:56:28 AM »
This is really nice, I'm planning to add some lotte shaders to my theme, for the "info" page where you can see a larger version of the game movie, adding this CRT effect would look great. I wish I had more time to dedicate to theme making, but real work needs to be done sometimes :D

I've added yet another shader to the collection, a Halation style one. Which is sort of the cgwg one with extra effects. It really requires an input of a previous frame, which I can't get from AM unless I dive in to the source further.

No new archive, you'll need to get it from the git.

Sounds like your theme will be good!

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Theme to demonstrate CRT shaders
« Reply #8 on: September 24, 2018, 01:42:46 AM »
I'm playing with your CGWG shader implementation (that's much better than my own CRT shader of course) but is there a way to have a transparent background instead of black?


Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Theme to demonstrate CRT shaders
« Reply #9 on: September 24, 2018, 02:13:36 AM »
I must not have noticed due to using a black background for testing. I'll see what I can come up with, ours probably missing the alpha channel.

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Theme to demonstrate CRT shaders
« Reply #10 on: September 24, 2018, 10:39:45 AM »
probably missing the alpha channel.

Yes, indeed the last line of the fragment shader is:

gl_FragColor = vec4(mul_res*brightmult, 1.0);

so basically the alpha is disregarded.

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Theme to demonstrate CRT shaders
« Reply #11 on: September 27, 2018, 05:59:17 AM »
I must not have noticed due to using a black background for testing. I'll see what I can come up with, ours probably missing the alpha channel.

I found how to do it: just change the last line of the fragment shader to:

  gl_FragColor = vec4(mul_res, cval);

instead of

  gl_FragColor = vec4(mul_res, 1.0);

Luke_Nukem

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
    • Blogging about Rust lang
Re: Theme to demonstrate CRT shaders
« Reply #12 on: September 27, 2018, 08:00:34 AM »
I must not have noticed due to using a black background for testing. I'll see what I can come up with, ours probably missing the alpha channel.

I found how to do it: just change the last line of the fragment shader to:

  gl_FragColor = vec4(mul_res, cval);

instead of

  gl_FragColor = vec4(mul_res, 1.0);

Glad you found it yourself. Sorry I haven't had much time to update things yet.

zpaolo11x

  • Hero Member
  • *****
  • Posts: 1233
    • View Profile
    • My deviantart page
Re: Theme to demonstrate CRT shaders
« Reply #13 on: October 01, 2018, 12:55:10 AM »
You can also apply a similar modification to the Lotte shader, just replace the void function at the end with this:

Code: [Select]
void main(void)
{

#ifdef CURVATURE
    vec2 pos = radialDistortion(texCoord);//CURVATURE
    //FINAL//
    gl_FragColor.rgb = Tri(pos) * Mask(gl_FragCoord.xy) * vec3(corner(pos));
#else
    vec2 pos = gl_TexCoord[0].xy;
    gl_FragColor.rgb = Tri(pos) * Mask(gl_FragCoord.xy);
#endif

#ifdef YUV
    gl_FragColor.rgb = vec3(dot(YUVr,gl_FragColor.rgb), dot(YUVg,gl_FragColor.rgb), dot(YUVb,gl_FragColor.rgb));
    gl_FragColor.rgb = clamp(ToSrgb(gl_FragColor.rgb), 0.0, 1.0);
#endif
 
#ifdef GAMMA_CONTRAST_BOOST
    gl_FragColor.rgb=brightMult*pow(gl_FragColor.rgb,gammaBoost )-vec3(blackClip);
#endif

    gl_FragColor.a = corner(pos);

}

jedione

  • Hero Member
  • *****
  • Posts: 1135
  • punktoe
    • View Profile
Re: Theme to demonstrate CRT shaders
« Reply #14 on: October 04, 2018, 07:09:11 PM »
any one know how to add a line to make these shaders work with the Fade module
thanks.......
help a friend....