adjust CRT Shader

This commit is contained in:
Fabio 2024-08-19 04:36:22 +02:00
parent ddd0fdff22
commit 16004c33c0
6 changed files with 27 additions and 14 deletions

View file

@ -130,6 +130,9 @@ shader_parameter/scroll_speed = 0.02
position = Vector2(-254, 99)
input_pickable = true
[node name="CanvasLayer" parent="." index="1"]
visible = true
[node name="Walls" parent="." index="3"]
collision_mask = 22

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=5 format=3 uid="uid://bvvxwhg4tihng"]
[gd_scene load_steps=6 format=3 uid="uid://bvvxwhg4tihng"]
[ext_resource type="Theme" uid="uid://cohbys634cf18" path="res://menu/main_menu/MainMenuTheme.tres" id="1_3v0vu"]
[ext_resource type="Texture2D" uid="uid://dr4ayedb5xb2k" path="res://textures/file_editor.png" id="1_44xee"]
[ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_crosg"]
[ext_resource type="Script" path="res://scripts/level_select.gd" id="2_nurro"]
[ext_resource type="PackedScene" uid="uid://t83eid7pf4iv" path="res://menu/level_menu/level_button.tscn" id="4_0d7hu"]
@ -14,6 +15,8 @@ grow_horizontal = 2
grow_vertical = 2
script = ExtResource("2_nurro")
[node name="CanvasLayer" parent="." instance=ExtResource("2_crosg")]
[node name="Background" type="TextureRect" parent="."]
layout_mode = 1
anchors_preset = 15

View file

@ -1,7 +1,8 @@
[gd_scene load_steps=3 format=3 uid="uid://cut2xjnvh8i58"]
[gd_scene load_steps=4 format=3 uid="uid://cut2xjnvh8i58"]
[ext_resource type="Theme" uid="uid://cohbys634cf18" path="res://menu/main_menu/MainMenuTheme.tres" id="1_tmf11"]
[ext_resource type="Script" path="res://scripts/menu_credit_control.gd" id="2_ogwi7"]
[ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="3_rybt6"]
[node name="CreditScene" type="MarginContainer"]
anchors_preset = 15
@ -11,10 +12,6 @@ grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_tmf11")
[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 2
color = Color(0, 0, 0, 1)
[node name="Control" type="Control" parent="."]
layout_mode = 2
script = ExtResource("2_ogwi7")
@ -23,3 +20,9 @@ script = ExtResource("2_ogwi7")
layout_mode = 0
offset_right = 40.0
offset_bottom = 13.0
[node name="CanvasLayer" parent="Control" instance=ExtResource("3_rybt6")]
[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 2
color = Color(0, 0, 0, 1)

View file

@ -1,8 +1,9 @@
[gd_scene load_steps=4 format=3 uid="uid://1h2urto6y63r"]
[gd_scene load_steps=5 format=3 uid="uid://1h2urto6y63r"]
[ext_resource type="FontFile" uid="uid://d3pbvdemdbxes" path="res://CommodoreSixtyFour.ttf" id="1_1tx2i"]
[ext_resource type="Theme" uid="uid://cohbys634cf18" path="res://menu/main_menu/MainMenuTheme.tres" id="1_kkajn"]
[ext_resource type="Script" path="res://scripts/menu_main_control.gd" id="2_g8c7b"]
[ext_resource type="PackedScene" uid="uid://dii1q3f5dj72y" path="res://objects/CRT.tscn" id="2_hal3l"]
[node name="MainMenu" type="MarginContainer"]
anchors_preset = 15
@ -12,6 +13,8 @@ grow_horizontal = 2
grow_vertical = 2
theme = ExtResource("1_kkajn")
[node name="CanvasLayer" parent="." instance=ExtResource("2_hal3l")]
[node name="ColorRect" type="ColorRect" parent="."]
layout_mode = 2
color = Color(0, 0, 0, 1)

View file

@ -4,11 +4,11 @@
[sub_resource type="ShaderMaterial" id="ShaderMaterial_c8ly2"]
shader = ExtResource("1_wsc8u")
shader_parameter/crt_curve = 0.01
shader_parameter/crt_scan_line_color = 0.178
shader_parameter/aperture_grille_rate = 0.141
shader_parameter/rf_switch_esque_blur = 1.0
shader_parameter/white_noise_rate = 0.0
shader_parameter/crt_curve = 0.015
shader_parameter/crt_scan_line_color = 0.347
shader_parameter/aperture_grille_rate = 1.0
shader_parameter/rf_switch_esque_blur = 0.21
shader_parameter/white_noise_rate = 0.184
[node name="CanvasLayer" type="CanvasLayer"]
@ -19,3 +19,4 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2

View file

@ -8,7 +8,7 @@ uniform sampler2D screen_texture : hint_screen_texture;
// ブラウン管のガラスの曲がり具合フラットなやつは0.0でいいかな)
uniform float crt_curve : hint_range( 0.0, 1.0 ) = 0.02;
// 走査線の濃さ
// 走査線の濃さ
uniform float crt_scan_line_color : hint_range( 0.0, 1.0 ) = 0.347;
// 光量
uniform float aperture_grille_rate : hint_range( 0.0, 1.0 ) = 0.4;
@ -18,7 +18,7 @@ uniform float rf_switch_esque_blur : hint_range( 0.0, 1.0 ) = 1;
uniform float white_noise_rate : hint_range( 0.0, 1.0 ) = 0.0;
float random( vec2 pos )
{
{
return fract(sin(dot(pos, vec2(12.9898,78.233))) * 43758.5453);
}