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

Improve slider rendering. #205

Merged
merged 2 commits into from
Dec 6, 2016
Merged

Improve slider rendering. #205

merged 2 commits into from
Dec 6, 2016

Conversation

mad-s
Copy link
Contributor

@mad-s mad-s commented Dec 3, 2016

The old code created a framebuffer for every slider drawn, which results in a major performance loss, especially on shared memory systems like integrated GPUs.
The new codes renders a 'ramp', not individual cones, so the sliders look extra smooth.
Also, there is no framebuffer involved, meaning the new sliders can be used on more systems.

Significantly improves looks and performance of sliders, especially on
shared memory graphics models like integegrated GPUs.
No longer renders using cones and a framebuffer, instead renders quads
and triangles for curves, using much less geometry.
@itdelatrisu
Copy link
Owner

Awesome, this looks way better. I'll wait a few days before merging in case anyone else wants to comment. Thanks a lot!

@Lignum
Copy link

Lignum commented Dec 3, 2016

With this change, the slider curve does not render for me anymore. It just looks like this:

I'm on Arch (Linux 4.8.11) with a GTX 760Ti. My OpenGL version string is 4.5.0 NVIDIA 375.20.

On a side note, does this glFlush call serve any purpose? It looks redundant to me.

EDIT: After some investigation, I found the cause of the issue to be here. We can't use the f float suffix unless the GLSL version is at least 120. One way to fix it is to change #version 110 to #version 120, obviously, but just dropping the suffix also worked for me.

@mad-s
Copy link
Contributor Author

mad-s commented Dec 3, 2016

Sorry, I'm not used to writing GLSL 1.1. Should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants