diff --git a/addons/post_processing/node/children/ChromaticAberration.tscn b/addons/post_processing/node/children/ChromaticAberration.tscn index 8d66993..0491e51 100644 --- a/addons/post_processing/node/children/ChromaticAberration.tscn +++ b/addons/post_processing/node/children/ChromaticAberration.tscn @@ -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="."] diff --git a/addons/post_processing/node/post_process.gd b/addons/post_processing/node/post_process.gd index 9972263..3d31863 100644 --- a/addons/post_processing/node/post_process.gd +++ b/addons/post_processing/node/post_process.gd @@ -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(): @@ -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() @@ -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