-
Notifications
You must be signed in to change notification settings - Fork 299
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
Complete glium.rs
backend and update glutin_glium.rs
example accordingly.
#852
Complete glium.rs
backend and update glutin_glium.rs
example accordingly.
#852
Conversation
example. Implement drawing for Image example (should be working but is not, will fix this in a following commit). Abstract image_map creation in examples/support module.
Added an image mode to fix image drawing. Avoid entering new Commands when rendering the same image multiple times in a row. Moved the event polling before the rendering for quicker feedback.
glium backend now provides a new Renderer type designed specifically for rendering `render::Primitives` to a `glium::Surface`. It does this in a modular process through public methods which the user can access in the case that they require more granular control.
…vides another way
386bf50
to
937af18
Compare
Travis' failure is due to some breakage upstream when compiling gfx with nightly. Going to merge! |
@Boscop did you say you were using glium? If so you might be interested in this. |
Thanks @mitchmindtree, great work! |
@Boscop Yep! |
Ok, great. If I want to draw my glium widgets in a certain rect area that will be spared out by conrod rendering, what's the best way to calculate the rect pos / size to align the areas? |
Hmmm not 100% sure what you mean by this? |
I mean I want to render some of my GUI in conrod, and some of it in glium with shaders, so I draw the glium stuff first, and then conrod over it, but how can I prevent conrod from drawing its background over what I drew underneath? |
@mitchmindtree For example, let's say I want to render my midi view with glium because it has so many rectangles for the notes and I want to batch draw them in a shader. But I want to draw the rest of the GUI with conrod so that I can have sliders and dropdown menus etc. |
The
glium
backend feature is now complete! Big thanks to @clicketyclack for kicking this off :)The implementation uses a single shader program to render the entire GUI. For GUIs consisting of purely text and shapes, the entire GUI will be drawn with a single draw call. Otherwise a new unique draw call will be required for each new image and scizzor that appears, however we might be able to improve this using a TextureArray or mapping to a single texture in the future if necessary.
After updating the
glutin_glium.rs
example, I did some profiling and found the changes to be a significant improvement over theall_widgets.rs
example (the same gui but rendered via piston_window).The
all_widgets.rs
example (piston_window
backend) idles at ~6.5% CPU, draws 60 frames of text at about ~60% CPU and at about ~65% CPU when scrolling.On the other hand, the
glutin_glium.rs
example idles at about 1% CPU (though I anticipate this to drop further once we configure the gui to only update upon new input events). When usingui.draw
instead ofui.draw_if_changed
(and in turn uploading to the GPU roughly 60 times per second) the example peaks about about 7% - a very promising sign for heavily animated GUIs like timelines, etc. When scrolling continuously over large blocks of text it peaked at around 20%, though the vast majority of this time was spent in rusttype's glyph cache.Here are some pics!
Room for improvement
Closes #752.