4 ms·
I would like to get an idea of the capabilities of these things. Suppose I was to make an ebook reader designed to be modelled more closely after paper, on a d
by chrismorgan 6y ago
I would like to get an idea of the capabilities of these things.
Suppose I was to make an ebook reader designed to be modelled more closely after paper, on a device like the Surface Book’s 13″ 3000×2000 display, showing two pages side-by-side. Each page might contain something like 2,000–2,500 letters. I want to be able to flip through pages like I might with a paper book, so that I might be roughly completely rendering several pages at once, and perhaps parts of several more pages; ideally it might render the page like a real 3D page, but if that’s too troublesome I’d settle for an affine transformation while flipping. Assume that the layout of the pages, with all the shaping, is all done ahead of time and is in memory.
I’ve never seen anyone attempt anything like this before. In the old way of doing things, I think anyone attempting this would render each page to a bitmap and use that as a GPU texture, and I think that could provide acceptable performance (unless you were flipping rapidly through hundreds of pages, because that’d take a lot of GPU memory to keep), but I imagine that the quality of the rendering mid-turn would be fairly atrocious—it could be the sort of thing where the appearance of the text subtly changes half a second after you finish turning the page, as it switches from one renderer to a slightly different one.
Would the performance of this new approach be sufficient to render what I describe at 60fps, while rendering each frame perfectly?
I was talking about the Surface Book; its Intel Core i7-6600U has Intel HD Graphics 520 as its GPU; probably not too far off your 630’s results. (And I’m interested in what integrated graphics can do, more than a dedicated GPU.)
My guess based upon your paper-1 results is that this is probably just barely possible with integrated graphics, so long as you employ a few tricks to reduce the amount of work required.
- raphlinus 6y agoShort answer, yes, I believe it could work, though not with much margin to spare. It might require some dedicated optimization work to fit the frame budget, especially when you know things about the scene (it's mostly small glyphs and with basically no overdraw) as opposed to being completely general purpose. Doing a warp transformation in the element processing kernel would probably work just fine, and give you realistic movement and razor-sharp rendering. I'd love to see such a thing and would very much like to encourage people to build it based on my results :)
- londons_explore 6y agoFor the OP's effect, remember you're probably going to want motion blur in each frame, which means you can render at a much lower resolution in the direction of motion (as long as you can do multipass rendering)
- chrismorgan 6y agoEek, hadn’t thought about how motion blur might be desirable. That’s going to get messy.
- ghusbands 6y agoI don't think you do want motion blur, as you don't know the direction in which the user's eyes are tracking. When games and films do motion blur, they know where they expect the viewer's attention to be, so blurring things they won't be tracking improves the look (especially at the low frame-rate of films). But if you happen to track the moving page, and you are likely to, and it has blur added, then it will look worse. Look at phone interfaces; even if you scroll fast, they don't add motion blur, and on high framerate and/or low-persistence displays, you can read things while it scrolls.
- Pulcinella 6y agoI have done some testing around this (motion blur while scrolling) and can confirm that motion blur is not practical for scrolling. It “looks nice” and is a nice effect, but makes the text completely unreadable while scrolling. If you have access to a Mac, the easiest way to check for your self is to add a CI motion blue filter to a tableview’s layer’s filter property (you can change the strength of the blur based on the speed of scrolling if you would like).
- FraKtus 6y agoAnother need for that kind of effect is for real-time events. I work on software that is used to create visual effects in real-time. It's used in live events such as concerts, clubs, corporate presentations. There you want to be able to render high-quality text in high resolution, even higher than 4K, and still allow a performer to add effects on text such as zooming, scrolling, doing 3D transition effects... Today the best way to do this is via a font atlas but it does not look nice when zooming. Also if you need non-European characters it may heavy preparing the font atlas. So I am looking for a library that would allow this kind of rendering manipulation for text rendering. Do you have any suggestions?
- jayd16 6y agoI think you could easily get this done in a traditional 3D pipeline if you use a texture based font, aniso/mip filtering and gpu instancing. You wouldn't be rendering 2500 draw calls. You can batch much of it together. The reason you don't see this is because no one runs a 3d engine in their text readers. Fonts are not usually shared as sprite sheets. You also lose subpixel font rendering.
- MauranKilom 6y agoI would like to point out that caching one bitmap per page will be the preferred solution for a different but important reason: You don't want to have your laptop GPU running at 100% while viewing static text. Fidelity is nice, but I don't think you'll convince many people with an ebook reader that drains your mobile device's battery like that.
- chrismorgan 6y agoI don’t believe this is a problem. It will only need to render it when things change—so maybe the GPU will be sitting at 100% while you’re flipping through pages, but other than that typically very brief time, it should be at 0%.