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

Replace SDL_gpu with bgfx #276

Open
ephemer opened this issue Dec 13, 2018 · 6 comments
Open

Replace SDL_gpu with bgfx #276

ephemer opened this issue Dec 13, 2018 · 6 comments

Comments

@ephemer
Copy link
Member

ephemer commented Dec 13, 2018

Motivation

We've noticed that SDL_gpu doesn't fit our needs in many situations: it has a strange transformation matrix model (which leads to rendering bugs at pixel boundaries on certain devices, as well as to reduced performance, and not only on older devices), is difficult to use with custom shaders (important for shadows, masking, cap insets etc.), and has docs that are difficult to use / are incomplete.

SDL itself is also a dependency we'd like to remove (we're only really keeping it around for SDL_gpu).

Using bgfx would give us much more flexibility over our rendering, allowing us to implement shadows, capInset images, 8bit textures (see #275), and more. And would also be a nicer toolkit to work with, given its greater user base, better docs, and clearer render pathway. It appears that bgfx is widely used on Android as well, and also seems to work with WebGL, which was an initial draw card for SDL.

Disadvantages

  • SDL_gpu allows us to render rounded corners out of the box. We're hardly making use of this feature though because its rendering is highly aliased. We'd prefer to go for a solution using cap inset images or similar anyway.
  • We'd have to rewrite the UIScreen render functions to a certain degree. This is probably unavoidable, but also gives us the opportunity to improve our rendering performance by batching more draw calls together.
  • If we removed SDL we'd also have to rethink our text rendering: SDL_ttf unsurprisingly relies on SDL. But this would not be necessary if we just replace SDL_gpu with bgfx initially.
@lin7sh
Copy link

lin7sh commented Aug 9, 2019

Vulkan backend of BGFX has been merged , Do you still have a plan to switch to bgfx?

@ephemer
Copy link
Member Author

ephemer commented Aug 9, 2019

@mko-io thanks for the heads up. We'd love to switch to bgfx but we don't have the resources to work on it right now without a pressing business need. Would you be interested in working on that project with us?

@lin7sh
Copy link

lin7sh commented Aug 9, 2019

@ephemer I would like to help, but I'm not a Graphic programmer, This task is beyond my ability. After the recent release of SwiftUI, I see the more value of this Project, hopefully someone will make this happen someday

@ephemer
Copy link
Member Author

ephemer commented Aug 9, 2019

Understood. Any support is welcome and greatly appreciated- have you managed to set up a project with UIKit cross platform? If so it’d be great if you could share you experiences with us and/or others :)

@lin7sh
Copy link

lin7sh commented Aug 13, 2019

I would love to share when I make it work. I believe SwiftUI on Android is the future for mobile development. Thanks for your vision

@ephemer
Copy link
Member Author

ephemer commented Aug 13, 2019

Strongly agree! Please get in touch if you need some help getting set up

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