Open nical opened 5 years ago
It sounds like for games, the difficulty is getting the balance between full GPU control, and some scene graph retained state. We want to
I suspect it may be worth having 2 crates, a gfx-2d
or equivalent, that provides full control over the GPU for 2d applications, but is as simple as possible, and then a drawing library that abstracts a bit and provides the utility functionality. Should there be some sort of scene graph? Or should that be the consumer/higher level library's responsibility.
I think it's important to have a stack, so consumers can choose the level of abstraction that is easiest to use while still giving the access to performance they need.
It might be worth reaching out to the Chucklefish developers, since they are doing commercial work, and at least Starbound was 2D (not sure about their future work). A games library should be low-level enough for professional game development, even if it stays as an experiment.
Can I ask what operations are important for 2D gaming? Is the following list accurate:
In particular none of the layout stuff from UI where you calculate position and size. Also no shape primitives - everything is a rectange of pixels.
Are there other possibilities? Would people use vector graphics to describe their assets, and want them to scale? What other ways to use 2D graphics are there? Also, would you want all the UI stuff anyway since you usually have a UI in-game?
Possibly interesting article: https://developer.nvidia.com/gpugems/GPUGems3/gpugems3_ch25.html
I wrote some stuff here: https://nical.github.io/posts/rust-2d-graphics-02.html about memory management and modern graphics APIs.
Sorry I thought I had answered that a while back:
Can I ask what operations are important for 2D gaming? Is the following list accurate:
1. Blitting images (or sprites, I'm not sure I understand the distinction) onto a framebuffer 2. Lighting/shadows/blur/other blend effects
If all you need is blitting sprites, ggez already provides the functionality along with a lot of useful stuff. Effects are certainly nice. What I'm personally interested in is general purpose vector graphics (as in, arbitrary paths) because it's a hard problem (and an interesting one), and it doesn't have a lot of known libraries that are adapted to complex interactive scenes.
Let's talk about the technical aspects of rendering complex vector graphics in interactive applications like games. To me this topic is very different from making UIs. I'll elaborate on that when I have a bit of time before me.