mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 09:35:34 +00:00
Terminal textbox and ui
This commit is contained in:
parent
9c24e29009
commit
f1b5251045
12 changed files with 133 additions and 93 deletions
37
Shaders/CRT_Menu.gdshader
Normal file
37
Shaders/CRT_Menu.gdshader
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
//---CRT Shader---
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform float scanline_count : hint_range(0, 1800) = 50.0;
|
||||
uniform sampler2D SCREEN_TEXTURE : hint_screen_texture, filter_linear_mipmap;
|
||||
uniform float x_curve: hint_range(1.0, 10.0) = 3.0;
|
||||
uniform float y_curve: hint_range(1.0, 10.0) = 3.0;
|
||||
|
||||
uniform float aberration_strength: hint_range(-5.0, 5.0) = 3.0;
|
||||
|
||||
|
||||
vec2 uv_curve(vec2 uv)
|
||||
{
|
||||
uv = (uv - 0.5) * 2.0;
|
||||
|
||||
//You can modify the numbers and try different values
|
||||
uv.x *= 1.0 + pow(abs(uv.y) / x_curve, 2.0);
|
||||
uv.y *= 1.0 + pow(abs(uv.x) / y_curve, 2.0);
|
||||
|
||||
uv = (uv/2.0) + 0.5;
|
||||
return uv;
|
||||
}
|
||||
|
||||
void fragment()
|
||||
{
|
||||
//You can modify the *3.0, *-3.0 for a bigger or smaller
|
||||
float r = texture(SCREEN_TEXTURE, uv_curve(SCREEN_UV) + vec2(SCREEN_PIXEL_SIZE.x * 0.0), 0.0).r;
|
||||
float g = texture(SCREEN_TEXTURE, uv_curve(SCREEN_UV) + vec2(SCREEN_PIXEL_SIZE.x * aberration_strength), 0.0).g;
|
||||
float b = texture(SCREEN_TEXTURE, uv_curve(SCREEN_UV) + vec2(SCREEN_PIXEL_SIZE.x *-aberration_strength), 0.0).b;
|
||||
|
||||
//If you dont want scanlines you can just delete this part
|
||||
float s = sin(uv_curve(SCREEN_UV).y * scanline_count * PI * 2.0);
|
||||
s = (s * 0.5 + 0.5) * 0.9 + 0.1;
|
||||
vec4 scan_line = vec4(vec3(pow(s, 0.25)), 1.0);
|
||||
|
||||
COLOR = vec4(r, g, b, 1.0) * scan_line;
|
||||
}
|
||||
1
Shaders/CRT_Menu.gdshader.uid
Normal file
1
Shaders/CRT_Menu.gdshader.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://bee5btjyyqer2
|
||||
Loading…
Add table
Add a link
Reference in a new issue