Skip to content
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

Further BrushRenderer optimizations #2169

Open
1 of 2 tasks
ericwa opened this issue Jul 7, 2018 · 0 comments · May be fixed by #3598
Open
1 of 2 tasks

Further BrushRenderer optimizations #2169

ericwa opened this issue Jul 7, 2018 · 0 comments · May be fixed by #3598
Assignees
Labels
Prio:3 Low priority: Minor problems and nice to have features Type:Enhancement New features

Comments

@ericwa
Copy link
Collaborator

ericwa commented Jul 7, 2018

Continuing from #2151 and our discussion on it:

  • It should be possible to combine the 3 BrushRenderers (default, selected, locked) in to 1.
    This will involve adding space for a flag to the vertex struct to indicate default, selected, or locked, and changes to the shaders to use the flag.

    It will require changes to the BrushRenderer::Filter API again. The new filter API will probably involve the subclass setting a flag on each face indicating whether the face is unselected, selected, locked, or hidden. BrushRenderer::validateBrush will then loop through the BrushRendererBrushCache::CachedFace's, which give the range of vertices for each face, and update the rendering flags in the VBO for those vertices without doing any other work.

    Will need to be careful with handling of opaque/transparent status of faces. It would be nice if re-evaluating a Brush's Filter was guaranteed to be fast and only update the rendering flag in the VBO, but if the opaque/transparent status changes, we'll need to remove and re-insert the brush into a different VBO, as BrushRenderer currently does in 1404: BrushRenderer rewrite with partial VBO updates #2151 .

    Benefits will include:

    • fewer draw calls when there are a mix of selected/locked/unselected brushes on screen
    • less work to do when selecting/unselecting, locking/unlocking, or hiding/unhiding lots of brushes, so these actions should hopefully feel instant even on huge maps
  • Vbo/VboBlock can be refactored to use AllocationTracker. Alternatively, we could use an actual OpenGL buffer per VboBlock - although it's not clear if there's any benefit to doing that and it might be a more disruptive change (?). (Edit: done during Qt port)

@ericwa ericwa added Type:Enhancement New features Prio:3 Low priority: Minor problems and nice to have features labels Jul 7, 2018
@ericwa ericwa self-assigned this Jul 7, 2018
@ericwa ericwa added this to the 2020.3 milestone Aug 22, 2020
@ericwa ericwa modified the milestones: 2020.3, 2020.4 Dec 13, 2020
@ericwa ericwa removed this from the 2021.2 milestone Apr 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prio:3 Low priority: Minor problems and nice to have features Type:Enhancement New features
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant