Skip to content

Various fixes, cleanup, performance improvements, QoL#86

Merged
Birdy2014 merged 19 commits intomainfrom
various-fixes
Mar 11, 2025
Merged

Various fixes, cleanup, performance improvements, QoL#86
Birdy2014 merged 19 commits intomainfrom
various-fixes

Conversation

@Birdy2014
Copy link
Collaborator

@Birdy2014 Birdy2014 commented Mar 6, 2025

This PR is a disjointed mess of multiple fixes, performance improvements and style changes. It does way too much for one PR, however, I originally just wanted to bundle some very small changes, and it kind of escalated.

Scene save files from the main branch are not compatible and will result in a broken scene.

Memory / Performance:

  • Fixes a memory leak -> lowers the memory consumption from ~500 MB to ~270MB.
  • Adds a shader uniform location cache, removes unnecessary VAO bind calls and merges meshes when possible -> Lowers the per core CPU usage on my machine from around 200% to 160% when running with 120 fps.
  • Fixes the AssetBrowser model preview always being recomputed
  • Adds a "Performance" window (visible in debug mode only) that shows frametime, fps, background threadpool utilization, amount of loaded textures and models

QoL:

  • Moves the Nodes and vertices in such a way that the gizmos are always displayed in the center of object. Previously, the gizmos where shown far away of some buildings. This changes object positions, so we might want to add an option to disable this feature later.
  • Allows the deletion of objects by pressing the delete key while the viewport is focused
  • Show gizmo keybindings in gizmo operation dropdown
  • Adjusts default speed and scale gizmo snap values

Other stuff:

  • Adds compatibility with gcc
  • Renames Texture::m_id to Texture::id. Only private members should be prefixed with m_ and this is just the instance that I really noticed. However there are more occurrences I didn't fix. Maybe I should not bother and remove the commit?
  • Fixes outlines breaking sometimes when switching between albedo and rendered shading mode
  • Fixes not in ObjectSelectionTree not remembering whether they are opened or not if a node is moved before it or if a previous node is deleted

@Birdy2014 Birdy2014 changed the title Draft: Various fixes and cleanup Draft: Various fixes, cleanup and performance improvement Mar 7, 2025
@Birdy2014 Birdy2014 force-pushed the various-fixes branch 2 times, most recently from 7354f5a to 04d4eeb Compare March 8, 2025 22:25
@Birdy2014 Birdy2014 changed the title Draft: Various fixes, cleanup and performance improvement Draft: Various fixes, cleanup, performance improvements, qol Mar 8, 2025
@Birdy2014 Birdy2014 changed the title Draft: Various fixes, cleanup, performance improvements, qol Draft: Various fixes, cleanup, performance improvements, QoL Mar 8, 2025
@Birdy2014 Birdy2014 changed the title Draft: Various fixes, cleanup, performance improvements, QoL Various fixes, cleanup, performance improvements, QoL Mar 8, 2025
@Birdy2014 Birdy2014 force-pushed the various-fixes branch 2 times, most recently from 6b1df21 to 8ab8edd Compare March 10, 2025 00:32
Copy link
Collaborator

@LazyBone2017 LazyBone2017 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Debug Window Works
Gizmos are placed correctly
Increased defaults are there
keybinds are visible
deletion of mouse picked object works
memory usage ~270MB

This barely affects performance as we can only merge 144 meshes
currently. However, this might be improved in the future when textures
are loaded in texture atlases or array textures.
Sometimes, the outlines would take on the shape of trees, because the
tree mask texture was still bound to the texture_opacity sampler.
Previously, the id of each TreeNode was incremental which resulted in
ids changing when nodes where moved.
@Birdy2014 Birdy2014 merged commit bc417d7 into main Mar 11, 2025
2 checks passed
@Birdy2014 Birdy2014 deleted the various-fixes branch March 11, 2025 11:23
@Birdy2014 Birdy2014 restored the various-fixes branch March 11, 2025 11:41
@Birdy2014 Birdy2014 deleted the various-fixes branch March 11, 2025 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants