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

Only 8 sprite textures are supported #56

Open
lejar opened this issue Oct 13, 2019 · 2 comments
Open

Only 8 sprite textures are supported #56

lejar opened this issue Oct 13, 2019 · 2 comments

Comments

@lejar
Copy link

lejar commented Oct 13, 2019

Since the whole UI is drawn in one call, there is a limit on the number of textures you can have at once. I needed to have a much higher limit, so I hacked in separate draw calls for each LUISprite object, which lets you have as many different sprites with different textures as you want.

This was done by passing a vector down into render_recursive, and letting each object decide whether or not they want to put in a geometry and shader attribute object. This way, only the LUISprites get an extra draw call.

@tobspr If you think something like this is okay, I can clean it up and hide the functionality behind a define, then make a pull request. My commit is 264434d

@tobspr
Copy link
Owner

tobspr commented Oct 14, 2019

Hey!

I would be fine if would be behind a define and documented, so its available in case you need it.
Do you, by any chance, had the possibility to measure the performance loss? Is it actually much slower?

@lejar
Copy link
Author

lejar commented Oct 22, 2019

There definitely is a performance loss, but I don't know if I'd call it a large one. I made a test with 200 LUIButtons, plus a variable number of LUISprites. I unlocked the frame rate and took some measurements with each number of LUISprites, then calculated the frame time from the fps and plotted it.

Github wouldn't upload my graph, so I had to put it here.

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

No branches or pull requests

2 participants