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

Text Performance #36

Open
Unreal852 opened this issue Oct 23, 2020 · 4 comments
Open

Text Performance #36

Unreal852 opened this issue Oct 23, 2020 · 4 comments

Comments

@Unreal852
Copy link

Hello, i noticed that Text rendering is fairly slow. I found a work-around by creating bitmap and rendering the text on it once and then rendering the bitmap. This is working but maybe there is another way to have better text rendering performance ?
To be more clear, i'm creating a Node-Based graph and so each nodes may need to have 1 or more text, and this clearly degrade performance when more and more nodes are added.

@jingwood
Copy link
Owner

jingwood commented Oct 24, 2020

@Unreal852 Thanks for the feedback. How many nodes (texts) to be rendered in one frame in your scene? about 100 ~ 1000?

The text rendering is a more expensive operation comparing to other geometry renderings. And current API doesn't support doing something optimization like cache font and text resource, that could be the first thing to do to improve the performance. I will try something.

@gilsonwang
Copy link

Maybe you can passing the Brush and TextFormat to DrawString() in Text.cpp. It will get a little bit improve.
I try to render 2900 texts on a 2k screen and it will be about 23FPS.
After rewrite the DrawString function in Text.cpp, it will be 30FPS.

@Unreal852
Copy link
Author

@jingwood Each node have a title, so there is a minimum of 2 nodes ( entry node and exit node ) but between them there can be 0 or 10, 100, etc, it is up to the user. I already wrote a Node system with winform GDI+ but the performance is not that good that why i'm looking to rewrite it with anoter renderer. I was thinking about OpenTK (GL) but it is way too overkill for what i'm doing.
Here is a example of what i want to do Unity Shader Graph

@jingwood
Copy link
Owner

jingwood commented Dec 11, 2020

Added a performance test for text rendering fd01188

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