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

DynamicFont render issues when instanced. #40760

Open
vicguedez opened this issue Jul 27, 2020 · 4 comments
Open

DynamicFont render issues when instanced. #40760

vicguedez opened this issue Jul 27, 2020 · 4 comments

Comments

@vicguedez
Copy link

Godot version:
Godot 3.2.2 stable, official.

OS/device including version:
Windows 10 (up to date), AMD Ryzen 3500U with Vega 8 graphics.

Issue description:
I'm building a small administrative "ecosystem", so I made a small "sdk" to share among a couple of projects. I have a base "button.tscn" which I use everywhere (I also have "label.tscn" and so on...). This base scenes all load "font_base.tres" as the custom font. I'm using the Ubuntu Light font.

Now, upon switching between scenes I get this:

bug_1

If I render something on top of it:

bug_2

It gets fixed:

bug_3

As a test, I made a new custom font for a few instanced buttons (each of them, without saving the custom font to a file), and got proper rendering on the ones without the instanced custom font (all objects here are instanced):

bug_4

This happens between 2 projects which use the same base files. All project settings are default and using the GLES2 driver. Sadly I don't know how to reproduce it in a new project.

@Calinou
Copy link
Member

Calinou commented Jul 27, 2020

@vicguedez Does this bug occur if you switch to the GLES3 renderer? Also, does this occur with GLES2 if you disable batching in the Project Settings?

@vicguedez
Copy link
Author

@Calinou I hadn't tried on GLES3, but it happens there too (just tested it). I also thought of disabling batching but it makes no difference. Scenes always render properly on editor also.

@vicguedez vicguedez changed the title GLES2 - DynamicFont render issues when instanced. DynamicFont render issues when instanced. Jul 27, 2020
@vicguedez
Copy link
Author

@Calinou Changed render thread model to multi-thread and it seems to be fixed in desktop, I have yet to test on Android.

@follower
Copy link
Contributor

FYI there are one or more issues with DynamicFont in relation to caching/updating behaviour. (They're on my unfortunately very long list of issues to write up...)

I've just dumped the caching related issues into a separate issue, in case you want to investigate: #40787 (In part so I don't start to recreate the issue everytime I come back to it. :D )

To start debugging this I'd start by setting (C++) breakpoints on the draw_char() methods in https://github.com/godotengine/godot/blob/aada93afc0ecc699440805ad2574d3e94b7c0abd/scene/resources/dynamic_font.cpp:

  • DynamicFont::draw_char()
  • DynamicFontAtSize::draw_char()

Then follow the logic to see whether each character is considered "valid" or not & then try to determine...why. :)

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

No branches or pull requests

3 participants