mrjs
mrjs copied to clipboard
notes - figure out why we have way too many draw calls / fix for reducing the number of redundant glPrograms
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
- DOCUMENTATION: This includes any changes to html tags and their components
Your Render PR Server URL is https://examples-mrjs-pr-652.onrender.com.
Follow its progress at https://dashboard.render.com/static/srv-cp17fegl6cac73emhid0.
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
down from 22 --> 14 draw calls --> still looking into
still looking into ways to reduce the number of glPrograms, but here's where we're at for now
same out come
- 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
- 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
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