A 2D shader for Godot 3 simulating a CRT

Godot 3 2D CRT Shader

A 2D shader for Godot 3 simulating a CRT.

A 2D shader for Godot 3 simulating a CRT - OFF A 2D shader for Godot 3 simulating a CRT - ON

Usage

  • Create a CanvasLayer.
  • Add a ColorRect as a child node of the CanvasLayer.
  • In the ColorRect properties:
    • Go to the Material section.
    • Click on the [empty] dropdown from Material and load crt_material.tres.

Note

If for some reason, when loading the crt_material.tres, the crt_shader.shader is empty, just open it with any text editor, copy the code in the Shader editor and save it.

Shader Parameters

Screen size

Name Type Default Description
screen_size vec2 vec2(320.0, 180.0) The size of your project's display/window/size.

Show curvature

Name Type Default Description
show_curvature bool true Enables/disables the curvature effect.

Works best in window/stretch/mode="2d".

Curvature X amount

Name Type Default Description
curvature_x_amount float 6.0 Controls the curvature on the X axis. The lower the amount, the lower distortion. Range from 3.0 to 15.0 with 0.01 steps.

Curvature Y amount

Name Type Default Description
curvature_y_amount float 6.0 Controls the curvature on the Y axis. The lower the amount, the lower distortion. Range from 3.0 to 15.0 with 0.01 steps.

Corner color

Name Type Default Description
corner_color vec4 vec4(0.0, 0.0, 0.0, 1.0) The color of the blank space on the corners left by the curvature.

Show vignette

Name Type Default Description
show_vignette bool true Enables/disables the vignette effect.

Vignette opacity

Name Type Default Description
vignette_opacity float 0.2 Controls the opacity of the vignette. Range from 0.0 to 1.0 with 0.01 steps.

Show horizontal scan lines

Name Type Default Description
show_horizontal_scan_lines bool true Enables/disables the horizontal scan lines.

Horizontal scan lines amount

Name Type Default Description
horizontal_scan_lines_amount float 180.0 Controls how many horizontal scan lines appear. Range from 0.0 to 180.0 with 0.1 steps.

Setting it to your project's windows/size/height should work fine, but you can play with it to get the results best fitted to your liking.

Having fewer scan lines will make them larger, which makes it harder for the moire effect to appear.

Horizontal scan lines opacity

Name Type Default Description
horizontal_scan_lines_opacity float 1.0 Controls the opacity of the horizontal scan lines. 0.0 is complete opaque. Range from 0.0 to 1.0 with 0.01 steps.

Show vertical scan lines

Name Type Default Description
show_vertical_scan_lines bool true Enables/disables the vertical scan lines.

Vertical scan lines amount

Name Type Default Description
vertical_scan_lines_amount float 320.0 Controls how many vertical scan lines appear. Range from 0.0 to 320.0 with 0.1 steps.

Setting it to your project's windows/size/width should work fine, but you can play with it to get the results best fitted to your liking.

Having fewer scan lines will make them larger, which makes it harder for the moire effect to appear.

Vertical scan lines opacity

Name Type Default Description
vertical_scan_lines_opacity float 1.0 Controls the opacity of the vertical scan lines. 0.0 is complete opaque. Range from 0.0 to 1.0 with 0.01 steps.

Boost

Name Type Default Description
boost float 1.2 Gives extra brightness to compensate the scanlines and the vignette. Range from 1.0 to 2.0 with 0.01 steps.

Aberration amount

Name Type Default Description
aberration_amount float 0.0 Controls the amount of chromatic aberration. Range from 0.0 to 10.0 with 0.01 steps.

Changelog

See CHANGELOG.

Authors

Credits

Thanks to:

License

MIT License.

Similar Resources
Comments
  • Screen texture and scan lines are now affected by curvature

    Screen texture and scan lines are now affected by curvature

    The shader no longer multiplies what's behind it, and now uses the screen texture as the color, and applies curvature to the screen UV. Scanlines are also affected by curvature now. I also added an option to change the speed of the scanline movement.

    example

  • Make scanlines and grille non-destructive

    Make scanlines and grille non-destructive

    Simple adjustment, but this allows the developer to lower the opacity of the scanlines and grille without resulting in a completely black screen, which is exactly what I needed for Bodge Dall!

    https://www.reddit.com/r/godot/comments/j0yk4r/spent_the_weekend_building_this_arcadestyle/g7ho26u/

  • Sharpness/blur setting

    Sharpness/blur setting

    Very nice shader!

    A sharpness/blur setting would be really cool. Some old monitors were really blurry looking. Maybe some gaussian blur, cause the mipmap based blur I have tried does not look too good.

mdmb is a tool for simulating Apple devices interacting with Apple MDM servers.

mdmb mdmb — short for MDM Benchmark, à la ab — is a tool for simulating Apple devices interacting with Apple MDM servers. mdmb creates sets of fake Ap

Dec 1, 2022
Toy Shader in TinyGo for Game Boy Advance.
Toy Shader in TinyGo for Game Boy Advance.

toyshader.gba Toy Shader in TinyGo for Game Boy Advance. Releases v0.2: 80x80 screen with 3x2 pixel block version for drawing speed. v0.1: 240x160 pix

Oct 29, 2022
Compute shader in GO (using go-gl/glfw)
Compute shader in GO (using go-gl/glfw)

shadr (compute shader using go-gl/glfw) structure main.go contains intialisation

Jan 20, 2022
Nba-simulation - Golang will be simulating nba match and streaming it real time

NBA Simulation golang in-memory To build and run go build ./nbaSimulation To ru

Feb 21, 2022
Kakoune syntax highlighting for the Godot Engine / Godot Scripting Language gdscript
Kakoune syntax highlighting for the Godot Engine / Godot Scripting Language gdscript

gdscript-kak Kakoune syntax highlighting for the Godot Engine / Godot Scripting Language gdscript. Adds basic syntax highlighting to your .gd files fo

Mar 2, 2021