Increase Render Efficiency #10
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: experiments/cellular-automata#10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
currently on every render step the whole canvas gets wiped and then redrawn.
It might be more efficient to only render the parts of the canvas which are actually in need of being redrawn (i.e. cells which changed)
By not updating the whole canvas every frame (through adding a bg colored box) and instead only re-rendering the little squares that need it, we could save a lot of re-rendering work.
An idea would be to keep a list of all squares changed in the last update and re-render them (and their neighbors?) by adding boxes of the background color or cell color respectively. All other boxes are not affected, the overall grid does not need to be redrawn.
Check with profiling first if this actually improves app speed!
changed milestone to %2
changed milestone to %3