Hacker News new | ask | show | jobs
by hevi_jos 2608 days ago
If you have to create a big texture for the GPU, this is the definition of slow.

One of the big advantages of drawing for every frame is that you only need to draw what is visible. And do it in real time, with no perceived lag.

For a text editor I use I only draw at any given time 1/10.000 of what is actually there. In fact, you don't need to draw textures at all with the GPU, Apple or Microsoft or Google does not do that for drawing text because it is extremely slow generating this texture and it is not flexible.

Those companies in the bleeding edge, they draw directly in the screen from curves like bezier approximations.

1 comments

The GPU doesn't need to read texels or calculate fragments that aren't visible. So, every frame it is only copying the visible chunk of the scrollable buffer to the framebuffer. GPUs are efficient at that. More expensive rendering to the scrollable buffer, when it is either static or infrequently changing, can be as-needed instead of every frame.

That's a really well-favored set of trade offs for many cases where you need smooth scrolling.