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

2d hdr + font msdf causes broken text rendering #80646

Closed
scgm0 opened this issue Aug 15, 2023 · 5 comments · Fixed by #80651
Closed

2d hdr + font msdf causes broken text rendering #80646

scgm0 opened this issue Aug 15, 2023 · 5 comments · Fixed by #80651

Comments

@scgm0
Copy link
Contributor

scgm0 commented Aug 15, 2023

Godot version

4.2.dev3

System information

Godot v4.2.dev3 - Arch Linux #0~20230811.g489fabdc SMP PREEMPT_DYNAMIC Sat Aug 12 02:04:20 UT - X11 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1650 (nvidia; 535.98) - Intel(R) Core(TM) i5-9300H CPU @ 2.40GHz (8 Threads)

Issue description

After turning on 2d hdr and font msdf at the same time, there is a problem with ui text rendering.

2d hdr off:
图片
2d hdr on:
图片

Steps to reproduce

  1. Open msdf for default font or custom font.
  2. Turn on 2d hdr.
  3. Add a Label node and enter text, the text rendering is destroyed.

Minimal reproduction project

N/A

@akien-mga
Copy link
Member

Did you restart the editor as the message asks you to?

@scgm0
Copy link
Contributor Author

scgm0 commented Aug 15, 2023

Did you restart the editor as the message asks you to?

This is also the case after restarting. There is no restart in the screenshot, but I am lazy(

@akien-mga
Copy link
Member

CC @clayjohn @bruvzg

@clayjohn
Copy link
Member

I can reproduce this issue. For me the text totally disappears unless the camera is zoomed out quite far.

My best guess is that there is a space-encoding issue going on here. Likely the MSDF channels are encoded in an unexpected color space. When HDR is disabled, in 2D the engine ignores color space and just reads the texture as written. With HDR enabled, the engine ensures that you are reading the texture in linear space. If you have non-color data encoded in sRGB-space, then the engine will erroneously do a sRGB->linear conversion and break the data.

@clayjohn
Copy link
Member

PR incoming

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

Successfully merging a pull request may close this issue.

3 participants