News for hackers. Stuff that matters.
Re:Netflix – Chasing 60fps [video] by CSDude on Wednesday August 12, 2015 @06:46PM (#10051265)
I know Javascript/HTML/CSS makes it very easy to develop something, however it is really sad to see people are struggling to get 60fps to show 20 boxes with images scrolling, where games can show thousands of polygons smoothly.
Re:Netflix – Chasing 60fps [video] by jeremiep on Wednesday August 12, 2015 @07:50PM (#10051519)
Game engines and browsers have radically different architectures and performance/productivity requirements. Computing polygons is basically applying one function to an array of values and is delegated to the GPU, so its no wonder they easily reach 60 FPS with hundred of thousands of polygons per frame.

A better comparison would be against the performance of game logic, which in a game engine can easily become the bottleneck from all the conditionals, random memory accesses and sequential dependencies. And even there they don't sit on nearly as many layers of abstractions as a web page does.

This comes at the cost of productivity; building a web site is a few orders of magnitude more productive than using the latest game engines. Of course, sitting on the DOM and its many quirks as well as its reflow/redraw cycles can make it harder to reach 60FPS in the browser.

But at least you're saving yourself from a world of low-level pain.

Re:Netflix – Chasing 60fps [video] by kitsunesoba on Wednesday August 12, 2015 @08:53PM (#10051712)
It’s also worth noting that the web technologies were initially (and still mostly, actually) designed to layout documents, not to craft highly graphical, interactive, animated application UIs.

If this is the direction the web is going, I think it’s worth considering a shift to technologies better suited for the task (QML, for instance, looks like a great preexisting application-centric alternative to HTML). Old browsers that don’t support this tech would be taken care of by HTML polyfills until adoption of new browser versions is high enough.

Re:Netflix – Chasing 60fps [video] by keithy on Wednesday August 12, 2015 @09:58PM (#10051911)
Well if you think about it, the netflix UI is pretty much a bunch of documents. It's a gallery of images, and each image has its own document.

The DOM is a dinosaur unfortunately, it just gets the job done for most basic websites. CSS is also a language made for the DOM. The thing is, the DOM isn't required for a web page. Netflix could have coded up their entire UI on a Javascript 2D game engine and could have ended up with a faster app for sure. But CSS and the DOM make it much easier to work with text + links, that imo it's worth it for the performance drop of animations.

Re:Netflix – Chasing 60fps [video] by cmaggard on Wednesday August 12, 2015 @11:09PM (#10052067)
Not to mention the nightmare that accessibility would be if you were just rendering polygons on a canvas.
Re:Netflix – Chasing 60fps [video] by CarVac on Wednesday August 12, 2015 @11:37PM (#10052134)
I'd certainly be all for web pages with QML performance.

QML is a tremendously easy way to leverage OpenGL acceleration.

Re:Netflix – Chasing 60fps [video] by Retric on Wednesday August 12, 2015 @10:02PM (#10051923)
AAA games are a long way from that. GPU's shaders v3.0 are Turing complete.

PS: Top graphics cars AMD Radeon R9 295X2 is 11+ TFlops, 1920 x 1080 x 60 = 124 million. So, these cards have ~100,000 Flops per pixel per frame @1080p.

Re:Netflix – Chasing 60fps [video] by jeremiep on Wednesday August 12, 2015 @10:10PM (#10051939)
I know, I spent a few months this year simplifying shader code designed for the PS4 in order to run on mobile devices. We basically had to scale down from SM5 to SM3, not an easy task :)

Its not because shaders are now turing complete that its a free pass to use these features all over the place, they often come with a noticeable performance cost, which I admit is lesser and lesser every year, but still.

Also, having recently completed the port of a next-gen AAA title, I can definitely say most shaders stay far from turing completeness, even on current consoles. We shipped the game with at least 75k generated shaders and I'm fairly certain less than 20% of them made use of those features.

Finally, the numbers you mention are from an ideal benchmark case and assuming GPU usage is maximized. Real world conditions will definitely lower these numbers.

Modern consoles GPUs have dozens of metrics in their profilers and every single one of them can be a major bottleneck. Its near impossible to achieve 100% GPU usage in a game. We're happy above 80%.

Re:Netflix – Chasing 60fps [video] by ksk on Wednesday August 12, 2015 @09:03PM (#10051756)
>building a web site is a few orders of magnitude more productive than using the latest game engines.

How have you come to this conclusion?

Re:Netflix – Chasing 60fps [video] by nacs on Wednesday August 12, 2015 @09:34PM (#10051856)
If you've ever tried to do even the most basic of UI's in game engines, you'll quickly see the truth in that statement.

Even "easy" things on the web like text input boxes, scaling for different resolutions while keeping text crisp, and scrollable content areas are much harder in a game engine.

Re:Netflix – Chasing 60fps [video] by jeremiep on Wednesday August 12, 2015 @09:41PM (#10051878)
I've done both for a living.
Re:Netflix – Chasing 60fps [video] by ksk on Thursday August 13, 2015 @11:49AM (#10055067)
So your argument is, for YOU :- game programming is less productive than building a website. That's fine then. I wouldn't disagree with someones personal experience. I thought you were making a general argument that applies to everyone.
Re:Netflix – Chasing 60fps [video] by jeremiep on Friday August 14, 2015 @08:40AM (#10059790)
I was merely saying I learned its less productive by actually developing both video games and web applications instead of simply reading about it.

It may be personal experience but it doesn't change the fact that you're working on a much lower level in a game engine with long iteration times while a browser reloads almost instantly and builds on layers after layers of abstractions.

That argument still applies to everyone.

Re:Netflix – Chasing 60fps [video] by andrepd on Wednesday August 12, 2015 @08:05PM (#10051558)
So essentially you are sacrificing your end result for an easier time for yourself, the developer.
Re:Netflix – Chasing 60fps [video] by egeozcan on Wednesday August 12, 2015 @08:42PM (#10051681)
You are sacrificing your end result every time you don't spend a lifetime designing a custom processor for your application with an instruction set specific to your use case and instead have an easier time living like a normal human being.
Re:Netflix – Chasing 60fps [video] by andrepd on Thursday August 13, 2015 @01:31PM (#10055844)
You can go to extremes, as your preposterous mine-the-silicon-and-smelt-the-chip approach, or you can go to the sort of extremes that makes opening a news article grind my high-end phone to a halt for 20 seconds.
Re:Netflix – Chasing 60fps [video] by egeozcan on Sunday August 16, 2015 @08:32AM (#10068734)
That news source is then bloated and unoptimized. There are also a lot of bloated and slow native apps. I don't see your point.
Re:Netflix – Chasing 60fps [video] by kitsunesoba on Wednesday August 12, 2015 @08:57PM (#10051730)
I think there’s a balance to be struck between developer convenience and product quality+performance. If every developer leaned to the extreme convenience we’d quickly end up with a lot of unusable software.
Re:Netflix – Chasing 60fps [video] by jeremiep on Wednesday August 12, 2015 @09:54PM (#10051907)
True, but that balance is going to be different for every application domains.

At the end of the day, one of the few metrics which really matters is the return on investment.

A lot of software can afford iterative improvements as well, so its a great idea to start off with extreme convenience and optimize as you scale.

Re:Netflix – Chasing 60fps [video] by jeremiep on Wednesday August 12, 2015 @08:19PM (#10051606)
You're sacrificing performance, not the end result. However, a lot of the performance tricks do carry over (such as object pooling for example.)

But for 99% of the web this doesn't matter at all. I'll take declarative over imperative any day if it means I can spend the saved time polishing the product instead of debugging or optimizing.

You have no idea the amount of debugging and optimizing which goes into developing a video game. Having worked on both I can say time spent debugging/optimizing is at least an order of magnitude more than for web applications. Its much worse when you're using an in-house engine as well.

Re:Netflix – Chasing 60fps [video] by scott_karana on Wednesday August 12, 2015 @07:15PM (#10051385)
I'm with you. This is a regression.

A unified-ish platform might be a benefit to their developers, but this has also been a net loss for Netflix's end-users. :/

Re:Netflix – Chasing 60fps [video] by andrepd on Wednesday August 12, 2015 @08:08PM (#10051567)
Absolutely. It strikes me as odd that these days it is not only acceptable, but encouraged as a virtue, for developers to focus on making their own jobs easier as opposed to delivering a good (fast and efficient, among other things) product.
Re:Netflix – Chasing 60fps [video] by zevyoura on Wednesday August 12, 2015 @10:00PM (#10051918)
Usually making a developer's job easier entails making them more productive, which means fewer bugs and more features. Those things also correlate with a good product just as much or more than performance in most cases.
Re:Netflix – Chasing 60fps [video] by hayksaakian on Wednesday August 12, 2015 @07:19PM (#10051406)
the biggest trade off is maintainability

Are you getting code which any john developer can pick up and develop on, or is it something which requires knowing a special purpose programming language and corresponding frameworks?

From my point of view, I want to see a big company build a Canvas or WebGL UI that goes to thousands of people. We can speculate, but someone actually trying what you mention is the only way to find out if it works in the industry.

Re:Netflix – Chasing 60fps [video] by kibibu on Wednesday August 12, 2015 @07:52PM (#10051527)
I'm curious how one would handle accessibility with a WebGL UI. Is generating a parallel vanilla-HTML version the only option?

I suppose you could progressively enhance your HTML version to override certain DOM elements with WebGL UI, but I have no idea how modern screenreaders would handle it.

Re:Netflix – Chasing 60fps [video] by sosborn on Wednesday August 12, 2015 @09:24PM (#10051823)
Re:Netflix – Chasing 60fps [video] by nacs on Wednesday August 12, 2015 @09:36PM (#10051862)
And an example of doing it wrong: http://famous.org/
Re:Netflix – Chasing 60fps [video] by cpeterso on Thursday August 13, 2015 @12:03AM (#10052198)
Wrong how?
Re:Netflix – Chasing 60fps [video] by guiomie on Wednesday August 12, 2015 @07:37PM (#10051473)
Woudlnt there be a way to use a game engine to parse HTML+CSS and gain those performance improvements?
Re:Netflix – Chasing 60fps [video] by jeremiep on Wednesday August 12, 2015 @07:54PM (#10051532)
Game engines don't even go nearly that high-level. I see GUIs implemented in C++ more often than in scripting languages, and when they go that route its usually LUA without any declarative markup whatsoever.

Everything is a tradeoff, if you want the ease of HTML+CSS then be prepared to pay the performance hit, and if you want lighting fast GUIs, be prepared to pay the productivity hit.

Re:Netflix – Chasing 60fps [video] by BuckRogers on Wednesday August 12, 2015 @11:20PM (#10052100)
What about those of us who prefer to stick with tried and true text, like HackerNews? Fairly simple and effective. No need for a GUI when you can just have a line of text convey the idea much faster.
Re:Netflix – Chasing 60fps [video] by MichaelGG on Thursday August 13, 2015 @12:10AM (#10052214)
What's so complicated with the Netflix UI? I've been using the web for quite a while but I'm hard pressed to find any benefit, as a user, in the new Netflix UI. It's not like the old one rocked. But come on, it's a few cover images and text.
Re:Netflix – Chasing 60fps [video] by wmf on Wednesday August 12, 2015 @07:46PM (#10051508)
In general, probably not. Any optimization the game engine uses could also be used by browser engines (they already use DirectX/OpenGL, for example). CSS is just plain complex.
Re:Netflix – Chasing 60fps [video] by Timmons on Thursday August 13, 2015 @04:57AM (#10052907)
Weirdly, UI interfaces are also a problem in the game world. Where we want to have a designer or artist design and implement something in a game in a fast way we often resort to using Scaleform[1]. It is flash based tool for games, within the industry it is notorious for how slow and inefficient it is. A simple UI element can often be more costly than a major in-game 3D object.

We are willing to pay this extra cost for these elements because they are often required to be quickly put together and then iterated on over a long period of time in a very dynamic and changing system. Some elements may be moved from Scaleform into a more native implementation but for the most part it is left to be slowly parsed and inefficiently rendered.

Basically, where we need fast changing interfaces that arent necessarily implemented by high skill programmers then we are going to take a performance hit to get the same level of visuals we could get if we had the time and manpower to approach it better.

[1]http://gameware.autodesk.com/scaleform

Re:Netflix – Chasing 60fps [video] by h1fra on Thursday August 13, 2015 @02:16PM (#10056156)
Ironically, some game devellopers are using webkit on top of their game to do the UI.

Like simcity (https://news.ycombinator.com/item?id=5359143)

Re:Netflix – Chasing 60fps [video] by thejosh on Wednesday August 12, 2015 @08:27PM (#10051635)
Sure, if you're on "powerful" hardware, if you're talking about FPS in current games, current consoles don't really go past 30 for most games.
Re:Netflix – Chasing 60fps [video] by yoklov on Wednesday August 12, 2015 @09:19PM (#10051812)
This is largely a tradeoff between framerate and visual effects. Current generation consoles can make 60fps, but not with the level of visual effects that are expected from them. Whether or not this tradeoff is worthwhile is at least partially personal opinion (my opinion on the subject is... mixed, although I think the option should be available both ways).

Either way, it is undeniably harder to sell new consoles, or games for those consoles, when screenshots of them looks the same as it did in the previous generation, even if those screenshots were taken at 60fps.

Re:Netflix – Chasing 60fps [video] by kozukumi on Thursday August 13, 2015 @04:36AM (#10052845)
In all honesty this is what Java was designed to tackle.
Re:Netflix – Chasing 60fps [video] by comex on Wednesday August 12, 2015 @07:40PM (#10051489)
These days, more like millions of (textured) polygons :)
Re:Netflix – Chasing 60fps [video] by jeremiep on Wednesday August 12, 2015 @07:58PM (#10051542)
Depends of your platform, shader complexity, the number of GPU context switches and the number of sync points.

Mobile devices for example still have a hard time going over the quarter-million mark and thats assuming the GPU is near 100% usage, which in reality is probably closer to 60%.