Home

Awesome

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

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

NameTypeDefaultDescription
screen_sizevec2vec2(320.0, 180.0)The size of your project's display/window/size.

Show curvature

NameTypeDefaultDescription
show_curvaturebooltrueEnables/disables the curvature effect.

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

Curvature X amount

NameTypeDefaultDescription
curvature_x_amountfloat6.0Controls 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

NameTypeDefaultDescription
curvature_y_amountfloat6.0Controls 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

NameTypeDefaultDescription
corner_colorvec4vec4(0.0, 0.0, 0.0, 1.0)The color of the blank space on the corners left by the curvature.

Show vignette

NameTypeDefaultDescription
show_vignettebooltrueEnables/disables the vignette effect.

Vignette opacity

NameTypeDefaultDescription
vignette_opacityfloat0.2Controls the opacity of the vignette. Range from 0.0 to 1.0 with 0.01 steps.

Show horizontal scan lines

NameTypeDefaultDescription
show_horizontal_scan_linesbooltrueEnables/disables the horizontal scan lines.

Horizontal scan lines amount

NameTypeDefaultDescription
horizontal_scan_lines_amountfloat180.0Controls 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

NameTypeDefaultDescription
horizontal_scan_lines_opacityfloat1.0Controls 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

NameTypeDefaultDescription
show_vertical_scan_linesbooltrueEnables/disables the vertical scan lines.

Vertical scan lines amount

NameTypeDefaultDescription
vertical_scan_lines_amountfloat320.0Controls 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

NameTypeDefaultDescription
vertical_scan_lines_opacityfloat1.0Controls the opacity of the vertical scan lines. 0.0 is complete opaque. Range from 0.0 to 1.0 with 0.01 steps.

Boost

NameTypeDefaultDescription
boostfloat1.2Gives extra brightness to compensate the scanlines and the vignette. Range from 1.0 to 2.0 with 0.01 steps.

Aberration amount

NameTypeDefaultDescription
aberration_amountfloat0.0Controls 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.