I got rid of the blurriness with kCAFilterNearest: https://github.com/floooh/sokol-samples/blob/master/metal/osxentry.m#L113 …, for the font texture I use a linear min/mag filter, BUT I noticed on MacOS Mojave that switching to fullscreen is blurry no matter what, switching back to windows it's crisp again (screenshots coming up)
-
-
Replying to @FlohOfWoe
The blurriness I’m talking about isn’t introduced by upscaling/compositing. The worst of it is really just bilinearly upsampling a very small pixel font.
1 reply 0 retweets 0 likes -
Replying to @warrenm
hmm, this is what it looks like for me, the font texture uses MTLSamplerMinMagFilterLinear for min/magFilter and MTLSamplerMipFilterNotMipmapped for mipFilter, looks fairly crisp, this is the default fontpic.twitter.com/mjbQeJ8P14
2 replies 0 retweets 0 likes -
Replying to @FlohOfWoe @warrenm
...maybe the shader doesn't sample at the texel center for some reason? But I'm not doing anything special there, just take the UV coords I'm getting from imgui.
1 reply 0 retweets 0 likes -
Replying to @FlohOfWoe @warrenm
repo is here: https://github.com/floooh/sokol-samples …, imgui demo source code is here: https://github.com/floooh/sokol-samples/blob/master/metal/imgui-metal.cc …, Metal build instructions: https://github.com/floooh/sokol-samples#to-build-for-metal-on-osx … (you'll need cmake, python and xcodebuild in the path)
1 reply 0 retweets 0 likes -
Replying to @FlohOfWoe @warrenm
...if you cloned already, please do an update, there are several Metal imgui-demos in the repository, and I had to set the filtering in the one I sent you to LINEAR (it doesn't seem to make a visual difference with the default font, but with the TTF font in the HighDPI demo)
2 replies 0 retweets 0 likes -
Replying to @FlohOfWoe
k, pulling again. The version I got was indeed using nearest filtering on the font texture.
1 reply 0 retweets 1 like -
Replying to @warrenm
those other imgui demos are here: https://github.com/floooh/sokol-samples/tree/master/sapp …, these are built with the build config "sapp-metal-osx-xcode-debug" (not yet described in the readme since sokol_app.h is still WIP), the imgui-highdpi-sapp demo might be of interest (renders in Retina res with TTF font)
1 reply 0 retweets 0 likes -
Replying to @FlohOfWoe @warrenm
I bet I know what's happening, I can reproduce the effect when I'm using the default font in the HighDPI demo. In my "default" ImGui demo, there's a 1:1 mapping between framebuffer pixels and "ImGui" pixels, and the MacOS composer upscales 2x... crisp with kCAFilterNearest..
1 reply 0 retweets 0 likes -
Replying to @FlohOfWoe @warrenm
...but in the HighDPI demo, 1 ImGui (or font texture) pixel is 2 framebuffer pixels, so the font texture sampling does the upscaling, and this introduces the blur...
1 reply 0 retweets 0 likes
Yeah, this is all starting to make sense. You’re using the view size in points as the drawable size, which in turn becomes the DisplaySize (with DisplayFramebufferScale = 1), so you get upscaled and thus blurry without the CA override. I can repro that now in my sample.
-
-
Replying to @warrenm
I've been experimenting a bit with giving an ImFontConfig to AddDefaultFont(), and set the OversampleH and OversampleV to 2, so that font pixels are 2x their original size, but didn't help, RasterizerMultiply=1.5 at least makes the text less 'spindly', but I don't get it 'crisp'
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.