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

notes - figure out why we have way too many draw calls / fix for reducing the number of redundant glPrograms #652

Draft
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

hanbollar
Copy link
Contributor

@hanbollar hanbollar commented May 13, 2024

Linking

related to #651

Problem

Description of the problem including potential code and/or screenshots as an example

Solution

Quick explanation of change to be done

Breaking Change

If this is a breaking change describe the before and after and why the change was necessary

Notes

Notes and any associated research or links


Required to Merge

  • PASS - all necessary actions must pass (excluding the auto-skipped ones)
  • TEST IN HEADSET - main dev-testing-example and any of the other examples still work as expected
  • VIDEO - if this pr changes something visually - post a video here of it in headset-MR and/or on desktop (depending on what it affects) for the reviewer to reference.
  • TITLE - make sure the pr's title is updated appropriately as it will be used to name the commit on merge
  • BREAKING CHANGE
    • DOCUMENTATION: This includes any changes to html tags and their components
      • make a pr in the documentation repo that updates the manual docs to match the breaking change
      • link the pr of the documentation repo here: #pr
      • that pr must be approved by @lobau
    • SAMPLES/INDEX.HTML: This includes any changes (html tags or otherwise) that must be done to our landing page submodule as an effect of this pr's updates
      • make a pr in the mrjs landing page repo that updates the landing page to match the breaking change
      • link the pr of the landing page repo here: #pr
      • that pr must be approved by @hanbollar

Signed-off-by: hanbollar <[email protected]>
Copy link

render bot commented May 13, 2024

Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
@hanbollar
Copy link
Contributor Author

hanbollar commented May 13, 2024

the issue

the issue is due to too many materials being created with new that are redundant to each other - where their differences are just selected uniform variables

the supposed fix i found

instead of doing new everywhere, we should grabbing from a catalogue of materials unless a user creates something specific (for normal and debug items) and use the uniforms properly for differences.


implementing now to confirm

Signed-off-by: hanbollar <[email protected]>
@hanbollar
Copy link
Contributor Author

hanbollar commented May 13, 2024

down from 22 --> 14 draw calls --> still looking into

Screenshot 2024-05-13 at 3 13 30 PM

Signed-off-by: hanbollar <[email protected]>
@hanbollar
Copy link
Contributor Author

Screenshot 2024-05-13 at 7 28 31 PM

still looking into ways to reduce the number of glPrograms, but here's where we're at for now

@hanbollar hanbollar changed the title WIP - figure out why we have way too many draw calls WIP - figure out why we have way too many draw calls / fix for reducing the number of redundant glPrograms May 14, 2024
@hanbollar
Copy link
Contributor Author

Screenshot 2024-05-16 at 5 11 50 PM

Signed-off-by: hanbollar <[email protected]>
@hanbollar
Copy link
Contributor Author

Screenshot 2024-05-16 at 5 33 32 PM

same out come

Signed-off-by: hanbollar <[email protected]>
@hanbollar
Copy link
Contributor Author

  • number of draw calls depends on number of models in scene with differing materials (including text and otherwise)
  • draw call count changes depending on what is within frustum area
  • glprogram count increases as scene loads in (and scroll down to new items) - until has loaded int data all items from scene

things to do:

  • see if can optimize troika material setup / reusability
  • instancing geometry (that's a future pr)
  • LOD - i think we're okay on this being something user specified if they want to define that in the scene directly

@hanbollar
Copy link
Contributor Author

  • number of draw calls depends on number of models in scene with differing materials (including text and otherwise)
  • draw call count changes depending on what is within frustum area
  • glprogram count increases as scene loads in (and scroll down to new items) - until has loaded int data all items from scene

things to do:

  • see if can optimize troika material setup / reusability
  • instancing geometry (that's a future pr)
  • LOD - i think we're okay on this being something user specified if they want to define that in the scene directly

we're going to need an actual material caching system setup - same thing with geometry instancing

@hanbollar
Copy link
Contributor Author

turning this into a draft since we'll be doing a rework of MeshInstancing and MaterialInstancing in a future pr and those are super relevant to this getting improved

@hanbollar hanbollar marked this pull request as draft May 18, 2024 04:09
@hanbollar hanbollar changed the title WIP - figure out why we have way too many draw calls / fix for reducing the number of redundant glPrograms notes - figure out why we have way too many draw calls / fix for reducing the number of redundant glPrograms May 18, 2024
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.

None yet

1 participant