Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ shader = ExtResource("1_qxjen")
shader_parameter/offset = 5.23

[node name="ChromaticAberration" type="CanvasLayer"]
visible = false
layer = 102

[node name="data" type="ColorRect" parent="."]
Expand Down
16 changes: 10 additions & 6 deletions addons/post_processing/node/post_process.gd
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ extends CanvasLayer

@export_category("Post Process")
@export var configuration : PostProcessingConfiguration
@export var dynamically_update : bool = true

func _update_shaders() -> void:
func update_shaders() -> void:
if not configuration:
return
for child in get_children():
Expand Down Expand Up @@ -139,7 +140,7 @@ func _enter_tree():
_add_canvas_layer_children("res://addons/post_processing/node/children/ascii.tscn", "ASCII")
_add_canvas_layer_children("res://addons/post_processing/node/children/CRT.tscn", "CRT")

_update_shaders()
update_shaders()

func _add_canvas_layer_children(_path : String, _name: String) -> void:
var child_instance = load(_path).instantiate()
Expand All @@ -151,7 +152,10 @@ func _add_canvas_layer_children(_path : String, _name: String) -> void:
func _process(delta):
if not configuration:
return
if Engine.is_editor_hint() or !Engine.is_editor_hint():
if configuration.reload == true:
_update_shaders()
configuration.reload = false
if Engine.is_editor_hint():
return
if not dynamically_update:
return
if configuration.reload:
update_shaders()
configuration.reload = false