blog-RuinDig

短かったり長かったりする。Blog posts are my own.

Intel Mapの新たな描画アルゴリズムについて:日本語訳

新しい描画アルゴリズム

1週間前にIntel Mapの新しい描画アルゴリズムが導入された事が発表された。コントロールフィールド→リンク→ポータルの順に描画する事で表示速度が向上したという。

community.ingress.com

日本語訳

レンダリングとは、ポータル、リンク、またはコントロールフィールドの位置に関する全てのデータを取得し、画面上に描画するプロセスです。従来のレンダリング形式は、基本的には空白のキャンバスを用意して、各データポイントを1つずつ描いてから、フレームを完成させてユーザーに表示します。更新するには、フレームを破棄してから、このプロセスを全てやり直します。大規模なデータセットでは、フレームの描画に非常に長い時間がかかり、そのほとんどが既存のデータの再描画に費やされます。要するに非効率なのです。」

「2012年に開発されたこのアルゴリズムは、これまでのIntel Mapで使用されていた一般的なアルゴリズムで、初期ロード時間を短縮するために1回で全てのデータを読み込むのではなく、『チャンク』単位でデータを読み込みます。また、全てのフレームを破棄するのではなく、データを見て何が変わったかを確認し、更新されたデータを削除して再描画します。しかし、アメリカのサンフランシスコや日本の東京のようなポータルが密集している地域では、ご存知のように、初代のIntel Mapは読み込みを終えるのに数分かかる事がありました。」

「新しいIntel Mapのレンダリングアルゴリズムは、各『チャンク』の定義方法を変更する事で、これまでのものを改善しています。2020年の携帯電話は、2012年の平均的なハードウェアよりもはるかに高性能です。現在では、設定された数ではなく、時間内に可能な限り多くのデータを読み込む事で、アルゴリズムが各ユーザーのデバイスのCPU性能に適応できるようにしています。」

「さらに、フレームごとにすべてのデータを解析するのではなく、レンダリングが完了したら、フレームの終わりや数フレームの終わりなど、すべてが正しいかどうかを確認します。」

「最後に、レンダリングでは、コントロールフィールド、次にリンク、その次にポータルが優先されます。この順番でデータをレンダリングすると、マップのより広い領域が最初に塗りつぶされ、視覚的な進行状況がより早く表示される事が分かりました。」

「一言で言えば、新しいIntel Mapのレンダリングアルゴリズムは格段に速くなったという事です。反復的な作業が減り、より効率的に動作するようになりました。これらの変更によるパフォーマンスの向上は、パソコンよりも携帯端末で際立っていて、ポータルの密集した領域の読み込み時間を数分から数秒に短縮する事ができます。 」

比較資料として以下の動画が紹介された。

www.youtube.com

原文

Rendering is the process of taking all of the data about where a Portal, Link, or Field is and drawing this on the screen. Traditional render methods essentially take a blank canvas, then paint each datapoint one at a time, until finishing the frame and displaying this to the user. To update, it then discards the frame and starts this process all over again. With large datasets, drawing the frame can take a very long time, most of which is spent redrawing existing data — tl;dr: it’s an inefficient process.

Developed in 2012, the general algorithm used by the original Intel Map loaded data in “chunks” rather than all at once to try and reduce initial loading times. And instead of discarding every frame, it looked at the data to see what changed, then removed and redrew the updated data. But in Portal dense areas, like San Francisco and Tokyo, as you’re well aware, the original Intel Map could still take minutes to finish loading.

The new Intel Map rendering algorithm improves upon the original by changing how we define each “chunk.” Mobile phones in 2020 are much more performant than the average hardware available in 2012. We now load as much data as possible within a time window versus a set number, which allows the algorithm to adapt to the CPU performance of each Agent’s device.

Additionally, instead of parsing all of the data with every frame, we check to confirm everything is correct once the render is done, whether that’s at the end of the frame or at the end of a few frames.

Finally, rendering now prioritizes Fields, then Links, then Portals. We found that rendering the data in this order makes larger areas of the map fill in first, showing visual progress earlier.

In a nutshell, the new Intel Map rendering algorithm is a lot faster. It’s now doing less repetitive work, and also working more efficiently. The performance gains from these changes are even more noticeable on mobile than on desktop, and can reduce loading times of Portal dense areas from minutes to several seconds.

出典:Ingress Community Forums, Dev Diary: New Intel Map Rendering Algorithm,
https://community.ingress.com/en/discussion/11611/dev-diary-new-intel-map-rendering-algorithm/p1, posted on July 17th, 2020, last accessed on July 24th, 2020.

-end-