Earlier quoted context omitted.
> They don't draw every single object on the screen every frame, that could easily cause lag on a large complex page. Games draw every single object on the screen every frame. They don't lag, quite the opposite in fact!
Games are expected to have sole access to your machine, so if they use all the CPU/GPU resources, nobody cares. If my web browser was burning up my battery re-rendering the page 90 times a second, I'd be livid.
So you think you know box shadows?
91–100 of 130 posts
Re: So you think you know box shadows?
#92Re: So you think you know box shadows?
#93> However, using a transparent color significantly slowed down the number that can be drawn too which doesn't make as much sense to me. I'd imagine that with hardware today transparency should be somewhat free. That's because transparency limits how you can batch draws on the GPU. With opaque draws, you can use the depth buffer and draw in any order you like e.g. maximizing batching. With transparency, you need to dr…
GPUs also do not like overdraw, so it's generally good idea to avoid having many transparent elements on top of each other, its also the reason why drawing more triangles vs. transparent texture is generally better.
It isn't like the Ps2 era when geometry time was a real concern on render times. Even a modern low end GPU could process a few hundred million polygons a second without sweating it, now getting the result son screen is a very different issue.
Re: So you think you know box shadows?
#94I'm embarrassed to admit it took until the final paragraph before realising that 'gypity' is a reference to Chat GPT.
Re: So you think you know box shadows?
#95Earlier quoted context omitted.
In fact that exact line of thinking was behind an effort to rewrite Firefox's rendering to be more like a game engine, a few years ago. Not sure where that went in the end.
That sounds like something from the shuttered Servo team. At least they rose like a phoenix - https://servo.org/
Re: So you think you know box shadows?
#96Earlier quoted context omitted.
> They don't draw every single object on the screen every frame, that could easily cause lag on a large complex page. Games draw every single object on the screen every frame. They don't lag, quite the opposite in fact!
Games are expected to have sole access to your machine, so if they use all the CPU/GPU resources, nobody cares. If my web browser was burning up my battery re-rendering the page 90 times a second, I'd be livid.
Games 20 years ago had sole access to machines that were much less powerful than even partial access to today's machines.
And eg Nintendo Switch games (or games on the Steam deck, or just mobile phone games) still deal with power limitations; people are very aware when their games burn through their batteries.
Re: So you think you know box shadows?
#97Earlier quoted context omitted.
GPUs also do not like overdraw, so it's generally good idea to avoid having many transparent elements on top of each other, its also the reason why drawing more triangles vs. transparent texture is generally better.
My big take away with the whole City Skylines 2 performance issue and the lack of LOD was that geometry processing is so cheap nowadays. So long as you aren't too reckless with geometry in terms of sub-pixel rendering, you don't really have to worry about it too much any more. It isn't like the Ps2 era when geometry time was a real concern on render times. Even a modern low end GPU could process a few hundred million…
Re: So you think you know box shadows?
#98> However, using a transparent color significantly slowed down the number that can be drawn too which doesn't make as much sense to me. I'd imagine that with hardware today transparency should be somewhat free. That's because transparency limits how you can batch draws on the GPU. With opaque draws, you can use the depth buffer and draw in any order you like e.g. maximizing batching. With transparency, you need to dr…
A non-transparent draw over another draw allows in best case to cull all overlapping drawing operations, in worst case means you only have to use as much bandwidth as the individual draws.
With transparency, especially if you can't somehow combine the operations together (from my understanding, very hard problem), it means you also need to read back the entire region you're overlapping with transparency - so every transparent draw involves at least twice the final framebuffer size bitmap going-over memory bus.
Now consider that many mobile devices had not enough memory bandwidth to do a full redraw (i.e. blit the full framebuffer image twice) of the screen in time to maintain 60fps and it becomes a considerable problem.
Re: So you think you know box shadows?
#99Earlier quoted context omitted.
> They don't draw every single object on the screen every frame, that could easily cause lag on a large complex page. Games draw every single object on the screen every frame. They don't lag, quite the opposite in fact!
In fact that exact line of thinking was behind an effort to rewrite Firefox's rendering to be more like a game engine, a few years ago. Not sure where that went in the end.