You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+46-31Lines changed: 46 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,101 +3,115 @@
3
3
A 2D shader for Godot 3 simulating a CRT.
4
4
5
5

6
-

6
+

7
7
8
8
## Usage
9
9
10
10
* Create a `CanvasLayer`.
11
11
* Add a `ColorRect` as a child node of the `CanvasLayer`.
12
12
* In the `ColorRect` properties:
13
13
* Go to the **Material** section.
14
-
* Click on the `[empty]`**Material** and load `crt_material.tres`.
14
+
* Click on the `[empty]`dropdown from **Material** and load `crt_material.tres`.
15
15
16
-
If for for reason, when loading the `crt_material.tres`, the `crt.shader` is empty, just open it with any text editor, copy the code in the **Shader** editor and save it.
16
+
### Note
17
+
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.
17
18
18
19
## Shader Parameters
19
20
20
-
### Boost
21
+
### Screen size
21
22
22
23
| Name | Type | Default | Description |
23
24
| --- | --- | --- | --- |
24
-
|`boost`|`float`|`1.2`| Gives extra brightness to compensate for the grille, the scanlines and the vignette. Range from `1.0` to `2.0` with `0.01` steps. |
25
+
|`screen_size`|`vec2`|`vec2(320.0, 180.0)`| The size of your project's `display/window/size`. |
25
26
26
-
### Grille opacity
27
+
### Show curvature
27
28
28
29
| Name | Type | Default | Description |
29
30
| --- | --- | --- | --- |
30
-
|`grille_opacity`|`float`|`0.85`| Controls the opacity of the grille. `0.0` is complete opaque. Range from `0.0` to `1.0` with `0.01` steps. |
31
+
|`show_curvature`|`bool`|`true`| Enables/disables the curvature effect. |
31
32
32
-
### Scanlines opacity
33
+
Works best in `window/stretch/mode="2d"`.
34
+
35
+
### Curvature X amount
33
36
34
37
| Name | Type | Default | Description |
35
38
| --- | --- | --- | --- |
36
-
|`scanlines_opacity`|`float`|`0.95`| Controls the opacity of the scanlines. `0.0` is complete opaque. Range from `0.0` to `1.0` with `0.01` steps. |
39
+
|`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. |
37
40
38
-
### Vignette opacity
41
+
### Curvature Y amount
39
42
40
43
| Name | Type | Default | Description |
41
44
| --- | --- | --- | --- |
42
-
|`vignette_opacity`|`float`|`0.2`| Controls the opacity of the vignette. Range from `0.1` to `0.5` with `0.01` steps. |
45
+
|`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. |
43
46
44
-
### Scanlines speed
47
+
### Corner color
48
+
| Name | Type | Default | Description |
49
+
| --- | --- | --- | --- |
50
+
|`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. |
51
+
52
+
### Show vignette
45
53
46
54
| Name | Type | Default | Description |
47
55
| --- | --- | --- | --- |
48
-
|`scanlines_speed`|`float`|`1.0`|Controls the speed of the scanlines. Range from `0.0` to `1.0` with `0.01` steps. |
56
+
|`show_vignette`|`bool`|`true`|Enables/disables the vignette effect. |
49
57
50
-
### Show grille
58
+
### Vignette opacity
51
59
52
60
| Name | Type | Default | Description |
53
61
| --- | --- | --- | --- |
54
-
|`show_grille`|`bool`|`true`|Enables/disables the grille. |
62
+
|`vignette_opacity`|`float`|`0.2`|Controls the opacity of the vignette. Range from `0.0` to `1.0` with `0.01` steps. |
55
63
56
-
### Show scanlines
64
+
### Show horizontal scan lines
57
65
58
66
| Name | Type | Default | Description |
59
67
| --- | --- | --- | --- |
60
-
|`show_scanlines`|`bool`|`true`|Enable/disable the scanlines. |
68
+
|`show_horizontal_scan_lines`|`bool`|`true`|Enables/disables the horizontal scan lines. |
61
69
62
-
### Show vignette
70
+
### Horizontal scan lines amount
63
71
64
72
| Name | Type | Default | Description |
65
73
| --- | --- | --- | --- |
66
-
|`show_vignette`|`bool`|`true`|Enables/disables the vignette. |
74
+
|`horizontal_scan_lines_amount`|`float`|`180.0`|Controls how many horizontal scan lines appear. |
67
75
68
-
### Show curvature
76
+
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.
77
+
78
+
### Horizontal scan lines opacity
69
79
70
80
| Name | Type | Default | Description |
71
81
| --- | --- | --- | --- |
72
-
|`show_curvature`|`bool`|`true`|Enables/disables the curvature. |
82
+
|`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. |
73
83
74
-
Works best in `window/stretch/mode="2d"`.
84
+
### Show vertical scan lines
75
85
76
-
### Screen size
86
+
| Name | Type | Default | Description |
87
+
| --- | --- | --- | --- |
88
+
|`show_vertical_scan_lines`|`bool`|`true`| Enables/disables the vertical scan lines. |
89
+
90
+
### Vertical scan lines amount
77
91
78
92
| Name | Type | Default | Description |
79
93
| --- | --- | --- | --- |
80
-
|`screen_size`|`vec2`|`(320.0, 180.0)`| Controls how many grille lines and scanlines appear. Having fewer grille lines and scanlines will make them larger, which makes it harder for the moire effect to appear. |
94
+
|`vertical_scan_lines_amount`|`float`|`320.0`| Controls how many vertical scan lines appear. |
81
95
82
-
Setting it to your project's `windows/size` should work fine, but you can play with it to get the results best fitted to your liking.
96
+
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.
83
97
84
-
### Aberration amount
98
+
### Vertical scan lines opacity
85
99
86
100
| Name | Type | Default | Description |
87
101
| --- | --- | --- | --- |
88
-
|`aberration_amount`|`float`|`0.0`| Controls the amount of chromatic aberration. Range from `0.0` to `10.0` with `1.0` steps. |
102
+
|`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. |
89
103
90
-
### Move aberration
104
+
### Boost
91
105
92
106
| Name | Type | Default | Description |
93
107
| --- | --- | --- | --- |
94
-
|`move_aberration`|`bool`|`false`|Enables/disables the chromatic aberration movement. |
108
+
|`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. |
95
109
96
-
### Aberration speed
110
+
### Aberration amount
97
111
98
112
| Name | Type | Default | Description |
99
113
| --- | --- | --- | --- |
100
-
|`aberration_speed`|`float`|`1.0`| Controls the speed of the moving chromatic aberration (the greater the value the slower the movement). Range from `0.01` to `10.0` with `0.01` steps. |
114
+
|`aberration_amount`|`float`|`0.0`| Controls the amount of chromatic aberration. Range from `0.0` to `10.0` with `1.0` steps. |
101
115
102
116
## Changelog
103
117
@@ -114,6 +128,7 @@ Thanks to:
114
128
***knarkowicz** - For the orginal shader code, taken from https://www.shadertoy.com/view/XtlSD7.
115
129
*[CowThing](https://github.com/CowThing) - For helping **a lot** in bringing actual distortion and many other improvements to the shader with [#1](https://github.com/hiulit/Godot-3-2D-CRT-Shader/pull/1).
116
130
*[uheartbeast](https://twitter.com/uheartbeast) - For the amazing [chromatic aberration shader video tutorial](https://www.youtube.com/watch?v=-PJOHAsBcoI).
131
+
*[Tom (Let's GameDev)](https://twitter.com/letsgamedev) - For the amazing [CRT shader video tutorial](https://www.youtube.com/watch?v=Dn8joy4tP2Q), which I took the scan lines from.
0 commit comments