You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)
The text was updated successfully, but these errors were encountered:
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 theBrushRendererBrushCache::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:
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)
The text was updated successfully, but these errors were encountered: