You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the problem or limitation you are having in your project
When you have Label3Ds or Sprite3D icons in the distance, they become pixelated if mipmaps are disabled, or blurry if mipmaps are enabled. This is particularly a problem in some situations:
ViewportTextures shown on materials at a distance (e.g. for interactive GUIs in a 3D world) become pixelated as they don't generate mipmaps in real-time.
GUIs in XR become pixelated or blurry, and therefore less comfortable to interact with.
Label3Ds become pixelated (without mipmaps) or blurry (with mipmaps) at a distance, making them harder to read.
While MSDF fonts can be used to improve font rendering at a distance somewhat, they still remain fairly blurry at low sizes due to the lack of font hinting and suffer from some limitations (such as not supporting colored emoji). There is also no equivalent for Sprite3Ds that can be used out of the box, as it's limited to representations of monochrome vector data in general. Lastly, using MSDF fonts will not help within a ViewportTexture as the ViewportTexture rasterizes the whole thing.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add an option to use texture supersampling in BaseMaterial3D (and Sprite3D/Label3D). This has a moderate performance cost, so it should be disabled by default and enabled on specific materials or nodes when you need it.
When coupled with negative mipmap biasing (which can be applied in the shader itself using the 3rd argument of GLSL's texture()), this provides better sharpness than the default sampling method while not suffering from any more aliasing. This also benefits standard mipmapped textures as seen in the example below (see the noise texture on the left).
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Texture supersampling typically uses one of the two algorithms:
Ordered Grid Sumpersampling (OGSS).
Rotated Grid Supersampling (RGSS). This technique is generally a straight upgrade from OGSS as it looks a bit better while having the same cost.
Rendered at 3840×2160 and downsampled to 1152×648.
If this enhancement will not be used often, can it be worked around with a few lines of script?
For materials applied on MeshInstance3D, this can be worked around with a custom shader. However, for Label3D or Sprite3D, this can't be done without a lot of additional work to use the material override.
Is there a reason why this should be core and not an add-on in the asset library?
Most 3D projects with diegetic UI and XR projects will need this at some point to ensure their UI looks good, particularly at lower viewport resolutions (e.g. on Steam Deck).
The text was updated successfully, but these errors were encountered:
Describe the project you are working on
The Godot editor 🙂
Describe the problem or limitation you are having in your project
When you have Label3Ds or Sprite3D icons in the distance, they become pixelated if mipmaps are disabled, or blurry if mipmaps are enabled. This is particularly a problem in some situations:
While MSDF fonts can be used to improve font rendering at a distance somewhat, they still remain fairly blurry at low sizes due to the lack of font hinting and suffer from some limitations (such as not supporting colored emoji). There is also no equivalent for Sprite3Ds that can be used out of the box, as it's limited to representations of monochrome vector data in general. Lastly, using MSDF fonts will not help within a ViewportTexture as the ViewportTexture rasterizes the whole thing.
The problem and some solutions are well-described in this article from Ben Golus: Sharper Mipmapping using Shader Based Supersampling
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Add an option to use texture supersampling in BaseMaterial3D (and Sprite3D/Label3D). This has a moderate performance cost, so it should be disabled by default and enabled on specific materials or nodes when you need it.
When coupled with negative mipmap biasing (which can be applied in the shader itself using the 3rd argument of GLSL's
texture()
), this provides better sharpness than the default sampling method while not suffering from any more aliasing. This also benefits standard mipmapped textures as seen in the example below (see the noise texture on the left).Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
Texture supersampling typically uses one of the two algorithms:
I have a prototype branch with RGSS implemented for the albedo map: https://github.com/Calinou/godot/tree/basematerial3d-add-rgss
Here's an example in action (click to view at full size):
Normal
Grid texture from left to right: Nearest, Nearest Mipmaps, Linear Mipmaps, Linear Mipmaps Anisotropic (16×)
Rotated grid supersampling (with
-1.0
mipmap bias)Ground truth
Rendered at 3840×2160 and downsampled to 1152×648.
If this enhancement will not be used often, can it be worked around with a few lines of script?
For materials applied on MeshInstance3D, this can be worked around with a custom shader. However, for Label3D or Sprite3D, this can't be done without a lot of additional work to use the material override.
Is there a reason why this should be core and not an add-on in the asset library?
Most 3D projects with diegetic UI and XR projects will need this at some point to ensure their UI looks good, particularly at lower viewport resolutions (e.g. on Steam Deck).
The text was updated successfully, but these errors were encountered: