1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Optimize shader-based image effects when there is no selection

This commit is contained in:
Emmanouil Papadeas 2022-04-20 03:06:58 +03:00
parent 1e73ce5aa6
commit 7c6cdadb86
3 changed files with 9 additions and 6 deletions

View file

@ -30,9 +30,10 @@ func _confirmed() -> void:
func commit_action(cel: Image, project: Project = Global.current_project) -> void:
var selection: Image = project.bitmap_to_image(project.selection_bitmap)
var selection_tex := ImageTexture.new()
selection_tex.create_from_image(selection)
if selection_checkbox.pressed and project.has_selection:
var selection: Image = project.bitmap_to_image(project.selection_bitmap)
selection_tex.create_from_image(selection, 0)
if !confirmed:
preview.material.set_shader_param("red", red)

View file

@ -37,9 +37,10 @@ func _confirmed() -> void:
func commit_action(cel: Image, project: Project = Global.current_project) -> void:
var selection: Image = project.bitmap_to_image(project.selection_bitmap)
var selection_tex := ImageTexture.new()
selection_tex.create_from_image(selection)
if selection_checkbox.pressed and project.has_selection:
var selection: Image = project.bitmap_to_image(project.selection_bitmap)
selection_tex.create_from_image(selection, 0)
if !confirmed:
preview.material.set_shader_param("hue_shift_amount", hue_slider.value / 360)

View file

@ -30,9 +30,10 @@ func _confirmed() -> void:
func commit_action(cel: Image, project: Project = Global.current_project) -> void:
var selection: Image = project.bitmap_to_image(project.selection_bitmap)
var selection_tex := ImageTexture.new()
selection_tex.create_from_image(selection)
if selection_checkbox.pressed and project.has_selection:
var selection: Image = project.bitmap_to_image(project.selection_bitmap)
selection_tex.create_from_image(selection, 0)
if !confirmed:
preview.material.set_shader_param("red", red)