Replies: 1 comment
-
StereoKit does handle all the sorting and instancing for you, so you can interleave as much as you like, guilt-free! The best thing you can do to increase performance is to re-use the same Materials and Meshes as often as you can, allowing StereoKit to draw more items at once and reduce Material swapping. Lines are actually a special system, where all line geometry is put into a single mesh with a special shader! So regardless of how many lines you've added, it only ever costs one draw call :) Text does a similar thing as well, but may fit into multiple meshes depending on the text styling or font you apply to it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I assume SK uses some form of state sorting for optimizing rendering? Or, put differently, is it okay performance-wise to just mix-and-match and interleave draw calls of different types (lines, meshes, etc) and different materials, and SK will optimize during actual rendering? Or do you need to do a bit of manual batching as well?
I see the code in
StereoKitC/systems/render.cpp
sorts on (material, mesh) pairs before rendering, but a different type of geometry, like lines, is then handled differently?Beta Was this translation helpful? Give feedback.
All reactions