bevyengine / bevy

A refreshingly simple data-driven game engine built in Rust
https://bevyengine.org
Apache License 2.0
35.18k stars 3.47k forks source link

Render text into textures #1159

Open TheRawMeatball opened 3 years ago

TheRawMeatball commented 3 years ago

Currently, text is rendered using the sprite sheet pipeline. This has various issues:

I propose text rendering is done using a specialized pipeline, rendering the text into a texture that can stay on the GPU improving performance, and enabling text to use the same render pipeline the rest of the UI systems use.

As an alternative, optimization could be done elsewhere, and spritesheets and text could stay linked, but neither would allow the approach in #1158 (or a possible reimplementation).

PabloMansanet commented 3 years ago

I'm very interested in this and I've done some work on text as part of #1122, so I'm happy to give this a shot, or to help out if you've already started work on it. I'd appreciate some mentoring around the rendering side, which I'm less familiar with.

TheRawMeatball commented 3 years ago

I tried and failed to implement this myself. I'm not very familiar with the rendering system either, but as far as I know, there isn't a way to render to a texture yet. I would love to be proven wrong on this feature being blocked on another, but I think the best course of action would be to first implement a generic way to render stuff into textures, which could probably use its own issue.

PabloMansanet commented 3 years ago

Right, I see. Going to give that a shot. If nothing else, it will be a great excuse to learn about the rendering pipeline :)

tigregalis commented 3 years ago

For rendering to a texture, consider: