-
-
Notifications
You must be signed in to change notification settings - Fork 384
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor the selection system to use an Image instead of a BitMap #710
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OverloadedOrama
force-pushed
the
selection-images
branch
from
June 26, 2022 21:26
fa38bdc
to
136dd03
Compare
OverloadedOrama
force-pushed
the
selection-images
branch
from
July 11, 2022 17:53
136dd03
to
01ea94d
Compare
OverloadedOrama
force-pushed
the
selection-images
branch
2 times, most recently
from
July 27, 2022 22:27
adf9b64
to
043f6a9
Compare
Not complete and Pixelorama is currently broken
Intersection and transforming are not working
OverloadedOrama
force-pushed
the
selection-images
branch
from
August 5, 2022 15:14
043f6a9
to
0cb74f7
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Requires Godot 3.5 and above. Builds will most likely fail because of this and this PR will not be merged until Godot 3.5-stable is released and Pixelorama's workflows start using it.
This PR replaces the BitMap that was used to store the selected state of the pixels with an LA8 Image. This massively improves performance, since we get rid of the slow bitmap-to-image conversion. Images were used anyway for the selection marching ants outline to be drawn, and for shaders to use them as masks.
I have also refactor the selection code by making a new
SelectionMap
class that extends Image, and moved some methods from Project.gd to the new class, therefore making the code cleaner and putting the methods to a more correct place.A comparison of approximate common timings of full canvas selections using the Rectangular Selection tool, between the current and the new method.
The Select by Color tool now uses a shader for faster results, and a color similarity option has been added, similar to the same color fill in the Bucket tool. The below approximate timings were tested on blank canvases. Tested on an AMD Ryzen 5 1600 CPU and a NVIDIA GTX 1060 6GB GPU, on openSUSE Tumbleweed.