• Stars
    star
    299
  • Rank 139,269 (Top 3 %)
  • Language GLSL
  • License
    MIT License
  • Created over 5 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

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.

More Repositories

1

Godot-3-2D-Destructible-Objects

A script that takes a sprite, divides it into blocks and makes them explode 💥!
GDScript
393
star
2

Godot-3-2D-Day-Night-Cycle

A 2D ☀️ Day / 🌔 Night cycle using CanvasModulate and a moon light effect using Light2D.
GDScript
329
star
3

Unofficial-Godot-Engine-Raspberry-Pi

Unofficial Godot Engine binaries for the Raspberry Pi.
281
star
4

Sassy-Gridlover

Super easy to use Sass mixins to establish a typographic system with modular scale and vertical rhythm. Based on the Gridlover app.
HTML
221
star
5

RetroPie-Godot-Engine-Emulator

A scriptmodule to install a Godot "emulator" for RetroPie.
Shell
91
star
6

Delaunator-GDScript

A GDScript port of Delaunator: A fast library for Delaunay triangulation of 2D points.
GDScript
80
star
7

GDScriptify

A magical documentation tool for GDScript.
JavaScript
48
star
8

Godot-Plugin-Particles-Renderer

A Godot plugin to render particles into a sprite sheet
GDScript
40
star
9

itchio-godot-scraper

A scraper for Godot games hosted on https://itch.io.
JavaScript
28
star
10

cross-compile-godot-raspberry-pi

A script to easily cross-compile Godot binaries for the Raspberry Pi from Linux x86_64 and an extra script to easily transfer the compiled Godot binaries to the Raspberry Pi using rsync
Shell
28
star
11

aseprite-to-godot-variables

A Lua script to create arrays of colors and indexes of those colors from an Aseprite sprite to be used in Godot.
Lua
23
star
12

Lospec-Palette-List

Browse through thousands of awesome Lospec palettes
GDScript
22
star
13

Murtop-Raspberry-Pi-Bartop-Arcade-Machine-Project

Personal project to create an actual playable Bartop Arcade Machine from scratch using a Raspberry Pi with RetroPie and lots of wood, paint and wires :)
20
star
14

Godot-3-2D-Fake-Explosion-Particles

A script to simulate exploding particles.
GDScript
18
star
15

Godot-3-2D-Fake-Snow-Particles

A script to simulate snow particles ❄️
GDScript
18
star
16

Godot-3-2D-Fake-Confetti-Particles

A script to simulate confetti particles 🎉
GDScript
14
star
17

RetroPie-Itchio-Godot-Scraper

A tool for RetroPie to scrape Godot games hosted on https://itch.io.
Shell
12
star
18

RetroPie-Convert-Videos

A tool for RetroPie to convert videos.
Shell
12
star
19

ppa

A PPA repository for my packages (Godot)
Shell
8
star
20

Godot-3-2D-Draw-Sprite

A script to create "sprites" using the _draw() function to easily create patterns, change the color palette, or change the pixel size.
GDScript
8
star
21

es-pixel-theme-extras

Script for RetroPie to install some extras for the EmulationStation's Pixel theme (Retropie menu icons, boot splashscreen and launching images)
Shell
5
star
22

RetroPie-Shell-Script-Boilerplate

A template for building shell scripts for RetroPie.
Shell
4
star
23

RetroPie-Fun-Facts-Splashscreens

A tool for RetroPie to generate splashscreens with random video game related Fun Facts!.
Shell
4
star
24

Godot-2D-Platformer-Test

GDScript
2
star
25

RetroPie-Limit-Last-Played-Games

A tool for RetroPie to limit the number of 'last played' games.
Shell
2
star
26

es-theme-extras

Script for RetroPie to install some extras for EmulationStation themes (icons, splashscreens and launching images)
Shell
1
star
27

Stylus-Mixins

A set of Stylus mixins
CSS
1
star
28

barcelona-bicycle-anchor-points

Find public bicycle anchor points near you in Barcelona!
JavaScript
1
star
29

RetroPie-Extras

A collection of my own scripts for RetroPie
1
star
30

lospec-api

An API for the Lospec Palette List
JavaScript
1
star
31

RetroPie-Murtop

A script to install Murtop on Retropie
Shell
1
star