Live data from Hacker News

Leveraging Rust and the GPU to render user interfaces at 120 FPS

zed.dev

181–190 of 212 posts

Re: Leveraging Rust and the GPU to render user interfaces at 120 FPS

#181

Earlier quoted context omitted.

That's already what they're doing: https://news.ycombinator.com/item?id=35080427

That's even weirder why would they redraw the whole application on a character change

Where did they say they were doing that?

All I see is them saying they can, not that they are.

Re: Leveraging Rust and the GPU to render user interfaces at 120 FPS

#182

"Inspired by the gaming world, we realized that the only way to achieve the performance we needed was to build our own UI framework" I'm surprised you did not look at "Dear ImGui", "Noesis", and "JUCE". All three of them are heavily used in gaming, are rather clean C++, use full GPU acceleration, and have visual editors available. Especially JUCE is used for A LOT of hard-realtime professional audio applications. "Wh…

Meanwhile, the gaming world is moving to HTML/CSS/JS for game UI in many cases.

I know of at least one shippping commercial game - in 2023 - that renders the UI using Adobe Flash.

Re: Leveraging Rust and the GPU to render user interfaces at 120 FPS

#183

Earlier quoted context omitted.

ImGui is at least only used for debug rendering, not something that makes it to end user. At least in the small subset of companies I worked at.

ImGui is mainly used for debug rendering, but if you browse the screenshot threads, there quite a few 'end user applications' among them: https://github.com/ocornut/imgui/issues/5886

No, it's supposed to be used for this purpose.

> Dear ImGui is designed to enable fast iterations and to empower programmers to create content creation tools and visualization / debug tools (as opposed to UI for the average end-user). It favors simplicity and productivity toward this goal and lacks certain features commonly found in more high-level libraries.

It's literally not designed for end user consumption.

Re: Leveraging Rust and the GPU to render user interfaces at 120 FPS

#184

Earlier quoted context omitted.

With scrolling couldn't you just shift the existing framebuffer up/down and only draw the newly scrolled-to parts?

The GPU buffering model doesn't usually let you read the previous frame like that these days, so you would need a scratch surface. That increases your bandwidth and memory requirements, so shifting doesn't end up being much faster if it's faster at all.

I suspect there are enough edge cases (semi-transparent things jumps to mind) that it's unlikely to be lossless, anyway.

Re: Leveraging Rust and the GPU to render user interfaces at 120 FPS

#185
post #17

The bottleneck of UI is not the rendering. A measly 60 fps is plenty fast for UI that feels immediate. We had this in the 90's with software rendering, you don't need a GPU for that today. What causes user interfaces to hick up is that it's too easy to do stuff in the main UI thread. First it doesn't matter but stuff does accumulate, and eventually the UI begins to freeze briefly for example, after you press a button…

> A measly 60 fps is plenty fast for UI that feels immediate. We had this in the 90's with software rendering, you don't need a GPU for that today. No we didn't. We had nothing close to that in the 90s. Typing was responsive, but that's not anywhere close to 60fps and a very small region to update to boot (120wpm = 600 keys/minute = 10 keys/s, or 10fps). Scrolling benefits from 60fps+, but in the 90s scrolling jumped…

60 is the new 30.

Was amazed at how good my latest iPhone feels with 120hz scrolling. It's like magic.

Re: Leveraging Rust and the GPU to render user interfaces at 120 FPS

#187

Earlier quoted context omitted.

This used to be the case on Windows, but hasn't been for at least 10 years, and has never been the case on Mac OS X (using the historical name for clarity) or Linux. On Windows, the open-source NVDA screen reader is widely used. Furthermore, the hacks that Windows screen reader developers historically used to "find a way to make their product work", particularly intercepting GDI API calls (either in user space or in…

As someone who's doing some accessibility programming but has no background in the field, I do have a random question to throw your way if you are game. Our team is developing voice control for a website. This is mainly requested by sighted users who want to use the site hands-free. But we also have an accessibility mode for better screen reader support. We think voice control might be appreciated by screen reader us…

Yes, the screen reader output will probably interfere with your speech recognition. You may be able to work around that on some platforms by enabling echo cancellation when getting mic input from navigator.getUserMedia, but I don't know if that actually works on any desktop platforms.

In general, you should assume that the user already has whatever assistive technologies they need, and you don't need to provide your own, just make the content and UI accessible using semantic HTML and (if needed) ARIA. Providing your own screen reader, for example, would definitely be a mistake. The same should ideally also hold for voice control, but apparently you're actually getting some demand for that.

Re: Leveraging Rust and the GPU to render user interfaces at 120 FPS

#188
post #182

Earlier quoted context omitted.

Meanwhile, the gaming world is moving to HTML/CSS/JS for game UI in many cases.

I know of at least one shippping commercial game - in 2023 - that renders the UI using Adobe Flash.

That's super common. It was more common historically, these days it's largely gone away. (Scaleform was the technology that used flash for UI dev)

Re: Leveraging Rust and the GPU to render user interfaces at 120 FPS

#189
post #155

Earlier quoted context omitted.

> Even when requesting a full screen swapchain to avoid having to deal with the compositor, modern OSes will force you to go through that compositor and lie about it being fullscreen. I’m honestly thankful for this bit of lying. Windows 8 and below had horrible, horrible issues with fullscreen programs, especially games - they’d change your screen resolution and thus move and resize all your other windows, they’d fre…

I know that in Windows 10+ and on UWP apps, requesting a fullscreen swapchain straight up crashes and tells you "nope, you're going to go through the compositor". But yes, alt-tabbing Source games was an exercise in patience.

Is that disabled for programs targeting older OS versions? Or are you saying that the new behavior is only for UWP apps? Because that sounds like it would break a lot of old code.

Re: Leveraging Rust and the GPU to render user interfaces at 120 FPS

#190

"Inspired by the gaming world, we realized that the only way to achieve the performance we needed was to build our own UI framework" I'm surprised you did not look at "Dear ImGui", "Noesis", and "JUCE". All three of them are heavily used in gaming, are rather clean C++, use full GPU acceleration, and have visual editors available. Especially JUCE is used for A LOT of hard-realtime professional audio applications. "Wh…

At least as far as dear imgui is concerned, it's an amazing library for dev tools but the accessibility story is dire and it has poor support for high quality typography, so it's a non starter if you're serious about good UI. This is not to diminish the quality work that went into the library, but I passed over it for those and other reasons. I used nuklear for a bit since its typography was extensible but in the end…

> a custom mixed immediate/retained library now with rich text and accessibility support.

I'm always interested in learning about GUI toolkits that have accessibility support. What level of accessibility support does yours have? e.g. does it implement platform accessibility APIs, and if so, on which platforms? Is your library open source? If not, can I see it in action in any commercially available product? Thanks.

Post reply on HN