implement rest of options, including CRT/LCD filter!

This commit is contained in:
Haze Weathers 2024-02-27 22:35:28 -05:00
parent e0e56d3ffa
commit 2da5935c3b
4 changed files with 31 additions and 12 deletions

View file

@ -32,6 +32,20 @@ func change_scene(new_scene: Node) -> void:
viewport.call_deferred("add_child", new_scene)
current_scene = new_scene
func set_scanlines(type: int) -> void:
yield(get_tree(), "idle_frame")
match type:
Options.ScanlineType.NONE:
viewport_container.material.set_shader_param("enabled", false)
Options.ScanlineType.CRT:
viewport_container.material.set_shader_param("enabled", true)
viewport_container.material.set_shader_param("scanline_opacity", Vector2(0.2, 0.0))
viewport_container.material.set_shader_param("brightness", 1.1)
Options.ScanlineType.LCD:
viewport_container.material.set_shader_param("enabled", true)
viewport_container.material.set_shader_param("scanline_opacity", Vector2(0.2, 0.2))
viewport_container.material.set_shader_param("brightness", 1.2)
func _ready() -> void:
var tree := get_tree()
# capture initial scene