This is such a comprehensive analysis, thank you. For someone just starting to learn about the field, it’s a great way to understand what’s going on in the industry.
My understanding is canvas also applies AA the rectangle lines still look AA just at a higher DPI.
It looks to me like the rectangles done in WebGL are drawn at the scaled resolution (1920 x 1080) vs the unscaled resolution (3840 x 2160), whereas the canvas is DPI aware and drawing at the full 4k resolution.
I would need to dig further but basically in WebGL the rectangles are drawn to a texture at the lower res then upscaled just like a straight image of a rectangle prerendered would be at the lower dpi.
Edit:
Looks like paper.js is specifically HiDpi aware and it can be turned off for better performance which would be more fair when compared to the other implementations:
hidpi="off": By default, Paper.js renders into a hi-res Canvas on Hi-DPI (Retina) screens to match their native resolution, and handles all the additional transformations for you transparently. If this behavior is not desired, e.g. for lower memory footprint, or higher rendering performance, you can turn it off, by setting hidpi="off" in your canvas tag. For proper validation, data-paper-hidpi="off" works just as well.
Also PixiJS seems to support HiDpi if resolution is set properly:
// Use the native window resolution as the default resolution
// will support high-density displays when rendering
PIXI.settings.RESOLUTION = window.devicePixelRatio;
I'm not familiar with PixiJS in any way other than knowing that it's a game engine. What is the difference between doing single PIXI.Graphics for the whole canvas vs PIXI.Graphics for every rectangle? Pros / cons?
I see you saw the response on the issue, for anyone else this was the response:
The golden rule is the less you have to clear() and redraw the insides of the graphics the faster it's going to be as pixi.js has to convert your draw commands to triangles to pass to WebGL, if you're just moving the position of something it can use the already calculated triangles and just add an offset before drawing whereas previously you were generating new triangles and hardbaking the position into the triangles each frame.
Because you move each rectangle at a different rate I used a separate graphics instance so that we could move them without having to redraw them.
FWIW the code in the post doesn't use sprites. I think it is done intentionally because not all of the engines support sprites. As someone mentioned in this thread if PixiJS would use sprites, it could be 10x faster.
I totally agree with you. In most of the cases this is the most reasonable strategy, unless you really understand what you do. A lot of good code bases live this way. There are usually too many things contributed to existing code. A complete rewrite worth it only when you know for sure, that you can throw away most of the details and nuances of the existing code.
Even though the bug report is thousands of years old now, there's still no patch available. Some people think this means the maintainer has abandoned the project.
I know that. I mean that I love HN mostly for smart comments. Sometimes I don't read an article, I read its comments. :) But blaming without evidence is not that kind of comments.
I also noticed that simple questions somehow get higher popularity. If you ask something very specific to your problem, chances are this question won't be answered and also will be downvoted. So people rather answer "how to find an object in JS array" rather than "I have this weird error in X library, how to fix it?". But in my opinion, basic stuff is not what you face with in everyday job. It's all these unexpected errors, bugs and lack of documentation, what makes you Google it. In this sense, GitHub Issues does a better job than SO.
I have never seen GitHub Issues in a search result. It seems like it is for bug reporting in personal projects. Why would it help with other people's errors?
I'm Russian. And while I agree that we have a propaganda, I can't say that the situation is any better in the West.
When I was living in UK for a while, I was amazed by how some really smart people have 100% level of trust to national media, so that they can't even perceive another point of view. All arguments were based on the fact that their media is historically old and never lies because it can't risk its reputation. And all Russian media is propaganda and controlled by Putin. It was 2014 and I can't say how much I was asked what I think about Putin. Honestly I didn't know what to answer because I don't like to talk about politics.
But since that time I know that if you look around the world you will notice the same BS but in different boxing. And people are equally vulnerable to buy it.
I agree with you that there are many people in the West who have (almost) 100% trust in national media, and that that level of trust is misplaced, but I don't agree at all that the situation is the same as in Russia (where I've been and where I know some people).
The difference is that here in the West there are lots of agendas being pushed, but there are also lots of competing ones, lots of different points of view, and much more freedom to express them. The end result is - or at least was, the situation isn't improving lately - that the government can't get away with lies as big as the ones Putin pushes (eg: "we have no soldiers in Ukraine" "we're never going to annex Crimea" etc. etc.)
I cannot disagree with your point. But we still have a lot of people who refuse to get information from propaganda sources. And this is a good sign. I hope we will get even better in this in the future and there will be more freedom in media.
Absolutely, I didn't mean that all Russians buy the propaganda - I also know how distrustful of the government you are on average. But it's a fact that it's very difficult to get good news sources for those who only understand Russian.
Yes we have lots of agendas, but in my lifetime only one agenda has been constant through all the surface changes: spend more money fighting more wars. At least when the Russians fight a war, they win, sometimes. The lie about USA military/LEO effectiveness is so big you can't even see it as a proposition that could be true or false. It's like water to a fish.
When it comes to big issues (eg the UKs EU referendum or national elections in either the US or UK) I don't believe there are a lot of agendas being pushed. If anything, the majority of the mainstream press tend to rally behind the same interests and that position is usually the one that the owners of said news outlet stand to gain the most. (eg leaving the EU, supporting a corporation friendly government such as Trump / Tories, even denying climate change so they have fewer restrictions et al running their business).
Just because there is more choice in "independent" news outlets, it doesn't mean there is more independent opinions being voiced.
Obviously there are going to be exceptions to the rule, hence why the language I used didn't say "all" or other exclusive terms. However the ratio would seem to be in the favour of right wing politics Vs left wing - and particularly so if you also factor in copies sold of each specific publication into your analysis.