Hi, really missing font godot engine font oversampling feature here. Is that possible in defold? This feature allows you to use hi-res fonts in pixel-art game, meaning you shouldn’t scale/downscale all your nodes.
tweet
How does it work? Do you have any source (docs, code, or otherwise) to what the option does? If it’s shader based then it should be possible, if it needs offline processing then probably not.
only docs part godot engine viewport/camera modes:
“disabled”: No stretching happens. One unit in the scene corresponds to one pixel on the screen. In this mode, [member display/window/stretch/aspect] has no effect. Recommended for non-game applications.
“canvas_items”: The base size specified in width and height in the project settings is stretched to cover the whole screen (taking [member display/window/stretch/aspect] into account). This means that everything is rendered directly at the target resolution. 3D is unaffected, while in 2D, there is no longer a 1:1 correspondence between sprite pixels and screen pixels, which may result in scaling artifacts. Recommended for most games that don’t use a pixel art aesthetic, although it is possible to use this stretch mode for pixel art games too (especially in 3D).
“viewport”: The size of the root [Viewport] is set precisely to the base size specified in the Project Settings’ Display section. The scene is rendered to this viewport first. Finally, this viewport is scaled to fit the screen (taking [member display/window/stretch/aspect] into account). Recommended for games that use a pixel art aesthetic.
and from one forum users:
Font oversampling has a global scale for all fonts within the project (calculated automatically when using thecanvas_items
mode)
I hadn’t heard of font oversampling. This was the best explanation I found, from the stb library: https://github.com/nothings/stb/tree/master/tests/oversample
[…] You can avoid [aliasing and bluring] by caching multiple variants of a [bitmap] character which were rendered independently from the vector data. For example, you might cache 3 versions of a char, at 0, 1/3, and 2/3rds of a pixel horizontal offset […]
When creating a texture atlas for use on GPUs, which support bilinear filtering, there is a better approach than caching several independent positions, which is to allow lerping between the versions to allow finer subpixel positioning.
I don’t know how Godot does it though.