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

OpenGL rendering issues (was: Problem with fonts) #1459

Closed
hateom opened this issue Nov 24, 2017 · 14 comments
Closed

OpenGL rendering issues (was: Problem with fonts) #1459

hateom opened this issue Nov 24, 2017 · 14 comments

Comments

@hateom
Copy link

hateom commented Nov 24, 2017

I managed to integrate the ImGui in my custom OpenGL platform, but I can't get the fonts to render properly. Can you please point me in the right direction?

This is what I see when I try to use the demo in my environment:
https://www.dropbox.com/s/btjcevq6zqxw8dq/imgui_problem.png?dl=0

@ocornut
Copy link
Owner

ocornut commented Nov 24, 2017 via email

@hateom
Copy link
Author

hateom commented Nov 24, 2017

I based my code on opengl2_example - modified imgui_impl_glfw files to hook up the input and modified a bit some viewport & ortho setup.
Thanks for the feedback - will try the mentioned methods.

Attaching the image again for further reference:

imgui_problem

@ocornut
Copy link
Owner

ocornut commented Nov 24, 2017 via email

@hateom
Copy link
Author

hateom commented Nov 24, 2017

Agreed, but my host application where I'm integrating imgui supports only OpenGL 2.1.

@ocornut
Copy link
Owner

ocornut commented Nov 24, 2017

Fair!
Then hmm I don't know what's wrong.
The vertices position and colors are correct, so I would guess the UV are probably correct as well. Something related to texture binding? RenderDoc would definitively help you.

@hateom
Copy link
Author

hateom commented Nov 24, 2017

Will try it for sure. Thanks for the tip.

@hateom
Copy link
Author

hateom commented Nov 24, 2017

The weird part is that I just tried it on windows, and the fonts work OK.
The previous screenshot was from Mac OS.
However there's still something weird going on at the edges of the windows and around the expandable triangles:

screenshot 2017-11-24 17 17 15

I will keep digging.

@ocornut
Copy link
Owner

ocornut commented Jan 10, 2018

@hateom Hello! Any progress on it? The last screenshot, could it be a problem with your backface culling setup?

@hateom
Copy link
Author

hateom commented Mar 2, 2018

Hey, I stopped the project for now. I can only report that when using OpenGL 3.3 everything works fine. Will try to see if there's a way to switch from 2.1 to 3+.

@ocornut ocornut closed this as completed Aug 5, 2018
@hateom
Copy link
Author

hateom commented Aug 6, 2018

Just to give feedback - it was a problem with the OpenGL 2 example implementation.
I had to adjust the OpenGL 3+ code for the OpenGL 2.1 compatibility mode on macOS (using some Apple specific extensions like: glBindVertexArrayAPPLE). After doing that everything is fine.

@ocornut ocornut added the opengl label Aug 6, 2018
@ocornut ocornut reopened this Aug 6, 2018
@ocornut
Copy link
Owner

ocornut commented Aug 6, 2018

Would be interested in details if you remember them. You mention replacing glBindVertexArray with glBindVertexArrayAPPLE, but the problem above was when using imgui_impl_opengl2.cpp which doesn't use this function.

GL cross-platform compatibility and examples is still a tedious mess, sorry this is getting me grumpy so often :( Any extra data point is helpful at least we have records.

@ocornut
Copy link
Owner

ocornut commented Aug 6, 2018

According to #1900 our example are mislabeled and opengl3/ code could run on a 2.x context. We do have GLSL 120 shaders which are compatible with GL 2.1. The main obstacle with using imgui_impl_opengl3.cpp is often the confusion with OpenGL loaders. The patch in #2002 aims to simplify that.

@hateom
Copy link
Author

hateom commented Aug 6, 2018

I took the opengl3 example (from that point in time where it had only GLSL 330 shaders) and rewritten them to 120 + replaced the VAO functions with APPLE extensions. So possibly the issue has been resolved since then.

I will grab the latest opengl3 example and see if it works.

@ocornut ocornut added the osx/ios label Aug 6, 2018
@ocornut ocornut changed the title Problem with fonts OpenGL rendering issues (was: Problem with fonts) Aug 6, 2018
@ocornut
Copy link
Owner

ocornut commented Feb 22, 2021

Closing as dangling random backend issue, may or not be resolved or applicable.

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

No branches or pull requests

2 participants