ImGui.NET
ImGui.NET copied to clipboard
My font quality is very low
I'm trying to use ImGui.NET with MonoGame but in my project the font quality is very low as you can see on the picture.
My ImGuiRenderer class is the exact same class as the one on the sample project. I also ran the sample project separately and everything is fine there.
That happened to me once, long time ago, basically Nvidia wasn’t Rendering the application intel built-in was. Can you go to Nvidia preference and force this application to use Nvidia dedicated graphic card rather than built-in intel graphic.
It would be a strong possibility but I'm using a desktop with Nvidia only graphics so that's not my issue. Thank you anyways!
Just to clarify: the (XNA) example project in here works fine for you? If that's the case, then perhaps your project is setting some global graphics state that is affecting how ImGui is rendered? It might be a good idea to take other components out of your project and see if that has any effect, and then try adding things back one-by-one.
That didn't work. I also tried to create a band new project and it didn't work too.
I'm sure it's not a bug of Imgui.net, and more somewhere else, but I have the exact same issue in my Monogame app:

This happens on my desktop with a GTX 1080, and on my laptop it only happens when I use my RTX 2060 in it. If it uses the Intel IGPU rendering works fine. So it seems like something I'm doing and the original poster is doing is messing up with the rendering (or the font aliasing?).
If anyone is curious I have mostly tracked this down (though it's not perfect).
This seems to occur for me when on Nvidia GPUs (maybe AMD? I don't have one to test) when the GPU's samplerStates[0] is using point filtering, which the engine I'm using is using. In order to fix it my ImGui's render method now looks like:
var oldSamplerState = _game.GraphicsDevice.SamplerStates[0];
_game.GraphicsDevice.SamplerStates[0] = SamplerState.LinearClamp;
var gameTime = TimeManager.CurrentTime;
_renderer.BeforeLayout(gameTime);
// Iterate through imgui controls/windows and render them
_renderer.AfterLayout();
_game.GraphicsDevice.SamplerStates[0] = oldSamplerState;
The text is a bit fuzzy (especially compared to the imgui.net monogame demo) but it's getting closer at least.
Using the same trick, but using PointClamp instead. The result is only good with some fonts at some size, but at least it's descent now
I finally figured out the true cause of this, and then realized this was already figured out in another issue.
See #97, Essentially make your MonoGame ImGui renderer have an offset of 0 instead of 0.5 (though MG 3.8 might be required for this to be universally fixed). This makes all text crystal clear for me.
It's not just the font that's a problem, I always knew ImGui as a pixel perfect UI but something is wrong now
Some characters are just wrong too, look at the "m" in sampler or frame, some other characters seem off as well.
None of these problems are in the Sample Project, only external projects. *In my situation It's Terraria which uses the normal XNA libraries, not MonoGame.
Man, how did you integrated ImGUI into Terraria? I've tried but have been problems with .NET Framework 4.5 (for Terraria) and the fact that ImGUI is using .NET Standart 2.0
Man, how did you integrated ImGUI into Terraria? I've tried but have been problems with .NET Framework 4.5 (for Terraria) and the fact that ImGUI is using .NET Standart 2.0
Not the place to ask, dm me on Discord Kyle#0420
Some characters are just wrong too, look at the "m" in sampler or frame, some other characters seem off as well.